This question is about combining 2 sinusoids with frequencies $\omega_1$ and $\omega_2$ into 1 "wave shape", where the frequency linearly changes from $\omega_1$ to $\omega_2$, and where the wave starts at phase = 0 radians (point A in the image), and ends back at the completion of the at $2\pi$ radians (point E), resulting in a shape similar to this, assuming $\omega_1$ is a lot smaller (larger period) than $\omega_2$:

enter image description here

Note that the amplitude is the same for both waves: points B and D are at equal distance from the $x$-axis.

  • Is there a closed-form definition for this, like linear frequency modulation?
  • Part of my question is also: where does point C end up on the x-axis if the "wave" starts at the origin (0,0)?

I was thinking about something like this:



  • w1: frequency 1
  • w2: frequency 2
  • t: a vector going from 0 to ((1/w1)+(1/w2))
  • T: some arbitrary number: this is part of the question I suppose..

1 Answer 1


Let us assume the following signal form $$x(t)=\sin(2\pi t f(t))$$ where $f(t)$ is some "instantaneuous frequency", which should increase linearly from $w_1$ to $w_2$ over the time.

The time should end, when the sine wave has done one period, i.e. its argument became $2\pi$. At this time, $f(t)=w_2$. From that we can calculate:

$$2\pi w_2 t_e=2\pi\\t_e=1/w_2,$$ where $t_e$ is the end time of the simulation. Hence, we have $$f(w)=w_1+\frac{w_2-w_1}{t_e}t=w_1+(w_2-w_1)w_2t.$$ We can plot this function:

w1 = 5
w2 = 10
T = 1/w2

Fs = 100000

t = np.arange(0, T, 1/Fs)

f = np.linspace(w1, w2, len(t))
plt.plot(t, np.sin(2*np.pi*f*t))

enter image description here

Now, regarding the question, where the zero is. The sine goes to zero, when its argument becomes $\pi$. Hence, we have

$$2\pi (w_1+(w_2-w_1)w_2t)t=\pi,$$

which we can solve by (its a quadratic equation, so nothing special, but I use mathematica for convenience):

$$\text{Solve}\left[t (t \text{w2} (\text{w2}-\text{w1})+\text{w1})=\frac{1}{2},t\right]$$

$$\left\{\left\{t\to \frac{\sqrt{\text{w1}^2-2 \text{w1} \text{w2}+2 \text{w2}^2}-\text{w1}}{2 \left(\text{w2}^2-\text{w1} \text{w2}\right)}\right\},\left\{t\to \frac{\sqrt{\text{w1}^2-2 \text{w1} \text{w2}+2 \text{w2}^2}+\text{w1}}{2 \left(\text{w1} \text{w2}-\text{w2}^2\right)}\right\}\right\}$$

There are two solutions, because for negative t, we can also end up with a solution (both $f(t)$ and $t$ would be negative to yield 1/2 as the argument).

To answer the comment from @Jason R: This indeed can also be seen as a frequency-modulation, given by


when setting


In this case we have $tf(t)=\int_0^t\phi(\tau)d\tau$.

  • $\begingroup$ This isn't really linear frequency modulation. The instantaneous phase of an FM signal is usually represented as the time integral of the signal's frequency function. In this example, you're instead taking subsequent samples of many sinusoids at different frequencies at slightly different periods of time, then interleaving them. That's not the same effect that you would get by starting with a sinusoidal function and linearly varying its frequency over time; you need to model the accumulation of phase from earlier time instants. $\endgroup$
    – Jason R
    Commented Jan 24, 2017 at 16:37
  • $\begingroup$ @JasonR Well, actually, it can be considered as linear FM, see my edit: the phase as the integral of some function (that grows linear with time) gives the same expression for argument of the sine. $\endgroup$ Commented Jan 24, 2017 at 16:46
  • $\begingroup$ It is linear FM, but not in the manner you described. It is not a linear ramp between frequencies $w_1$ Hz and $w_2$ Hz. Look at the derivative of the phase of the signal you generated (i.e. the instantaneous frequency, a somewhat squishy term) and note that its rate of change exceeds $w_2$ Hz by the end of the array that your code snippet generates. $\endgroup$
    – Jason R
    Commented Jan 24, 2017 at 17:29
  • 1
    $\begingroup$ Is it possible that there's a typo: "The time should end, when the sine wave has done one period, i.e. its argument became 2π. At this time, f(t)=w1f(t)=w1." Shouldn't that be ... At this time, f(t)=w2? $\endgroup$
    – MisterH
    Commented Jan 26, 2017 at 5:16
  • $\begingroup$ Thans for pointing this out, I've corrected it. $\endgroup$ Commented Jan 26, 2017 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.