Re: fft / ifft question



dan.starr@xxxxxxxxx wrote:
I'm trying to figure out what a chunk of image processing matlab code
is supposed to accomplish, and I'm stumped:

In the following, x is an 84x89 double (complex) matrix of values.

What would be the purpose of this line:

x = ifft(fft(x),[],2);

It's first taking the FFT along each column of x, and then taking the
inverse fft of the result along the 2nd dimension. What purpose would
this have in the field of image processing?


Thanks.


Hi Dan,

There isn't much difference between an fft and an ifft: the ifft is equivalent to the complex conjugate of the fft of the reversed signal (i.e. first sample becomes last signal). The main difference (at least in the Matlab implementation) is that ifft applies a scaling factor that compensates the scaling that occurs during fft. My best guess is that this scaling was the motivation for this line of code.

So, aside from a possible vertical mirror effect and opposite phase, ifft(fft(x),[],2) will probably compute the 2D fft of the image x and scale it in the dynamic range of the original image.
.




Relevant Pages

  • Re: Scaling factor in inverse fourier transform
    ... I tried to calculate the autocorrelation from FFT using C. ... I wonder if I made mistake with the scaling factor or something else. ... between your FFT and IFFT you have a total factor of 1/N, ...
    (comp.dsp)
  • Re: Windowed FFT power and amplitude spectrum
    ... PS: You can find a nice explenation about coherent power gain on this page: ... > Here is another fascinating question on FFT spectrum!! ... > windowing is applied to the time series before FFT is applied. ... > multiplied by a scaling factor but I am not sure how this scaling factor ...
    (comp.dsp)
  • Scaling the fft
    ... I am trying to perform an fft on some data but have been ... having trouble with the scaling of the frequency axis. ... resulting gaussian on transform is expected to have width ...
    (comp.soft-sys.matlab)
  • Re: determing the scaling factor
    ... format I used is Q15 fixed point format. ... signal within the Q15 range between -1~0.9999, I need to choose a proper ... scaling factor for the original data sequence. ... FFT output, which may easily goes beyond [-1,1) range. ...
    (comp.dsp)
  • Re: numerical fourier transform of an error function
    ... decreases quickly from two to zero around +16. ... you can take a numeric fft and see what ... % Plot single-sided amplitude spectrum. ... I'll leave it to you to figure the scaling to ...
    (comp.soft-sys.matlab)