フィルターのクリア

How to take frequency samples and time interval to plot fft in MATLAB?

2 ビュー (過去 30 日間)
Payal Arora
Payal Arora 2013 年 7 月 24 日
Hello,
i have a vector containing 2048 data(ASCII file) in this manner like [87 92 80 45 .... ]. I want to plot fft of this data. So I just want to know how to take frequency sample and time interval to plot fft of this data? I wrote the following code to calculate fft of this code. Please suggest whether the frequency sample and time interval is right or wrong? or suggest the code to calculate fft of this data.
I = load('data1.asc');
for i = 1:2048
x = I(:,2);
end
plot(x)
*Fs = 40000; * Frequency Samples
*T = 1/Fs; * Time
L = 2000;
NFFT = 2^nextpow2(L);
Y = abs(fft(x,NFFT))/L;
f = Fs/2*linspace(0,1,NFFT/2+1);
figure, plot(f,2*abs(Y(1:NFFT/2+1)))
axis([0 40000 0 40])
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')

回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by