FFTSection: User Contributed Perl Documentation (3)Updated: 2004-06-15 |
FFTSection: User Contributed Perl Documentation (3)Updated: 2004-06-15 |
For historical reasons, these routines work in-place and do not recognize the in-place flag. That should be fixed.
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.
See also PDL::ImageND::convolveND, which performs speed-optimized convolution with a variety of boundary conditions.
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 (PDL::Image2D::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())
Signature: (ar(); ai(); br(); bi(); [o]cr(); [o]ci())