Solving roots of a sum of sinusoids

301 Views Asked by At

Suppose I have a sinusoid with fundamental frequency $f_0$ and $N$ harmonics (all with distinct amplitudes $a_k$. Each harmonic also has it's own corresponding phase $\phi_k$ and offset $c_k$.

$y(t) = \sum_{k=0}^{N} [a_k sin(2 \pi k f_0 t + \phi_k)+c_k]$

How could one find the zeros of such a function? I have a microprocessor computing necessary parameters (amplitude, phase, offset of each frequency component) as the signal is passed, and I'd like to figure out the zeros of the function ahead of time (before the signal actually hits 0).

One approach was to approximate each sinusoid as a Taylor series of, say, 8 degrees for each sinusoid... but then solving the roots of that polynomial gets a bit complicated for a microprocessor.

1

There are 1 best solutions below

2
On BEST ANSWER

You can combine all the $c_k$'s into a single $c$. Then I think (unless $N$ is small) you are in for a numeric solution. The function repeats every $\frac 1{f_0}$ seconds, so you just have to look over that span. Evaluate it on a mesh of points and use a root finder. The challenge will be places where it dips down toward the axis and turns around-does it cross (making two roots) or not? A function minimizer will help there. These are described in any numerical analysis text. The Taylor expansion is too local for your application-it will take too many terms to converge.