Plot fft result on linear period scale?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I need to plot the results of an fft on a linear period scale. The output is on a linear frequency scale. Is there an easy way to do this or will I have to interpolate?
0 Kommentare
Antworten (1)
Wayne King
am 10 Dez. 2013
If you really want to see the periods, then no you just have to plot by period.
Fs = 1000;
t = 0:1/Fs:1-1/Fs;
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
xdft = xdft(1:length(xdft)/2+1);
df = Fs/length(x);
freqvec = 0:df:Fs/2;
Periods = 1./freqvec;
plot(Periods(2:end),abs(xdft(2:end)))
set(gca,'xlim',[1/500 1/50]);
xlabel('Seconds');
2 Kommentare
Siehe auch
Kategorien
Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!