How do I convert a time domain signal to frequency domain?

4 次查看(过去 30 天)
I am having some problems converting a time domain signal into frequency domain--I don't have constant sampling time.
In time domain, is this the way to plot the graph?
value = [42007935 111212895 184546560 238219725 238219725 184546560 111212895 42007935]; time = [0, ,5,1.25,2, 2,5,5, 4, 4.5, 6, 7, 8 ];
plot (time, value);
X and/or Y arguments ignored.
Could anyone help me plot a signal that does not have constant time?
  2 个评论
Star Strider
Star Strider 2014-5-12
If you want to plot them, your time and value arrays have to have the same number of elements. They don’t.
dpb
dpb 2014-5-12
编辑:dpb 2014-5-12
Look for NUFFT (non-uniform FFT) literature -- there's quite a lot.
You surely have the sample times or at least delta-t's, don't you? W/o that you have nothing.
Don't believe TMW has an implementation packaged as yet, anyway.
ADDENDUM:
You might check the File Exchange for submissions and of course there's always a search including Matlab in the search.

请先登录,再进行评论。

回答(2 个)

Vilnis Liepins
Vilnis Liepins 2014-5-13
Hello,
To convert nonuniform time domain data to frequency domain you can use Extended DFT (program NEDFT.m) available on fileexchange http://www.mathworks.com/matlabcentral/fileexchange/11020-extended-dft
NEDFT call line:
F=nedft(value,time,fn);
where frequencies [fn] could be generated as
fn=[-ceil((N-1)/2):floor((N-1)/2)]/N/T;
As I see from your example [time] data the mean sampling frequency T=1. The length of DFT N usually is set equal to or greater than the length(value) that, as Star Strider commented, should have the same dimensions as [time] array.
After that you also be able to get back constant time version of your data [value1] by applying IFFT to the result of NEDFT, call line:
value1=real(ifft(fftshift(F)));
  1 个评论
Yogesh Babu
Yogesh Babu 2014-5-16
Hello,
Thank you very much for your answer. May i know in that program where should i specify time and value parameter

请先登录,再进行评论。


Vilnis Liepins
Vilnis Liepins 2014-5-19
编辑:Vilnis Liepins 2014-5-19
Actually they are specified in your post:
>> value = [42007935 111212895 184546560 238219725 238219725 184546560 111212895 42007935];
>> time = [0, ,5,1.25,2, 2,5,5, 4, 4.5, 6, 7, 8 ];
Note that you need to correct the 'time' vector: time(1)<time(2)<time(3)<... and length(value) must be equal to length(time):
- the signal value(1)=42007935 is taken at time(1),
- the signal value(2)=111212895 is taken at time(2), and so on.
  8 个评论
Yogesh Babu
Yogesh Babu 2014-5-28
Hello Vilnis Liepins, I AM UNABLE TO FIND your updates which is on 19 May 2014 at 11:15.Could you please guide where it is exactly
dpb
dpb 2014-5-28
It's about four or five comments past...you only need to use the
"Show N older comments"
button to see the previous that have been collapsed by the viewer by default.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Signal Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by