compute forward discrete Fourier transform - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Science and Engineering : Signal Processing : Transforms : SignalProcessing/DFT

SignalProcessing[DFT] - compute forward discrete Fourier transform

SignalProcessing[InverseDFT] - compute inverse discrete Fourier transform

Calling Sequence

DFT(A)

DFT(A1, A2)

InverseDFT(A)

InverseDFT(A1, A2)

Parameters

A

-

Array of complex numeric values; the signal

A1, A2

-

Arrays of real numeric values corresponding to the real and imaginary parts of the signal

Description

• 

The DFT(A) command computes the discrete Fourier transform (DFT) of the Array A and returns the result in an Array with datatype complex[8]. With two Array arguments, invoked as DFT(A1, A2), the command interprets A1 and A2 as giving the real and imaginary parts of the input signal, respectively, and returns the result as a sequence of two Arrays with datatype float[8]. These Arrays are the real and imaginary parts of the output signal. For this calling sequence, A1 and A2 must have the same number of elements.

• 

The InverseDFT(A) command computes the inverse discrete Fourier transform of the Array A and returns the result in an Array with datatype complex[8].  With two Array arguments, invoked as InverseFFT(A1, A2), the command interprets A1 and A2 as giving the real and imaginary parts of the input signal, respectively, and returns the result as a sequence of two Arrays with datatype float[8]. These Arrays are the real and imaginary parts of the output signal. For this calling sequence, A1 and A2 must have the same number of elements.

• 

Before the code performing the computation runs, the input Array(s) are converted to datatype complex[8] (for the calling sequences with A) or float[8] (for the calling sequences with A1 and A2) if they do not have that datatype already. For this reason, it is most efficient if the input Array(s) have this datatype beforehand.

• 

Unlike the SignalProcessing:-FFT and SignalProcessing:-InverseFFT commands, the length of A is not restricted to be powers of 2.  However, the FFT commands are faster for Array with lengths equal to a power of 2.

• 

The code underlying these commands (in the Intel Integrated Performance Primitives (IPP) library, see software.intel.com/en-us/intel-ipp) does not support Arrays of dimension two or higher directly. However, when called with such an Array, these commands call the FourierTransform or InverseFourierTransform commands in the DiscreteTransforms package instead, which supports Arrays with dimension at most 5. In this case, the container option cannot be used.

• 

The option normalization must be one of the following: none, symmetric or full. If normalization is none, then the FFT is computed without any normalization. If it is symmetric, then the transforms are computed using 1N as the multiplier for both the forward and inverse transforms. If it is full, then 1N is used as the multiplier, where N is the length of A.

• 

If the container=C option is provided, and there is a single rtable argument A, then the results are put into C and C is returned.  In this case, the container C must be an Array having datatype complex[8] and size equal to that of A.

If the container = [C1, C2] option is provided, and there are two rtable arguments A1 and A2, then the results are put into C1 and C2 and they are returned. In this case, C1 and C2 must be Arrays having datatype float[8] and size equal to that of A1.

With this option, no additional memory is allocated to store the result.

• 

If the inplace or inplace=true option is provided, then A or A1 and A2 are overwritten with the results. In this case, the container option is ignored. Furthermore, if A is specified, it must have datatype complex[8], and if A1 and A2 are specified, they must have datatype float[8].

Thread Safety

• 

The SignalProcessing[DFT] and SignalProcessing[InverseDFT] commands are thread-safe as of Maple 17.

• 

For more information on thread safety, see index/threadsafe.

Examples

withSignalProcessing:

withplots:

N:=100:

A:=GenerateToneN,1,0.1,0+GenerateToneN,3,0.4,0.2:

B:=DFTA

B:= 1 .. 100 ArrayData Type: complex8Storage: rectangularOrder: Fortran_order

(1)

displaylistplotA,'title'=Signal,listplotmapℜ,B1..N2,'title'=Frequency,listplotmapℑ,B1..N2,'title'=Phase Shift

C:=InverseDFTB

C:= 1 .. 100 ArrayData Type: complex8Storage: rectangularOrder: Fortran_order

(2)

Normmapfnormal,AC

0.

(3)

B:=DFTA,'normalization'='full'

B:= 1 .. 100 ArrayData Type: complex8Storage: rectangularOrder: Fortran_order

(4)

C:=InverseDFTB,'normalization'='full'

C:= 1 .. 100 ArrayData Type: complex8Storage: rectangularOrder: Fortran_order

(5)

Normmapfnormal,AC

3.90079773599999990

(6)

For the next example, we use the calling sequence where the input and output are split into real and imaginary part. The input is purely real, so we need to specify an Array of zeroes as the imaginary part.

A1:=GenerateJaehne10,3

A1:=0.0.4693033951206931.763355756877422.963065021785411.763355756877422.121320343559641.763355756877422.963065021785411.763355756877420.469303395120694

(7)

A2:=Array1..10,'datatype'='float'8:

C1:=Array1..10,'datatype'='float'8:

C2:=Array1..10,'datatype'='float'8:

DFTA1,A2,'container'=C1,C2

1.500000000000000.3318476131237122.095203370001132.095203370001130.3318476131237111.500000000000000.3318476131237112.095203370001132.095203370001130.331847613123712,0.1.716184208453050.4051361351065910.4051361351065901.716184208453050.1.716184208453050.4051361351065900.4051361351065911.71618420845305

(8)

C1

1.500000000000000.3318476131237122.095203370001132.095203370001130.3318476131237111.500000000000000.3318476131237112.095203370001132.095203370001130.331847613123712

(9)

C2

0.1.716184208453050.4051361351065910.4051361351065901.716184208453050.1.716184208453050.4051361351065900.4051361351065911.71618420845305

(10)

InverseDFTC1,C2,'inplace'

2.2204460492503110-160.4693033951206921.763355756877422.963065021785411.763355756877422.121320343559641.763355756877422.963065021785411.763355756877420.469303395120693,0.0.0.0.0.0.0.0.0.0.

(11)

C1

2.2204460492503110-160.4693033951206921.763355756877422.963065021785411.763355756877422.121320343559641.763355756877422.963065021785411.763355756877420.469303395120693

(12)

C2

0.0.0.0.0.0.0.0.0.0.

(13)

Normmapfnormal,A1C1

0.

(14)

Normmapfnormal,A2C2

0.

(15)

N:=1001:

P:=seqithprimei,i=1..N:

S:=ArrayseqPi+1Pi,i=1..N1,'datatype'='float'8:

T:=DFTS:

displaylistplotS,'title'=Prime Differences,listplotmapℜ,T1..floorN2,'title'=Frequency Space,listplotmapℑ,T1..floorN2,'title'=Phase Shift

See Also

SignalProcessing[DCT], SignalProcessing[DWT], SignalProcessing[FFT]


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam