How do I implement inverse fft on Freemat?

225 views
Skip to first unread message

Arie

unread,
Nov 8, 2009, 2:12:24 PM11/8/09
to freemat
I need to implement inverse fft on Freemat (like ifft in matlab).
Anyone can help?

Garystar

unread,
Nov 18, 2009, 7:00:35 PM11/18/09
to freemat
While it is not documented, the ifft function is there. For example:

t=1:1024;
sample_rate=10e3;
fc=500;
x=sin(2*pi*t*fc/sample_rate);
xf=fft(x);
figure(1);
plot(abs(xf));
y=ifft(xf);
figure(2);
plot(real(y));
figure(3);
plot(x);

One thing to remember is that the output of the ifft function is a
complex vector. So, to plot it, you'll have to use the real function.

Please let me know if this works or if you have other problems.

Gary
Reply all
Reply to author
Forward
0 new messages