I have a continuous-time signal that is of the form $$x(t)=A \sin(2 \pi f t+\phi_1)+B \sin(2 \pi (5f) t+\phi_2)+C \sin(2 \pi (7f) t+\phi_3)+n(t)$$ sampled at 50us where $f$ is the frequency I want to find out A,B and C are constants where $$0.15 \cdot A>B+C+|n(t)|$$. I don't need to know the value of any of the phases or amplitudes. I also know that the value of $f$ is 50Hz +/-15 Hz though i want to know it to at least +/- 1 Hz accuracy.
What ive tried so far:
- A PLL-because $f$ is quite a low frequency and my frequency range is so wide and harmonics were present, the bandwidth of my loop filter was quite limited, I couldn't beat a settling time of 100ms(within 1 HZ).
- DFT-Sampled over 100ms, the spectra was only really clear when $f$=50Hz.
- Measuring the time between zero crossings(Though this falls apart when the amplitudes of the harmonics and noise gets quite high)
Code used for DFT
T = 0.1; % sample time 100ms Ts = 50e-6; % Sampling period fs = 1/Ts; % Sampling rate t = 0:Ts:T-Ts; % Time vector of length 100ms f1=50; f2=35; f3=65; x1 = sin(f1*2*pi*t)+0.1*sin(3*f1*2*pi*t+pi/3)+0.1*sin(5*f1*2*pi*t+pi/3)+0.01*sin(50*f1*2*pi*t+pi/3); x2 = sin(f2*2*pi*t)+0.1*sin(3*f2*2*pi*t+pi/3)+0.1*sin(5*f2*2*pi*t+pi/3)+0.01*sin(50*f2*2*pi*t+pi/3); x3 = sin(f3*2*pi*t)+0.1*sin(3*f3*2*pi*t+pi/3)+0.1*sin(5*f3*2*pi*t+pi/3)+0.01*sin(50*f3*2*pi*t+pi/3); N = length(t); % Number of elements in the time vector F = fs/(N); % Frequency step for FFT display f = (-fs/2):F:(fs/2)-F; % Frequency vector(same length as the time vector) X=fftshift(fft(x1))/N; % FFT of the signal x1 (blue) X2=fftshift(fft(x2))/N; % FFT of the signal x2 from task 2 (red) X3=fftshift(fft(x3))/N; % FFT of the signal x3 from task 3 (black) figure(2); subplot(2,1,1), plot(t, x1, 'b', t, x2, 'r', t, x3, 'k'), axis([0 .1 -1.5 1.5]); legend('x=50Hz','x=35Hz','x=65Hz') subplot(2,1,2), plot(f, abs(X), 'b', f, abs(X2), 'r', f, abs(X3), 'k'), axis([-100 100 0 0.5]);