I am generating a linear chirp in C code with a f0 , f1 and T. What is the most efficient way to solve where the zero crossings appear?



1 Answer 1


Assuming that T is the length of the chirp, a linear chirp is given by

$$x(t) = \sin\left[2\pi \cdot \left( t\cdot f_1+ \frac{t^2}{2T}(f_2-f_1)\right)\right] $$

A zero crossing occurs when the phase is an integer multiple of $\pi$, so we can determine the $k^{th}$ zero crossing is given by the relationship

$$ t_k\cdot f_1+ \frac{t_k^2}{2T}(f_2-f_1) = k/2$$

This is a quadratic equation that can be solved to determine $t_k$.

  • $\begingroup$ Hi Hilmar thank you for that answer. Say I wanted to make my chirp independent of sampling frequency knowing tk would become a problem? $\endgroup$ Jul 20, 2021 at 12:50
  • $\begingroup$ @DeveloperR I don't understand that question! Sampling rate doesn't appear anywhere here, this is all continuous-time signals. $\endgroup$ Jul 20, 2021 at 12:54
  • $\begingroup$ Ok Marcus what I mean is if I don't know tk then I can't solve for the kth crossing $\endgroup$ Jul 20, 2021 at 13:09
  • $\begingroup$ @DeveloperR you don't seem to understand the formula then: $t_k$ is the time at which the $k$th zero crossing takes place. You literally solve for $t_k$. $\endgroup$ Jul 20, 2021 at 14:11
  • $\begingroup$ @DeveloperR: what exactly do you mean by "solving for the kth zero crossing". The answer allows to calculate the time at which the zero crossing occurs for any value of k. Is there something else you want or need ? $\endgroup$
    – Hilmar
    Jul 20, 2021 at 16:39

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.