Board index » delphi » Seeking: 2d fft code

Seeking: 2d fft code

Hi,
  I would like to be able to 2D FFT on an image: i.e., on a PCX image of
a Duck.  (And, I would like to be able to invert back as well).

  Does anyone have code (can be slow), which would allow me to do this?
It doesn't have to read the PCX image (it would be better, actually if I
could implement this aspect of things).

  Thanks for reading.

- Jeff

 

Re:Seeking: 2d fft code


Jeff:

Quote
Jeff Hamm wrote in message <36A55888.4...@DelMe.psych.auckland.ac.nz>...
>  I would like to be able to 2D FFT on an image: i.e., on a PCX image of
>a Duck.  (And, I would like to be able to invert back as well).

There are several FFT links in Delphi/Pascal at
www.efg2.com/lab/library/Delphi/MathFunctions/Engineering.htm

Quote
>  Does anyone have code (can be slow), which would allow me to do this?
>It doesn't have to read the PCX image (it would be better, actually if I
>could implement this aspect of things).

There's Delphi code to read PCX files in Section A of
www.efg2.com/lab/library/delphi/graphics/FileFormatsAndConversion.htm

efg
_________________________________
efg's Computer Lab:       www.efg2.com/lab
Delphi Books:  www.efg2.com/lab/TechBooks/Delphi.htm

Earl F. Glynn     E-Mail:  EarlGl...@att.net
Overland Park, KS  USA

Re:Seeking: 2d fft code


Hi,

There is the book "Numerical recipes in Pascal" (Cambridge) it has a 2d FFT
algorithm. I can send you the source code, if the copyright allows it, I
must check that first.

Peter.

Quote
Jeff Hamm wrote:
> Hi,
>   I would like to be able to 2D FFT on an image: i.e., on a PCX image of
> a Duck.  (And, I would like to be able to invert back as well).

>   Does anyone have code (can be slow), which would allow me to do this?
> It doesn't have to read the PCX image (it would be better, actually if I
> could implement this aspect of things).

>   Thanks for reading.

> - Jeff

Re:Seeking: 2d fft code


Quote
Jeff Hamm <DelMe.JH...@DelMe.psych.auckland.ac.nz> wrote:
>Hi,
>  I would like to be able to 2D FFT on an image: i.e., on a PCX image of
>a Duck.  (And, I would like to be able to invert back as well).

[....]
If you have an 1D FFT for real data, do that:

 1) copy a  row of the 2D-Array to your FFT-Prog
 2) do the FFT. The result gives complex data, but
    with certain symmety, so you get the same amount
    of data.
 3) copy the transformed row back to the original place
     in the 2D array
 4) repeat (1..3) for all rows (the order is irrelevant)

5) do (1..4) with the columns instead of rows
Then you have in the 2D-array the 2D-FFT of the
original content.
If the 2D-dimension is not a power of 2,
you can fill the remaining FFT-array with zeroes or
the average of the original data.
Copying back the (zero-filled) FFTs is tricky: The FFTs
have different orders of storage in frequency domain.
W.Riedel

Re:Seeking: 2d fft code


Re:Seeking: 2d fft code


Hi,
  Thanks everyone.  I have 1-D FFT code, and 1-D IFFT, so I should be
able to do the 2-D with what I have.  

- Jeff

Other Threads