Show older comments
Good Afternoon All,
I was wondering if matlab's fft function could only be applied to cartesian coordinates? I have generated polar coordinates for the data points and then use a cubic spline for create a function to run the fft on but when i apply the ifft the function seems to have scaled up and shifted. Is this a result of my coordinate system?
Thanks,
Mel
Answers (1)
Walter Roberson
on 9 Mar 2012
0 votes
fft does not know or care what kind of data it is being applied to.
What are you doing in-between the fft() and the ifft()?
If you fft() some data, change the first element of the result, and fft() back, you will see shifting, as the first element corresponds to the mean of the data (the "base line")
7 Comments
Melissa
on 9 Mar 2012
Sean de Wolski
on 9 Mar 2012
What is 'angles', 'radius' and any other variables we need to run our code?
Melissa
on 9 Mar 2012
Walter Roberson
on 9 Mar 2012
What do you get for
max(abs(fft_fun - fft_inverse))
Melissa
on 9 Mar 2012
Melissa
on 9 Mar 2012
Walter Roberson
on 9 Mar 2012
With that small of a difference between those two quantities, the fft / ifft is essentially leaving the data unchanged. If you were to assign
fft_inverse = fft_fun;
that is, to skip the fft and ifft, then you would have essentially no difference in the results.
Looking at your plot, the minimum and maximums of the two are the same, and basically you are just seeing the effect of having supplied explicit x coordinates for the first plot but having used the default 1:length(y) x coordinates for the second plot.
Try replacing your second plot() with
plot(rconvert.*angles, fft_inverse);
I am not positive that that will be correct, but it will give you the common x coordinates to work from for the plots.
Categories
Find more on Fourier Analysis and Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!