Comparison between numerical precision in FFT and manual FT: both error plots show very different behavior
Mostrar comentarios más antiguos
Hi, I was hoping someone could help me understand the effects of the numerical precision in Matlab's FFT. I setup a very simple code that perform the FFT and IFFT and compare my results to an FFT follwoed by a "manual" IFFT, I see a very strange increasing behavioir in the error and was wondering what this was due to. The fact that it increases with the sample number leads me to believe it's related to the index but I am not sure how I can mitigate this problem.
CODE:
N = 2^13;
x = rand(N,1);
xk = fft(x,N);
y = ifft(xk,N);
yr = zeros(N,1);
for k=1:N
yr = yr + xk(k)*exp(1i*2*pi*[0:N-1].'*(k-1)/N);
end
figure;
plot(abs(yr/N-x))
title 'hand ifft'
figure;
plot(abs(x-y))
title 'ifft'
Could it be the constants values? how does fftw actually handle these numbers.
Thanks for the help.
Alex
4 comentarios
Dr. Seis
el 2 de Jun. de 2012
I find this to be a very interesting observation, too. Incidentally, what do you mean by "constant values"?
Alex Singh
el 2 de Jun. de 2012
Alex Singh
el 3 de Jun. de 2012
Alex Singh
el 4 de Jun. de 2012
Respuestas (0)
Categorías
Más información sobre Fourier Analysis and Filtering en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!