help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

why does invert fft not work?


From: John W. Eaton
Subject: why does invert fft not work?
Date: Wed, 24 Nov 2010 22:40:28 -0500

On 24-Nov-2010, address@hidden wrote:

| why doesn't the invert fft work?
| 
| for example:
| s=sqrt(2)*cos(2*pi()*[1:1000]/1000);
| sn=s+.001*sqrt(1000/2)*randn(1,1000);
| b=sqrt(2)*fft(sn)/1000;
| 
| invoking
| snew=ifft(b);
| 
| does NOT reproduce sn or s in any way shape or form!
| 
| What is going on?

Why should it produce sn or s?  Given your calculation for b above,
isn't ifft(b) the same as

  ifft(sqrt(2)*fft(sn)/1000)

or

  ifft(fft(sqrt(2)*sn/1000))

?  So if you want to compare to sn, I think you need to compare sn to
1000*snew/sqrt(2), or snew to sqrt(2)*sn/1000.

Here is what I see with Octave 3.2.4:

  octave:1> s=sqrt(2)*cos(2*pi()*[1:1000]/1000);
  octave:2> sn=s+.001*sqrt(1000/2)*randn(1,1000);
  octave:3> b=sqrt(2)*fft(sn)/1000;
  octave:4> snew=ifft(b);
  octave:5> max (abs (1000*snew/sqrt(2)-sn))
  ans =  1.5735e-15
  octave:6> max (abs (snew-sqrt(2)*sn/1000))
  ans =  2.1689e-18

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]