显示 更早的评论
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 个评论
Paulo Silva
2011-7-5
Fs=1/Ts , Ts should be constant, like you say it's the diference between two consecutive time values.
Aishanou
2011-7-5
Ashish Uthama
2011-7-6
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.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!