Sample search at the beginning of the composite periodic signal period

I have a signal consisting of the sum of a series of sine waves. They are spaced at a frequency of 100 Hz, with the lowest frequency frequency of 200 Hz (200 Hz, 300 Hz ... etc.). All the sinusoidal components of the component start at the same point with phase = 0. In my DSP software, where I am going to multiply this signal with several other signals, I need to find the point at which all the source signals of the signal component are again in phase = 0 .

If I used only one sine wave, I could just look for a change in sign from negative to positive. However, if a signal has, say, components at a frequency of 200 Hz and 300 Hz, there are three zero crossings where the sign changes from negative to positive, but only to the one that represents the beginning of the period, and this increases with a large number of component waves. I have control over the amplitudes of each frequency component during the initial startup sequence. If these waves were strictly harmonious (200 Hz, 400 Hz, 800 Hz, etc.), I could simply remove everything except the lowest frequency, find the beginning of my period and use it as my zero sample. However, I do not have this bandwidth. Can anyone suggest an alternative approach?

Edit:

(I refined and integrated this editing into the body of the question.)

Edit 2:

This figure should demonstrate this problem. The frequencies of the two components are n and 3n / 2. Without filtering everything except the lowest frequency, or accepting an FFT, as suggested by @hotpaw, an algorithm that only searches for zero intersections, where the sign changes from negative to positive, will fall into one of three, and I must find the first of them three (this one point at which each component signal is in phase = 0). I understand that FFT execution will work, but I am dealing with very limited processing power and wonder if there is a simpler approach.

Sample waveform

+5
source share
3 answers

Look at the derivative of the signal!

(, , )

S = sum(a_n * sin(k_n * t)) ... over all n

a_n - , k_n - . ( )

dS/dt = sum(a_n * k_n * cos(k_n * t)) ... over all n

t = 0 (, ) , .

: , , - .

+3

, , - , .

, (100 ). , 1 . ( ) . , , . ( FFT ) .

, / .

+1

. 100 "" . , , .

.

:

 static float a1 = 0;
 static float a2 = 0;
 static float b1 = 0;
 static float b2 = 0;

 static float y = 0;
 static float y_old = 0;
 static float u_old = 0;

 void
 init_lp_filter(float cutoff_freq, float sample_time) 
 {
   float wc = cutoff_freq;
   float h = sample_time;

   float epsilon = 1.0f/sqrt(2.0f);
   float omega = wc * sqrt(0.5f);
   float alpha = exp(-epsilon*wc*h);
   float beta = cos(omega*h);
   float gamma = sin(omega*h);

   b1 = 1.0f - alpha * (beta + epsilon * wc * gamma / omega);
   b2 = alpha * alpha + alpha * (epsilon * wc * gamma / omega - beta);
   a1 = -2.0f * alpha * beta;
   a2 = alpha * alpha;
 }

 float
 getOutput() {
   return y;
 }

 void
 update_filter(float input)
 {
   float tmp = y;
   y = b1 * input + b2 * u_old - a1 * y - a2 * y_old;
   y_old = tmp;
   u_old = input;
 }

, , . . , - , ( ), .)

!

0
source

All Articles