I Love Delphi  Delphi:  The Fast Fourier Transform (FFT)    GNU GPL
FFT and Delphi online

More or less exhaustive information on the Fast Fourier Transform (FFT) can be found in Wikipedia, at Paul Bourke's page (Univ. of Western Australia), at Bob Fisher's page (Univ. of Edinburgh), the C library page named FFTW as well as in an endless number of publications selected by Google or by Hakia.

A large number of free FFT code written in C/C++ is also readily available, due to the fact that academic community is traditionally using this language, being duly irradiated starting from early years at college. This code usually includes rich and ready-to-use libraries or classes, solving all kinds of problems that life may bring up. Good examples can be found at the Surrey site. Regrettably, using them without profound prior examination and testing always ends up with erroneous and confusing results.

Free Delphi implementations of FFT are scarcely found because Delphi is less popular with students and university staff. Despite its elegance and clarity (maybe surpassed only by Java), Delphi is believed to have limited potentials or, at least, to be somewhat clumsy. The fact is, that any piece of code written in C/C++ can be written also in Delphi, but in Delphi one is always sure what one is doing. However, a drawback of Delphi is its old-fashioned Pascal syntax: the boring begin-end block structure.

It is pointless to argue about the subject, as one never believes in blue elephants before one gets to know them.

A good free Delphi FFT component is the DSXFastFourier written by Gunnar Bolle. As Don Cross's website is not currently operational, it can be found at the "exotic" website CSDN.NET (learning Chinese is becoming a must nowadays!).

The same code is available also at webppls.com (select English language).

Some free Delphi code for 2D FFT can be found at the Univ. of Science and Technology of China (USTC) website.

Quite a big number of various helpful routines, including FFT, is found at the 3d2f.com website (shareware with 90 days trial period). Another helpful shareware library, including FFT, is the DSPLab for Delphi.

Nice Delphi code for real and complex FFT is available at the "ugly" page of Laurent de Soras (a copy available for download here).

A consize FFT site is the SimDesign (a copy available for download here).

One may also visit the post by Subash in the good-looking blogspot.com which contains a tutorial and a code sections.

Back to Home page
1D & 2D FFT Demos for free download

fftDemo Demo 1. This "slow" but simple One- and Two-dimensional FFT Demo can be downloaded from here (source included).

The Demo generates a 1D or 2D input signal (with size 256 or 256x256) which is displayed in the left bitmap (8 bit gray palette).

The signal contains a centered rectangular pulse (pulse size from 2 to 256). Since the input is real, the FFT routine ftu() produces biased spectrum. If "Reorder" is checked, the zero frequency is shifted to the center of the spectrum by swapping data from the respective quadrants. The complex result is displayed in the right bitmap in one of four possible modes: Module, Phase, Real part or Imaginary part. If "InvFFT" is checked, an inverse FFT is applied on the spectrum, the result being the recovered input signal. However, to recover the input signal correctly "Reorder" has to be unchecked. In order to keep up with tradition, the 2D signal may be fed from Lenna.bmp file which comes with the Demo. (See about Lenna below).

Demo 2. A similar Demo in which the Fourier transformation is performed by the "quick" component DSXFastFourier rather than by the ftu() routine can be downloaded from here (source included).

Demo 3. Another Demo which is using a modified version of the DSXFastFourier component - the vFFT component can be downloaded from here (source included).

The second and the third Demos explain how to make use of the respective components - DSXFastFourier and vFFT to calculate 1D and 2D Fourier transforms. Except for the components, their code is similar to the code of the first "slow" Demo.

Demo 4. Finally, a Demo using the nice code written by Nils Haeck can be downloaded from here (source included). While the FFT routines in Demos 1-3 require input series with length equal to an exact power of 2, this one behaves like FFT for any series the length of which can be factorized into a product of factors 2, 3, 4, 5, 8, 10. When there are other prime factors in the series, it will calculate the subseries with DFT.

The above code is developed with Delphi 7 and is published under the GNU GPL except if otherwise stated.

Test your skills with Lenna

Lenna
Lenna Lenna Lenna


Find out in Wikipedia all about the Swedish model Lenna, about Digital Image Processing in the far 1973 and how important it is to always keep at hand a copy of Playboy magazine...

It is claimed that the Californian scholars have torn the top 1/3 of the original photo to digitize Lenna's image.

 

However, recent investigations show that the torn part has been much smaller - between 1/4 and 1/5, thus leading to loss of relevant information contained in the object. Today there is no problem in digitizing images without tearing essential parts of them, as it is clearly seen from the left photo. Even more details are shown in the original full-size photo (middle). At the right is a rarely found picture of Lenna that was probably taken during the same session.
(© Playboy 1972)

 
 © VSSoft 2009-2010   Last updated 17 May 2010