5

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$?

Dan Boschen
  • 50,942
  • 2
  • 57
  • 135

1 Answers1

6

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,&t<t_1\\F_1+\frac{F_2-F_1}{t_2-t_1}(t-t_1),&t_1<t<t_2\\F_2,&t>t_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<t<t_2\tag{4}\end{align}\\$$ with $\Delta F=F_2-F_1$ and $\Delta t=t_2-t_1$.

Matt L.
  • 89,963
  • 9
  • 79
  • 179
  • Yes, it looks like mathjax and markdown spoiler code don't play nicely together. One option is to write all the maths in one line, which is a little painful. – Peter K. Jun 17 '16 at 12:46
  • @PeterK.: Thanks Peter, I saw that post too, but I got kind of discouraged ... – Matt L. Jun 17 '16 at 13:12
  • @MattL. fixed ! – Gilles Jun 17 '16 at 16:39
  • @Gilles: THANKS! (must check how you did that ...) – Matt L. Jun 17 '16 at 16:40
  • @MattL: EXCELLENT! I believe we are in total agreement (set $t_1=0$ to get the y=mx+b solution I was looking for). I guess I can make the question clearer by saying "that starts at t=0" – Dan Boschen Jun 17 '16 at 16:57
  • Good answer Matt. This is what I got too, but since @DanBoschen said the answer didn't depend on the time interval, I assumed I had misinterpreted the question. – MBaz Jun 17 '16 at 18:14
  • @Gilles : Neat trick! Must remember that in future. – Peter K. Jun 17 '16 at 18:16
  • I wish I asked Matt yesterday before scratching my head all afternoon at work thinking my stimulus simulation was in error!! Finally figured out the very "pitfall" Matt pointed out and thought it would be a good "puzzler". I don't think Matt spent nearly as much time thinking about it as I had to! – Dan Boschen Jun 17 '16 at 18:26
  • @MBaz: The end points of the function do not depend on the time interval, sorry that was not clear in my question (the slope of course does). – Dan Boschen Jun 17 '16 at 18:57
  • What was the trick Giles did to combine the mathjax and markdown spoiler code? – Dan Boschen Jun 17 '16 at 18:59
  • @DanBoschen I put everything into one ">!" paragraph, and paragraphed with <br/><br/> instead; and adding \\\ after some equations for proper spacing. Equations in one line as stated by @Peter K. I think that was all. – Gilles Jun 17 '16 at 19:14
  • @DanBoschen: OK, that's good. I was a bit confused by your (now deleted) comment that the time interval doesn't show up in the result, by the hint that the second constant in the equation only depends on $F_2$, and also that a "first order approximation is sufficient". Anyway, it all seems to be resolved. – Matt L. Jun 17 '16 at 19:42
  • @MattL, perhaps I should remove "Assume a very slow ramp; $T≫1/F$, and a first order approximation is sufficient." I put that in there so no one would go down the path of being concerned with sidebands and Bessel functions etc due to the FM modulation. The signal is not repeating, hence there will be no discrete sidebands but there still will be a spreading of the signal related to the ramp rate-- so was trying to avoid concern with that affecting the definition of the output frequency. Thoughts? – Dan Boschen Jun 17 '16 at 20:12
  • @DanBoschen: I think it's OK to remove that sentence to keep things simple. The other option would be to explicitly state that the actual spectrum is of no interest here. – Matt L. Jun 17 '16 at 20:26
  • 1
    @MattL, Yes that's much better- I updated it as you suggested.. – Dan Boschen Jun 17 '16 at 20:27
  • @MattL. Can this be extended to non-linear chrip, for example an exponential? – user27119 Apr 09 '21 at 17:05
  • @Q.P.: Anything, the instantaneous frequency is always given by Eq. $(1)$. – Matt L. Apr 09 '21 at 17:30
  • @MattL. Thanks! Does it then make sense to then think about an "average" signal frequency (in the frequency domain) in this context, as I asked in my question: https://dsp.stackexchange.com/questions/74377/what-is-the-the-resultant-or-final-frequency-of-the-fft-of-a-chirped-signal?noredirect=1#comment157596_74377. – user27119 Apr 09 '21 at 17:34
  • @Q.P.: You can compute an average but I'm not sure what you can do with it. It's probably only useful if there's only a small variation around that average (center) frequency. – Matt L. Apr 10 '21 at 07:19