Each routine works `inplace'.
use PDL::FFT qw/:Func/;
fft($real,$imag); ifft($real,$imag); realfft($real); realifft($real);
fftnd($real,$imag); ifftnd($real,$imag);
$kernel = kernctr($image,$smallk); fftconvolve($image,$kernel);
Signature: ([o,nc]real(n); [o,nc]imag(n))
Complex FFT of the ``real'' and ``imag'' arrays [inplace]
Signature: ([o,nc]real(n); [o,nc]imag(n))
Complex Inverse FFT of the ``real'' and ``imag'' arrays [inplace]
The real part of the transform ends up in the first half of the array and the imaginary part of the transform ends up in the second half of the array.
realfft($real);
realifft($real);
fftnd($real,$imag);
ifftnd($real,$imag);
$kernel = kernctr($image,$smallk); fftconvolve($image,$kernel);
fftconvolve works inplace, and returns an error array in kernel as an accuracy check -- all the values in it should be negligible.
The sizes of the image and the kernel must be the same. kernctr centres a small kernel to emulate the behaviour of the direct convolution routines.
The speed cross-over between using straight convolution (conv2d) and these fft routines is for kernel sizes roughly 7x7.
Signature: ([o,nc]a(m); [o,nc]b(m))
Internal routine doing maths for convolution
Signature: (ar(); ai(); br(); bi(); [o]cr(); [o]ci())
Complex multiplication
Signature: (ar(); ai(); br(); bi(); [o]cr(); [o]ci())
Complex division