.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "FFTW 3pm" .TH FFTW 3pm "2012-05-30" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" PDL::FFTW \- PDL interface to the Fastest Fourier Transform in the West v2.x .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a means to interface \s-1PDL\s0 with the \s-1FFTW\s0 library. It's similar to the standard \s-1FFT\s0 routine but it's usually faster and has support for real transforms. It works well for the types of PDLs for which was the library was compiled (otherwise it must do conversions). .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use PDL::FFTW \& \& load_wisdom("file_name"); \& \& out_cplx_pdl = fftw(in_cplx_pdl); \& out_cplx_pdl = ifftw(in_cplx_pdl); \& \& out_cplx_pdl = rfftw(in_real_pdl); \& out_real_pdl = irfftw(in_cplx_pdl); \& \& cplx_pdl = nfftw(cplx_pdl); \& cplx_pdl = infftw(cplx_pdl); \& \& cplx_pdl = Cmul(a_cplx_pdl, b_cplx_pdl); \& cplx_pdl = Cconj(a_cplx_pdl); \& real_pdl = Cmod(a_cplx_pdl); \& real_pdl = Cmod2(a_cplx_pdl); .Ve .SH "FFTW documentation" .IX Header "FFTW documentation" Please refer to the \s-1FFTW\s0 documentation for a better understanding of these functions. .PP Note that complex numbers are represented as piddles with leading dimension size 2 (real/imaginary pairs). .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "load_wisdom" .IX Subsection "load_wisdom" Loads the wisdom from a file for better \s-1FFTW\s0 performance. .PP The wisdom is automatically saved when the program ends. It will be automagically called when the variable \f(CW$PDL::FFT::wisdom\fR is set to a file name. For example, the following is a useful idiom to have in your \fI.perldlrc\fR file: .PP .Vb 1 \& $PDL::FFT::wisdom = "$ENV{HOME}/.fftwisdom"; # save fftw wisdom in this file .Ve .PP Explicit usage: .PP .Vb 1 \& load_wisdom($fname); .Ve .SS "fftw" .IX Subsection "fftw" calculate the complex \s-1FFT\s0 of a real piddle (complex input, complex output) .PP .Vb 1 \& $pdl_cplx = fftw $pdl_cplx; .Ve .SS "ifftw" .IX Subsection "ifftw" Complex inverse \s-1FFT\s0 (complex input, complex output). .PP .Vb 1 \& $pdl_cplx = ifftw $pdl_cplx; .Ve .SS "nfftw" .IX Subsection "nfftw" Complex inplace \s-1FFT\s0 (complex input, complex output). .PP .Vb 1 \& $pdl_cplx = nfftw $pdl_cplx; .Ve .SS "infftw" .IX Subsection "infftw" Complex inplace inverse \s-1FFT\s0 (complex input, complex output). .PP .Vb 1 \& $pdl_cplx = infftw $pdl_cplx; .Ve .SS "rfftw" .IX Subsection "rfftw" Real \s-1FFT\s0. For an input piddle of dimensions [n1,n2,...] the output is [2,(n1/2)+1,n2,...] (real input, complex output). .PP .Vb 1 \& $pdl_cplx = fftw $pdl_real; .Ve .SS "irfftw" .IX Subsection "irfftw" Real inverse \s-1FFT\s0. Have a look at rfftw to understand the format. \s-1USE\s0 \&\s-1ONLY\s0 an even n1! (complex input, real output) .PP .Vb 1 \& $pdl_real = ifftw $pdl_cplx; .Ve .SS "nrfftw" .IX Subsection "nrfftw" Real inplace \s-1FFT\s0. If you want a transformation on a piddle with dimensions [n1,n2,....] you \s-1MUST\s0 pass in a piddle with dimensions [2*(n1/2+1),n2,...] (real input, complex output). .PP Use with care due to dimension restrictions mentioned below. For details check the html docs that come with the fftw library. .PP .Vb 1 \& $pdl_cplx = nrfftw $pdl_real; .Ve .SS "inrfftw" .IX Subsection "inrfftw" Real inplace inverse \s-1FFT\s0. Have a look at nrfftw to understand the format. \s-1USE\s0 \&\s-1ONLY\s0 an even first dimension size! (complex input, real output) .PP .Vb 1 \& $pdl_real = infftw $pdl_cplx; .Ve .SS "rfftwconv" .IX Subsection "rfftwconv" \&\s-1ND\s0 convolution using real ffts from the \s-1FFTW\s0 library .PP .Vb 1 \& $conv = rfftwconv $im, kernctr $im, $k; # kernctr is from PDL::FFT .Ve .SS "fftwconv" .IX Subsection "fftwconv" \&\s-1ND\s0 convolution using complex ffts from the \s-1FFTW\s0 library .PP Assumes real input! .PP .Vb 1 \& $conv = fftwconv $im, kernctr $im, $k; # kernctr is from PDL::FFT .Ve .SS "Cmul" .IX Subsection "Cmul" .Vb 1 \& Signature: (a(n); b(n); [o]c(n)) .Ve .SS "Cmul" .IX Subsection "Cmul" Complex multiplication .PP .Vb 1 \& $out_pdl_cplx = Cmul($a_pdl_cplx,$b_pdl_cplx); .Ve .PP Cmul does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cscale" .IX Subsection "Cscale" .Vb 1 \& Signature: (a(n); b(); [o]c(n)) .Ve .SS "Cscale" .IX Subsection "Cscale" Complex by real multiplation. .PP .Vb 1 \& $out_pdl_cplx = Cscale($a_pdl_cplx,$b_pdl_real); .Ve .PP Cscale does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cdiv" .IX Subsection "Cdiv" .Vb 1 \& Signature: (a(n); b(n); [o]c(n)) .Ve .SS "Cdiv" .IX Subsection "Cdiv" Complex division. .PP .Vb 1 \& $out_pdl_cplx = Cdiv($a_pdl_cplx,$b_pdl_cplx); .Ve .PP Cdiv does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cbmul" .IX Subsection "Cbmul" .Vb 1 \& Signature: (a(n); b(n)) .Ve .SS "Cbmul" .IX Subsection "Cbmul" Complex inplace multiplication. .PP .Vb 1 \& Cbmul($a_pdl_cplx,$b_pdl_cplx); .Ve .PP Cbmul does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cbscale" .IX Subsection "Cbscale" .Vb 1 \& Signature: (a(n); b()) .Ve .SS "Cbscale" .IX Subsection "Cbscale" Complex inplace multiplaction by real. .PP .Vb 1 \& Cbscale($a_pdl_cplx,$b_pdl_real); .Ve .PP Cbscale does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cconj" .IX Subsection "Cconj" .Vb 1 \& Signature: (a(n); [o]c(n)) .Ve .SS "Cconj" .IX Subsection "Cconj" Complex conjugate. .PP .Vb 1 \& $out_pdl_cplx = Cconj($a_pdl_cplx); .Ve .PP Cconj does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cbconj" .IX Subsection "Cbconj" .Vb 1 \& Signature: (a(n)) .Ve .SS "Cbconj" .IX Subsection "Cbconj" Complex inplace conjugate. .PP .Vb 1 \& Cbconj($a_pdl_cplx); .Ve .PP Cbconj does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cexp" .IX Subsection "Cexp" .Vb 1 \& Signature: (a(n); [o]c(n)) .Ve .SS "Cexp" .IX Subsection "Cexp" Complex exponentation. .PP .Vb 1 \& $out_pdl_cplx = Cexp($a_pdl_cplx); .Ve .PP Cexp does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cbexp" .IX Subsection "Cbexp" .Vb 1 \& Signature: (a(n)) .Ve .SS "Cbexp" .IX Subsection "Cbexp" Complex inplace exponentation. .PP .Vb 1 \& $out_pdl_cplx = Cbexp($a_pdl_cplx); .Ve .PP Cbexp does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cmod" .IX Subsection "Cmod" .Vb 1 \& Signature: (a(n); [o]c()) .Ve .SS "Cmod" .IX Subsection "Cmod" modulus of a complex piddle. .PP .Vb 1 \& $out_pdl_real = Cmod($a_pdl_cplx); .Ve .PP Cmod does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Carg" .IX Subsection "Carg" .Vb 1 \& Signature: (a(n); [o]c()) .Ve .SS "Carg" .IX Subsection "Carg" argument of a complex number. .PP .Vb 1 \& $out_pdl_real = Carg($a_pdl_cplx); .Ve .PP Carg does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SS "Cmod2" .IX Subsection "Cmod2" .Vb 1 \& Signature: (a(n); [o]c()) .Ve .SS "Cmod2" .IX Subsection "Cmod2" Returns squared modulus of a complex number. .PP .Vb 1 \& $out_pdl_real = Cmod2($a_pdl_cplx); .Ve .PP Cmod2 does not process bad values. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles. .SH "AUTHOR" .IX Header "AUTHOR" Copyright (C) 1999 Christian Pellegrin, 2000 Christian Soeller. All rights reserved. There is no warranty. You are allowed to redistribute this software / documentation under certain conditions. For details, see the file \s-1COPYING\s0 in the \s-1PDL\s0 distribution. If this file is separated from the \s-1PDL\s0 distribution, the copyright notice should be included in the file.