discrete fourier

Dear all, I need to find the fourier transform of a signal. My problem is that I don't have the analytic expression of it but a file with the datas (displayed in two columns one for the time the other for the signal). I have already extracted the datas with the importdata command and I now need to get the fourier transform graph (my sample time is constant). Any help would be highly appreciated. Thanks in advance. Ingrid

Answers (4)

Ingrid
Ingrid on 15 Jul 2011

0 votes

I have already looked at the help. In the examples they give, the analytic expression of the signal is known which is not my case. I've also read the article about discrete fourier which I think might be more appropriated to what I want to do but it didn't help either.

1 Comment

The FFT is the discrete fourier transform - no analytical solution is required.
fft(rand(10,1))

Sign in to comment.

Hello Ingrid,
Did you try reading all the contents of your file into a cell variable and then perform fft on it ?
Something like this.
x = load('your file');
y = fft(x);
Not sure this will help you but try this.
Ingrid
Ingrid on 15 Jul 2011

0 votes

Thank you for your help but it does't work. According to the error message, I bet it is because q is a structure (composed of the time and the amplitude of my signal).
I didn't mention it earlier but my file has a header. It's the reason why I have used importdata and it is maybe this that bothers me to use what you advised me.

5 Comments

So extract the components from the structure
doc struct
for info on how to do that. Also, edit your original question or use comments instead of writing new answers.
Ingrid
Ingrid on 15 Jul 2011
Excuse me I didn't know.
If I extract the components I am going to loose part of my information no? I will only be able to do the fft on one of my columns and not take into account the signal?
(I'm sorry if my questions sounds stupid I don't have a lot of experience with this software)
Is the time monotonically increasing?
To use fft() the times would have to be strictly increasing by a constant interval. MATLAB does not supply a routine for irregularly spaced discrete fft, but I seem to recall there are some File Exchange contributions for it. Unfortunately at the moment I do not recall the proper name for this calculation.
but a simple interp1 could hopefully do the trick :)

Sign in to comment.

Tags

Asked:

on 15 Jul 2011

Community Treasure Hunt

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

Start Hunting!