Amplitude Error in amplitude Spectrum of FFT
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (1)
ong
il 21 Apr 2013
Categorie
Scopri di più su Transforms in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!