SignalProcessing - Maple Programming Help

Online Help

All Products    Maple    MapleSim


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

SignalProcessing

  

DCT

  

compute forward discrete cosine transform

  

InverseDCT

  

compute inverse discrete cosine transform

 

Calling Sequence

Parameters

Options

Description

Thread Safety

Examples

Compatibility

Calling Sequence

DCT(A)

InverseDCT(A)

Parameters

A

-

Array of real numeric values; the signal

Options

• 

container : Array, predefined Array for holding results

• 

inplace   : truefalse, specifies that output should overwrite input

Description

• 

The DCT(A) command computes the discrete cosine transform (DCT) of the Array A and returns the result in an Array with datatype float[8].

• 

The InverseDCT(A) command computes the inverse discrete cosine transform of the Array A and returns the result in an Array with datatype float[8].

• 

Before the code performing the computation runs, A is converted to datatype float[8] if it does not have that datatype already. For this reason, it is most efficient if A has this datatype beforehand.

• 

The discrete cosine transform B of a sample of N elements is defined by the formula

Bk=Cki=0N1Aicos2i+1πk2N

  

where C is given by

Ck=1Nk=02N0<k

  

.

• 

Samples may be of arbitrary length, but when the length is a power of 2, a faster algorithm is used,

• 

If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array having datatype float[8] and size equal to those of A.

• 

If the inplace or inplace=true option is provided, then A is overwritten with the results. In this case, the container option is ignored. Furthermore, A must have datatype float[8].

Thread Safety

• 

The SignalProcessing[DCT] and SignalProcessing[InverseDCT] commands are thread-safe as of Maple 17.

• 

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

Examples

withSignalProcessing&colon;

withplots&colon;

N10&colon;

AGenerateToneN&comma;1&comma;0.1&comma;0&plus;GenerateToneN&comma;3&comma;0.4&comma;0.2&colon;

BDCTA

8.42600032458408210-161.84081507493746972.12662702088011.07340522632521057.94410929039127410-161.86744934354456831.78742459033803710-154.5320177608978273.29911475027503042.454780728041237

(1)

displaylistplotA&comma;&apos;title&apos;&equals;Signal&comma;listplotB&comma;&apos;title&apos;&equals;Cosine Transform

CInverseDCTB

3.9401997335237261.91997926507489371.78442596381239180.032717405218654072.83736383747988041.94019973352372623.53801325382478731.16639197506249340.6507513939685531.219329848729986

(2)

mapfnormal&comma;AC

0.0.0.0.0.0.0.0.0.0.

(3)

AGenerateJaehne10&comma;3

0.00.469303395120692631.76335575687741942.96306502178541331.76335575687741962.12132034355964241.763355756877422.9630650217854131.76335575687741830.46930339512069374

(4)

CArray1..10&comma;&apos;datatype&apos;&equals;&apos;float&apos;8&colon;

DCTA&comma;&apos;container&apos;&equals;C

1.50000000000000041.53435101970162520.303665947951025252.52783090094747332.06039897562768372.2480137296073381.27812042982671972.6781162095883122.16323992827128551.0329588850112361

(5)

C

1.50000000000000041.53435101970162520.303665947951025252.52783090094747332.06039897562768372.2480137296073381.27812042982671972.6781162095883122.16323992827128551.0329588850112361

(6)

InverseDCTC&comma;&apos;inplace&apos;

5.55111512312578310-170.469303395120692631.76335575687741962.96306502178541381.76335575687742032.12132034355964371.76335575687742032.96306502178541331.76335575687741920.4693033951206936

(7)

C

5.55111512312578310-170.469303395120692631.76335575687741962.96306502178541381.76335575687742032.12132034355964371.76335575687742032.96306502178541331.76335575687741920.4693033951206936

(8)

mapfnormal&comma;AC

0.0.0.0.0.0.0.0.0.0.

(9)

Compatibility

• 

The SignalProcessing[DCT] and SignalProcessing[InverseDCT] commands were introduced in Maple 17.

• 

For more information on Maple 17 changes, see Updates in Maple 17.

See Also

SignalProcessing[DFT]

SignalProcessing[DWT]

SignalProcessing[FFT]