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

Answers (1)

It's very simple. This line has nothing to the right of the '=' sign.
errYYinv = ;

2 Comments

I know but I am wondering what to put in that line
Only you know what you are trying to compute.

Sign in to comment.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Tags

Asked:

on 27 Apr 2023

Commented:

on 27 Apr 2023

Community Treasure Hunt

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

Start Hunting!