Trying to find error value in FFT compuation

I am trying to compute the error in my FFT code.
clear vars
close all
M = 128;
cutoff = .05;
a = -5;
b = 5;
zeroed = 5;
x = linspace(a,b, M);
y = 1 ./ (1 + x.*x);
Y = fft(y);
YY = fft(y);
PSD = Y.*conj(Y);
freq = 1/(b-a) * (0:M-1);
cratio = 100* zeroed/M;
YYinv = ifft(YY);
errYYinv = ;
Invalid expression. Check for missing or extra characters.
plot( x,y,'k', x,YYinv,'r' )
title('data y (black) and compressed YYinv (red)')
pause
id = fopen('out-compress','a');
fprintf( id,'# M=%i samples of Runge function \n', M );
fprintf( id,'# cutoff   errYYinv   zeroed   cratio \n' );
fprintf( id,' %.2f %.2e %4i %.0f \n', cutoff, errYYinv, zeroed, cratio);
fclose(id);
plot( freq, PSD );
title('Power Spectrum Density (PSD) distribution vs frequency');
pause
Yinv = ifft(Y);
plot( x,y, x,Yinv,'o' )
title('data y and their iFFT: Yinv (o)');
pause

Respuestas (1)

Matt J
Matt J el 27 de Abr. de 2023
It's very simple. This line has nothing to the right of the '=' sign.
errYYinv = ;

2 comentarios

Matthew
Matthew el 27 de Abr. de 2023
I know but I am wondering what to put in that line
Matt J
Matt J el 27 de Abr. de 2023
Only you know what you are trying to compute.

Iniciar sesión para comentar.

Categorías

Más información sobre Fourier Analysis and Filtering en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 27 de Abr. de 2023

Comentada:

el 27 de Abr. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by