NAME

PDL::FFT - FFTs for PDL


DESCRIPTION

FFTs for PDL, using routines off the net. These work for arrays of any dimension, although ones with small prime factors are likely to be the quickest.

Each routine works inplace, as this is what the original routines do. fftnd and ifftnd FFT each dimension [fftn and ifftn use the facility in the C code to do nD, which seems slower than the pdl threaded approach used in (i)fftnd].


SYNOPSIS

        use PDL::FFT qw/:Func/;

        fft($real,$imag);
        ifft($real,$imag);
        realfft($real);
        realifft($real);

        fftnd($real,$imag);
        ifftnd($real,$imag);
        fftn($real,$imag);
        ifftn($real,$imag);

        $kernel = kernctr($image,$smallk);
        fftconvolve($image,$kernel);


FUNCTIONS


FUNCTIONS


fft

  Signature: ([o,nc]real(n); [o,nc]imag(n))

Complex FFT of the ``real'' and ``imag'' arrays [inplace]


ifft

  Signature: ([o,nc]real(n); [o,nc]imag(n))

Complex Inverse FFT of the ``real'' and ``imag'' arrays [inplace]


realfft()

FFT of real function [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()

Inverse of realfft routine [inplace].

        realifft($real);


fftnd()

N-dimensional FFT (inplace)

        fftnd($real,$imag);


ifftnd()

N-dimensional inverse FFT

        ifftnd($real,$imag);


fftn

  Signature: (int dims(n); [o,nc]real(m); [o,nc]imag(m))

N-dimensional FFT [inplace].


ifftn

  Signature: (int dims(n); [o,nc]real(m); [o,nc]imag(m))

N-dimensional inverse FFT [inplace].


fftconvolve(), kernctr()

N-dimensional convolution, auxiliary routine to generate `centred' kernel

        $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.


convmath

  Signature: ([o,nc]a(m); [o,nc]b(m))

Internal routine doing maths for convolution


AUTHOR This file copyright (C) R.J.R. Williams 1997 (rjrw@ast.leeds.ac.uk), Karl Glazebrook (kgb@aaoepp.aao.gov.au), Tuomas J. Lukka, (lukka@husc.harvard.edu). All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file COPYING in the PDL distribution. If this file is separated from the PDL distribution, the copyright notice should be included in the file.