Friday, 1 May 2015

dsp puzzle - Simulation of a Frequency ramp


This might be an easy one!


Please preface your answer with spoiler notation by typing the following two characters first ">!"


Given the following equation that describes a cosine wave as a function of time:


$$m(t) = \cos(2\pi f t) $$


We know that $t$ is the independent variable for time in seconds, and $f$ as a constant value will be the frequency of the cosine in $\textrm{Hz}$.


What if f is a linear ramp over time?


Given a time domain waveform $m$ with a linearly increasing frequency over time, that starts at $t=0$ with frequency $F_1\textrm{ Hz}$ and ends with frequency $F_2\textrm{ Hz}$:


Provide the expression for $f(t)$ in terms of $F_1$ and $F_2$ and $T$, that would create a function $m(t)$ whose frequency starts at $F_1$ and ends at $F_2$, with the frequency linearly increasing over some arbitrary time period $T$.


The actual spectrum, as in any spreading effect due to the ramp rate, is of no interest to this solution.



Hint:



The answer is a simple linear equation ($y = mx+b$), with a $y$-intercept $b$ that is a constant dependent only on $F_1$ and value $y$ at time $T$ is another constant dependent only on $F_2$ --- what are those two constants with relation to $F_1$ and $F_2$?




Answer



I waited a bit to see if someone else takes the challenge, but since there are no answers yet, I'm providing mine now.



For a given signal $m(t)=\cos(\phi(t))$ the instantaneous frequency is given by $$\nu(t)=\frac{\phi'(t)}{2\pi}\tag{1}\\$$One pitfall here is that if we write $m(t)=\cos[2\pi f(t)t]$, $f(t)$ is generally not the instantaneous frequency (unless $f(t)$ is constant).

We want the following instantaneous frequency:$\nu(t)=\begin{cases}F_1,&tt_2\end{cases}\tag{2}\\$

From $(1)$ and $(2)$, in the time interval $[t_1,t_2]$ the phase $\phi(t)$ must be chosen as $$\frac{\phi(t)}{2\pi}=F_1t+\frac{F_2-F_1}{t_2-t_1}\left(\frac{t^2}{2}-t_1t\right)+C\tag{3}$$

Choosing $C=0$, and since $\phi(t)/(2\pi)=f(t)\cdot t$, we get from $(3)$ $$\begin{align}f(t)&=F_1+\frac{F_2-F_1}{t_2-t_1}\left(\frac{t}{2}-t_1\right)\\&=F_1-\frac{\Delta F}{\Delta t}t_1+\frac12\frac{\Delta F}{\Delta t}t,\quad t_1


No comments:

Post a Comment

readings - Appending 内 to a company name is read ない or うち?

For example, if I say マイクロソフト内のパートナーシップは強いです, is the 内 here read as うち or ない? Answer 「内」 in the form: 「Proper Noun + 内」 is always read 「ない...