Amplitude Error in amplitude Spectrum of FFT
Afficher commentaires plus anciens
Hello
I'm currently working on FFT on cosine and sine function. I want to get the FFT graph to be plotted. The graph of the FFT looks fine except that the value of the amplitude were a bit off.
The amplitude was suppose to be '1', however, at different frequency, the amplitude will change from 0.8 to 1.5.
The code looks like this: Fs=1000 t=0:1/Fs:1;
NFFT = 2^nextpow2(length(x)); y = fft(x,NFFT)/length(x); y = y(1:NFFT/2+1); my = 2*abs(y); f = Fs/2*linspace(0,1,NFFT/2+1);
plot(handles.freqdomain,f,my) xlabel('Frequency(Hz)') grid on
Any help is appreciated. Thanks in advance.
Réponse acceptée
Plus de réponses (1)
ong
le 21 Avr 2013
Catégories
En savoir plus sur Transforms 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!