From: Daly on
Hi,
I have some problem with IFFT in MATLAB. First i have a vector frequency f, and a vector for corresponding spectrum XF. XF is calculated with a Mathematic expression. The size of this vectors is very long. So i reduce it by using : f=f(1:3:end); and i do the same thing for XF. This is to reduce time computation used in calculating XF.
Then i use an ideal low pass filter h to restitute the desired signal. By using the IFFT function of MATLAB i got the time domain desired function.Finally i must evalute the expression A. Here the essential of program :

h=rectpuls(f,2*fb); %fb is my cutoff frequency
XFfilt=XF.*h;
XFfilt=ifftshift(XFfilt);
XFfilt=length(f)*ifft(XFfilt);
A=max(abs(XFfilt));

The problem is : When i used the original frequency vector with long size and the corresponding spectrum vector i got the desired value of the quantity A, but if i reduce this frequency vector (f=f(1:3:end)) with its corresponding spectrum vector i obtained a different value of A.
It would be greatly appreciated if someone can help me out.
Thanks.