Afficher commentaires plus anciens
A very fundamental doubt... I have a a signal as a 2xN array. The first row contains the time instants at which samples have been taken and the second row contains the data values at those sampling instants. Now when i take the fft of the data values, how do i map the corresponding time values in frequency domain. As in, i wish to plot the fft vs frequeny. How do i obtain the frequency axis?
code which i have used
Fs=500; L=length(sym_signal); y=sym_signal(7,:); NFFT = 2^nextpow2(L); % Next power of 2 from length of y Y = fft(y,NFFT)/L; f = Fs/2*linspace(0,1,NFFT/2+1); plot(f(1:100),2*(abs(Y(1:100))));
The Fs which i have used is obtained by finding the reciprocal time interval between two consecutive time values. Is this the correct way of doing it?
3 commentaires
Paulo Silva
le 5 Juil 2011
Fs=1/Ts , Ts should be constant, like you say it's the diference between two consecutive time values.
Aishanou
le 5 Juil 2011
Ashish Uthama
le 6 Juil 2011
Please consider using a more descriptive title and formatting the code.
Are you saying that your sampling is not uniform? A naive approach might be to resample/interpolate the data to obtain uniform sampling (and thus, a constant Ts). This will introduce some artifacts, and I am sure there are better ways.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Fourier Analysis and Filtering 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!