FourierTransform - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Calculus : Transforms : FourierTransform

DiscreteTransforms

  

FourierTransform

  

compute the discrete Fourier transform

  

InverseFourierTransform

  

compute the discrete inverse Fourier transform

 

Calling Sequence

Parameters

Description

Options

Examples

References

Calling Sequence

FourierTransform(Z, [,options])

FourierTransform(Z1, nelem [,options])

FourierTransform(Zn, dim [,options])

FourierTransform(X, Y [,options])

FourierTransform(X1, Y1, nelem [,options])

FourierTransform(Xn, Yn, dim [,options])

InverseFourierTransform(Z, [,options])

InverseFourierTransform(Z1, nelem [,options])

InverseFourierTransform(Zn, dim [,options])

InverseFourierTransform(X, Y [,options])

InverseFourierTransform(X1, Y1, nelem [,options])

InverseFourierTransform(Xn, Yn, dim [,options])

Parameters

Z

-

complex data Array, 1-5 dimensional

Z1

-

complex data Array, 1 dimensional

Zn

-

complex data Array, 2-5 dimensional

X, Y

-

real data Arrays, 1-5 dimensional

X1, Y1

-

real data Arrays, 1 dimensional

Xn, Yn

-

real data Arrays, 2-5 dimensional

nelem

-

number of discrete data points to use in the transform

dim

-

Array dimension to be transformed

options

-

optional argument of the type option=value, where option is one of algorithm, padding, inplace, workingstorage, and normalization

Description

• 

The FourierTransform and InverseFourierTransform commands compute the forward and inverse Fourier transform of the numerical input data. For the single data Array form, the input data Z is interpreted as a complex Array. For the two data Array form, the inputs X,Y are interpreted as the real and imaginary parts of the data, respectively.

  

Note: The FourierTransform and InverseFourierTransform commands work strictly in hardware precision, so their accuracy is independent of the setting of Digits. Additionally, in all cases, the input data must either be floating-point numerical data, or must evaluate to floating-point numerical data. Symbolic entries are not allowed.

• 

The definition in use for a 1-D N-point forward transform of the data zj is given by

Zi=1Nj=1Nzjⅇ2Iπi1j1N,i=1..N

  

And the definition for the inverse transform by

zj=1Ni=1NZiⅇ2Iπi1j1N,j=1..N

  

where symmetric normalization by 1N is in use (this can be changed via the normalization option).

• 

If the input data is a one-dimensional Array, then the number of elements in the Array to be used for the transform can be specified as nelem. This allows re-use of the same storage for different sized transforms (and also inplace output with padding - see inplace and padding below).

• 

If the input data is an Array of dimension greater than 1, or a Matrix, then by default a transform is performed with respect to all dimensions of the input for all combinations of the indices. In this case, the data lengths cannot be specified.

  

For example, calling FourierTransform or InverseFourierTransform with a complex 20x30 Matrix performs a 20 data point transform for each of the 30 columns of the Matrix data, followed by a 30 data point transform for each of the 20 rows of the (already once transformed) Matrix data.

  

Specification of dim tells FourierTransform or InverseFourierTransform to perform a transform only along that Array dimension, or for the 20x30 Matrix example, specification of dim=1 transforms with respect to the Matrix rows, performing a 20 data point transform for each column of the Matrix, while specification of dim=2 transforms with respect to the Matrix columns, performing a 30 data point transform for each row of the Matrix.

• 

For more information on Fourier transforms in Maple, including a summarized comparison of DiscreteTransforms[FourierTransform], SignalProcessing[FFT], and SignalProcessing[DFT], see Fourier Transforms in Maple.

Options

  

Optional arguments control the way in which the Fourier or inverse Fourier transform is performed.

• 

algorithm=alg

  

Where alg can be set to mintime (default), minstorage, or DFT. The mintime algorithm is an efficient implementation of the twiddle factor FFT algorithm from Brigham.  The minstorage algorithm is a variant of the same algorithm that has been modified to use as little additional storage as possible. For more information, see FourierTransform/efficiency. The DFT algorithm is simply the ON2 discrete Fourier transform (very slow, and provided primarily for educational purposes).

• 

padding=num

  

Here num specifies the maximum amount of zero padding that can be used to more efficiently compute the Fourier transform. The mintime and minstorage algorithms are fast Fourier transform algorithms, and as such, are more efficient when the data length is a highly composite number (that is, has many small integer factors). By default, no zero padding is used, so for computations where the data length is actually a large prime, the mintime and minstorage algorithms are as inefficient as the DFT algorithm. It is generally advisable to collect the transform data with a highly composite number of data points, so no padding is needed, and the transform can be computed efficiently. For more information, see FourierTransform/efficiency.

• 

inplace=bool

  

Here bool can have the value true or false and specifies whether the output overwrites the input. By default this is false. Further, if a single input Array is used, with a float data type (that is, float, float8 or sfloat) then inplace output cannot be used, as the complex result cannot be stored in the input.

  

Note: It is not generally possible to use padding and inplace output, as the output data length can exceed the size of the input data, so there is insufficient space in the input to store the result. The only exception is when a 1-D transform is being performed, and the specified data length nelem plus the maximal padding will fit in the input Array. In this case the output can be provided inplace.

• 

workingstorage=data

  

Here data must be a complex valued rectangular Vector or Matrix with between m*n and 2*m*n entries (where m is the number of transforms being computed, and n is the data length of the transform). This storage is then used as working storage, preventing the algorithm from allocating any additional storage. Note that this is not required for the DFT algorithm. The quantity of additional storage required depends upon the data length. If the data length is prime, then the required storage is 2*m*n, but for all other cases, the required storage is m*n.

• 

normalization=symmetric (default), none or full

  

The process of performing a forward transform followed by an inverse transform, without normalization, introduces a factor of n to the data values. Three normalizations are in common use, including symmetric normalization (the default), where the data is multiplied by 1n in both transform directions. The other two cases correspond to performing no normalization on the forward transform, and 1n normalization on the inverse transform, and the reverse of this. Specification of normalization=none on a transform will prevent normalization, while specification of normalization=full will perform 1n normalization, so by consistent use of this this option between the forward and inverse transformations, one can obtain any of the three normalizations commonly used in practice.

• 

The output from FourierTransform and InverseFourierTransform is in two forms, which are different only if padding is in use or not.

  

Without padding, the output is simply the single Array (for the single complex input form) or a two element sequence containing the pair of Arrays (for the separated real/imaginary part form) that contain the computed transform of the input data. For inplace operation, these output Array(s) are the same as the input Array(s).

  

If padding is in use, a list representing the data lengths used for the transform is the first element of the output sequence, followed by the data (1 or 2 Arrays).

Efficiency

  

The most efficient transform can be obtained when the data length(s) are highly composite, the input data has datatype=complex8, and the computation is being performed inplace. Input data with any other datatype is copied to a complex8 data Array for the computation, then transformed back to the input datatype on output. For more information, see FourierTransform/efficiency.

Examples

withDiscreteTransforms:

Digits15:

Transform of 1-D complex Vector.

ZVector5,ievalfexpI3i,datatype=complex8

Z0.944956946314738+0.327194696796152I0.785887260776948+0.618369803069737I0.540302305868140+0.841470984807897I0.235237573302993+0.971937901363312I−0.0957235480143790+0.995407957751765I

(1)

Z2FourierTransformZ

Z21.07808016683995+1.67901037963378I0.04272374453283460.741915464402484I0.2364515416641140.288930752395548I0.3236904420053800.0849440827896753I0.432042072728096+0.168409503867555I

(2)

InverseFourierTransformZ2,inplace=true:

ZZ2

0.1.66533453693773×10−16I1.11022302462516×10−16+1.11022302462516×10−16I0.1.11022302462516×10−16I2.77555756156289×10−17+0.I8.32667268468867×10−17+1.11022302462516×10−16I

(3)

Transform of 2 1-D real Vectors (real and imaginary parts).

X,YVector5,ievalfcosi3,datatype=float8,Vector5,ievalfsini3,datatype=float8

X,Y0.9449569463147380.7858872607769480.5403023058681400.235237573302993−0.0957235480143790,0.3271946967961520.6183698030697370.8414709848078970.9719379013633120.995407957751765

(4)

X2,Y2FourierTransformX,Y

X2,Y21.078080166839950.04272374453283460.2364515416641140.3236904420053800.432042072728096,1.67901037963378−0.741915464402484−0.288930752395548−0.08494408278967530.168409503867555

(5)

InverseFourierTransformX2,Y2,inplace=true

0.9449569463147380.7858872607769480.5403023058681400.235237573302993−0.0957235480143791,0.3271946967961520.6183698030697370.8414709848078970.9719379013633120.995407957751765

(6)

XX2,YY2

0.1.11022302462516×10−160.2.77555756156289×10−178.32667268468867×10−17,−1.66533453693773×10−161.11022302462516×10−16−1.11022302462516×10−160.1.11022302462516×10−16

(7)

1-D transform with padding.

ZVector60,ievalfexpI30i

Z2FourierTransformZ,padding=10

A data length of 64, which has 2 as the largest prime factor, was used.

If the input Array is made larger, but the data length is still specified as 60, then in-place output is also possible:

ZVector70&comma;i`if`60<i&comma;0&comma;evalfexpI30i

Z2FourierTransformZ&comma;60&comma;padding=10&comma;inplace=true

Two-dimensional transform, one dimension at a time, and both at once:

ZMatrix3&comma;4&comma;i&comma;ji+j2Ii&comma;datatype=complex8

Z4.I9.I16.I25.I9.2.I16.2.I25.2.I36.2.I16.3.I25.3.I36.3.I49.3.I

(8)

Transform with respect to rows then columns.

Z2FourierTransformZ&comma;1

Z216.74315780649913.46410161513775I28.86751345948133.46410161513775I44.45597072760123.46410161513775I63.50852961085883.46410161513775I−4.40747728811182+4.36602540378444I−6.13952809568070+5.36602540378444I−7.87157890324957+6.36602540378444I−9.60362971081845+7.36602540378444I−5.407477288111822.63397459621556I−7.139528095680703.63397459621556I−8.871578903249574.63397459621556I−10.60362971081845.63397459621556I

(9)

FourierTransformZ2&comma;2&comma;inplace=true

76.78758580222026.92820323027551I−13.8564064605510+17.3205080756888I−15.5884572681199+0.I−13.856406460551017.3205080756888I−14.0111069989303+11.7320508075689I0.7320508075688772.73205080756888I1.732050807568880.999999999999999I2.73205080756888+0.732050807568878I−16.01110699893038.26794919243112I2.732050807568880.732050807568877I1.73205080756888+I0.732050807568878+2.73205080756888I

(10)

Transform both at once (inplace):

FourierTransformZ&comma;inplace=true

76.78758580222026.92820323027551I−13.8564064605510+17.3205080756888I−15.5884572681199+0.I−13.856406460551017.3205080756888I−14.0111069989303+11.7320508075689I0.7320508075688772.73205080756888I1.73205080756888I2.73205080756888+0.732050807568877I−16.01110699893038.26794919243112I2.732050807568880.732050807568877I1.73205080756888+I0.732050807568877+2.73205080756888I

(11)

ZZ2

0.+0.I1.77635683940025×10−15+0.I1.77635683940025×10−15+0.I1.77635683940025×10−15+0.I1.77635683940025×10−15+0.I1.11022302462516×10−16+8.88178419700125×10−16I−4.44089209850063×10−167.77156117237610×10−16I4.44089209850063×10−163.33066907387547×10−16I0.+0.I−8.88178419700125×10−167.77156117237610×10−16I1.33226762955019×10−151.11022302462516×10−16I−3.33066907387547×10−16+8.88178419700125×10−16I

(12)

References

  

Brigham, E.O. The Fast Fourier Transform. New Jersey: Prentice-Hall Inc., 1974.

See Also

DiscreteTransforms

fourier_in_maple

FourierTransform/efficiency

SignalProcessing[FFT]