Revised: find the frequency corresponding to max. magnitude in spectrum (FFT)
Afficher commentaires plus anciens
the spectrum of a message is shown as follows

where magnitude plot of the Fourier transform for message versus frequency in Hz is seen.
how can i find the dominant frequency with the use of the command max and command freqz?
Réponse acceptée
Plus de réponses (1)
Wayne King
le 4 Oct 2012
Modifié(e) : Wayne King
le 4 Oct 2012
If you are using freqz(), freqz() returns the frequency vector, so just query the max value of the absolute value of the frequency response and then use that index to find the frequency.
h = [1/sqrt(2) 1/sqrt(2)];
[H,F] = freqz(h,1);
[maxval,index] = max(abs(H));
F(index)
This example gives 0, because h is a lowpass filter with the maximum at 0 radians/sample.
freqz() takes the sampling frequency as an input argument so that you can get the frequencies in Hz.
Catégories
En savoir plus sur Digital Filtering dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!