# Chirp zero crossings

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?

Thanks

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

• Hi Hilmar thank you for that answer. Say I wanted to make my chirp independent of sampling frequency knowing tk would become a problem? Jul 20, 2021 at 12:50
• @DeveloperR I don't understand that question! Sampling rate doesn't appear anywhere here, this is all continuous-time signals. Jul 20, 2021 at 12:54
• Ok Marcus what I mean is if I don't know tk then I can't solve for the kth crossing Jul 20, 2021 at 13:09
• @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$. Jul 20, 2021 at 14:11
• @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 ? Jul 20, 2021 at 16:39