Forums

using ifft in MATLAB

Started by bclark2125 April 4, 2003
I am having trouble getting the following problem to work-can anybody
help me? problem:Obtain the 1024-point inverse FFT of a sequence of numbers
whose imaginary parts are
all zero, and the real parts are the following:
b(1)=b(1023)=0.5
b(3)=b(1021)=0.1
b(i)=0.0 for all other i in the range [0,1023] Here is my code:

n24; %Matrix size

X=zeros(n,1);
X(2.1)=.5;
X(1024,1)=.5;
X(4,1)=.1;
X(1022,1)=.1;
Y=ifft(X,n);
figure
plot(Y)
%Fs = 10.24e3;
%t = [0:1023]/Fs;
figure;
plot(t,abs(Y))