Sampling frequency in fft analysis.
显示 更早的评论
Dear Friends, i have daily(one day one value) data for 5 years. How to give the time (sampling frequency) in fft analysis. Here i attaching the code. Please correct it and give me suggestions. Here attaching the data also (txt), Thanking you
X=xlsread('data.xlsx');
xfft = fft(X(:,2));
n=length('enter the length of fft');
DT = X(2,1)-X(1,1);
% sampling frequency
Fs = 1/DT;
DF = Fs/size(X,1);
freq = 0:DF:Fs/2;
xfft = xfft(1:length(xfft)/2+1);
plot(freq,abs(xdft));
xlabel ('Frequency');
ylabel ('power');
title('S-fft')
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Frequency Transformations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!