Sampling frequency in fft analysis.
Afficher commentaires plus anciens
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')
1 commentaire
srinivas kotta
le 16 Oct 2017
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Frequency Transformations 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!