# Simulation of a Frequency ramp

This might be an easy one!

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

• I guess you also need to specify the time interval during which you go from $F_1$ to $F_2$. – Matt L. Jun 16 '16 at 22:56
• I'm liking these puzzles, Dan. Keep them coming! :-) – Peter K. Jun 16 '16 at 23:33
• Matt- I see your point and updated the question to include the time span as a variable. – Dan Boschen Jun 17 '16 at 10:17
• Off Topic but "What is a spoiler notation ?", and what for? – Fat32 Jun 17 '16 at 20:35
• It hides the answer until you hover over it since it is a "puzzle" in case someone wants the opportunity to think about it before seeing the answer. – Dan Boschen Jun 17 '16 at 21:22

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

• Spoiler markdown doesn't work !!!??? – Matt L. Jun 17 '16 at 11:57
• 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
• @MattL, Yes that's much better- I updated it as you suggested.. – Dan Boschen Jun 17 '16 at 20:27