|Version 10 (modified by benl, 4 years ago)|
Applies a highpass filter to a BMP image, using a Fast Fourier Transform. The first argument is the lower cutoff frequency.
Each of the RGB channels is converted to the frequency domain, the lower frequencies are set to zero, then the channels are converted back to the image domain.
repa-fft2d-highpass 2 lena.bmp lena-high2.bmp
The main algorithm is at FFT.hs
The wrapper is at Main.hs
http://en.wikipedia.org/wiki/Lenna is a standard test image.
|full size||full size|
Head version. Compiled with GHC 6.13.20100309. 512x512 image.
Running on a Intel i7 iMac. 2.8Ghz, 4 cores x 2 threads/core. 256k L1, 8MB L2, 8GB main memory.
Times stated include IO.
|Using Jones's inplace C implementation||0.24||Jones.c|
|Using FFTW on Estimate mode||0.09||FFTW.c|
The vector version uses the same radix-2 decimation in time (DIT) algorithm as the Repa version, but is not rank generalised. It applies a recursive 1d FFT to each row and then transposes the matrix, twice each.
Jones's version also uses a 1d radix-2 DIT FFT kernel, but it first reorders the values then performs a in-place transform using three nested loops.
FFTW contains deep magic, and is comparable with vendor optimised versions.