errors appear when doing FFT on data imported from text file
Mostra commenti meno recenti
trying to determine the frequency estimate after doing FFT on data imported from a text file.
load spot_num.txt
ssn = spot_num(:,3);
ssn = ssn-mean(ssn);
x=ssn;
xdft = fft(x);
xdft = xdft(1:length(x)/2+1);
freq = 0:Fs/length(x):Fs/2;
[maxval,idx] = max(abs(xdft));
freq(idx)
it returns:
Error in ==> Untitled3 at 7
freq = 0:Fs/length(x):Fs/2;
so whats wrong with that?
Risposta accettata
Più risposte (1)
Wayne King
il 24 Ott 2012
0 voti
What error message does it produce?
What is the value of Fs? Nothing in the code you've shown us gives us the value of Fs.
Fs should be the reciprocal of the time interval between each sample in spot_num
1 Commento
modified covariance
il 24 Ott 2012
Modificato: modified covariance
il 24 Ott 2012
Categorie
Scopri di più su Spectral Measurements 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!
