MATLAB: Obtaining fundamental frequency of complex signal from Fourier transform

fourier transformfttperiodsignal period

I have a complex periodic signal buried in noise. The magnitude spectrum of the FFT shows 3 peaks at 20 Hz 70 Hz and 174 Hz. I need to find the fundamental frequency of the signal. Is it possible to do this simply by looking at the magnitude spectrum of the Fourier transform? The power spectrum also shows the same 3 peaks.
Thanks

Best Answer

I think the answer depends on what you mean by "looking directly at the magnitude spectrum of the Fourier transform." If what you are looking for is an automated (i.e., programmatic) way of detecting the fundamental frequency, then there are essentially two tasks:
  1. Identify the spectral peaks
  2. Find the fundamental from the peak locations
The first task is something you should be able to accomplish with the findpeaks function in the Signal Processing Toolbox. This is the easier of the two tasks.
As for the second task, I believe the following approach will work (even if the frequencies are not integers). If each frequency is an integer multiple of the fundamental, then when each frequency is divided by the minimum frequency of the set, the resulting quantity will be rational. You can extract the numerator and denominator of these ratios using the rat function :
>> [N,D] = rat(f/min(f));
The maximum denominator factor that is possible is i, the multiple of the fundamental for the minimum frequency in the set ( i.e. , fmin=i*f0 ). Therefore, you should be able to determine the fundamental frequency as
>> f0 = min(f) / max(D);
For example:
>> f0 = 20 + rand % pick a random frequency for the fundamental
f0 =
20.2785
>> f = [3 4 8 12 22]*f0; % some set of harmonics
>> [N,D] = rat(f/min(f));
>> min(f)/max(D) % try to find the fundamental
ans =
20.2785
Related Question