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

Online Help

All Products    Maple    MapleSim


DiscreteTransforms

  

DiscreteWaveletTransform

  

compute the discrete wavelet transform of data

 

Calling Sequence

Parameters

Options

Description

Examples

Calling Sequence

DiscreteWaveletTransform(A, w1, w2)

DiscreteWaveletTransform(A, w1, w2, options)

DiscreteWaveletTransform(A, Wavelet, WaveletParams, options)

DiscreteWaveletTransform(n, A, dim, w1, A1, A2, options)

DiscreteWaveletTransform(n, m, A, dim, w1, A1, A2, options)

DiscreteWaveletTransform(n, A, dim, Wavelet, WaveletParams, A1, A2, options)

DiscreteWaveletTransform(n, m, A, dim, Wavelet, WaveletParams, A1, A2, options)

Parameters

A

-

Vector, Matrix, or Array of datatype=float[8]; the data to be transformed

w1, w2

-

Vectors of datatype=float[8] of the same length; the high and low pass filters

Wavelet

-

string or name; the name of a supported wavelet family

WaveletParams

-

positive integer or list of two positive integers; the parameters to the family Wavelet

n

-

(optional) positive integer; the number of data points to be transformed

dim

-

(optional) integer; the dimension to be transformed in A, if A has more than one dimension

A1, A2

-

(optional) Vector, Matrix, or Array of datatype=float[8]; outputs in which to store the transformed data

m

-

(optional) positive integer; the number of transforms to be done

options

-

(optional) equation(s) of the form keyword = value, where keyword is endconditions or storagetype

Options

• 

endconditions can be periodic, zeros, or reflection.

– 

endconditions determines how data will be generated to deal with convolutions near the end of the signal. If endconditions=zeros, the signal will be padded with zeros. If endconditions=reflection, the data will be reflected about the final term to generate new data. If endconditions=periodic, then it will be assumed that the data is periodic.

– 

Warning: With almost all orthogonal and biorthogonal wavelets, DiscreteWaveletTransform can only be inverted with endconditions=periodic.

– 

The default value of this option is endconditions=periodic.

• 

storagetype can be standard, singlearray, or nodownsample.

– 

If storagetype=standard, the standard discrete wavelet transform is performed on A. The result is stored in A1 and A2 (A1 and A2 are created if they are not provided), and then A1 and A2 are returned. A1 and A2 store the high and low pass coefficients, respectively.

– 

If storagetype=singlearray, the discrete wavelet transform is performed on A and the results are stored side by side in A1 (A1 is created if it has not been provided), and then A1 is returned.

– 

If storagetype=nodownsample, then a modified version of the discrete wavelet transform, with no down sampling, is performed on A. The result is stored in A1 and A2 (A1 and A2 are created if they have not been provided), and then A1 and A2 are returned.

– 

Note that in the case of storagetype=standard, if A1 and A2 are provided, they must be at least as big as A in all dimensions except for dim, and must be at least half the size of A in dimension dim. In the case of storagetype=singlearray , if A1 is provided it must be at least as big as A in all dimensions. And in the case of storagetype=nodownsample, A1 and A2 must each be at least as big as A in all dimensions, if they are provided.

– 

If storagetype is standard or nodownsample, then both A1 and A2 must be provided, or neither; it is not possible to provide only one.

– 

The default value for this option is storagetype=standard.

Description

• 

The DiscreteWaveletTransform command performs the discrete wavelet transform on the signal A. If A1 and A2 (or just A1 when storagetype=singlearray) are provided, the transformed data is stored in them and they are returned. Otherwise, A1 and A2 are created before they are returned.

• 

If A1 and A2 are not provided, they are created to be of the same type, and have the same options, as A.  

• 

If provided, Wavelet and WaveletParams must be supported by WaveletCoefficients.

• 

If Wavelet is an orthogonal family, then

  

DiscreteWaveletTransform(A, Wavelet, WaveletParams)

  

is equivalent to

  

DiscreteWaveletTransform(A, WaveletCoefficients(Wavelet,WaveletParams))

• 

If Wavelet is a biorthogonal family, then

  

DiscreteWaveletTransform(A, Wavelet, WaveletParams)

  

is equivalent to

  

DiscreteWaveletTransform(A, op(1..2,[WaveletCoefficients(Wavelet,op(WaveletParams))]))

• 

DiscreteWaveletTransform will only transform data of even length, so if n is provided, it must be even; if n is not provided, then A must have an even size in dimension dim.

• 

m can only be specified if n is also provided and A has dimension 2. In this case, only m rows or columns (depending on which dimension is being transformed) are transformed, instead of all of them.

• 

If A has more than one dimension, dim must be provided.

• 

Note: Currently, only Arrays of 1 or 2 dimensions can be transformed.  

Examples

withDiscreteTransforms

DiscreteWaveletTransform,FourierTransform,InverseDiscreteWaveletTransform,InverseFourierTransform,WaveletCoefficients,WaveletPlot

(1)

Here are some small transforms using an artificial filter, to make clear the different options.

w1Vector1,0,0,datatype=float8

w11.0.0.

(2)

w2Vector0,0,1,datatype=float8

w20.0.1.

(3)

AVector6,ii,datatype=float8

A1.2.3.4.5.6.

(4)

DiscreteWaveletTransformA,w1,w2

1.3.5.,3.5.1.

(5)

DiscreteWaveletTransformA,w1,w2,endconditions=zeros

1.3.5.,3.5.0.

(6)

DiscreteWaveletTransformA,w1,w2,endconditions=reflection

1.3.5.,3.5.5.

(7)

DiscreteWaveletTransformA,w1,w2,storagetype=nodownsample

1.2.3.4.5.6.,3.4.5.6.1.2.

(8)

DiscreteWaveletTransformA,w1,w2,storagetype=singlearray

1.3.5.3.5.1.

(9)

Inversion is not always possible with orthogonal or biorthogonal data. This is illustrated below.

Digits20:

w1,w2WaveletCoefficientsDaubechies,4:

AprimeVectorA:

Aprime1A11

Aprime10.

(10)

Aprime2A2+1w11w12:

Aprime

0.2.577350269189625733.4.5.6.

(11)

A1Vector3,datatype=float8:

A2Vector3,datatype=float8:

A1primeVector3,datatype=float8:

A2primeVector3,datatype=float8:

DiscreteWaveletTransformA,Daubechies,4,A1,A2,endconditions=zeros:

DiscreteWaveletTransformAprime,Daubechies,4,A1prime,A2prime,endconditions=zeros:

A1A1prime

0.0.0.

(12)

A2A2prime

0.0.0.

(13)

DiscreteWaveletTransformA,Daubechies,4,A1,A2,endconditions=reflection:

DiscreteWaveletTransformAprime,Daubechies,4,A1prime,A2prime,endconditions=reflection:

A1A1prime

0.0.0.

(14)

A2A2prime

0.0.0.

(15)

See InverseDiscreteWaveletTransform for an example using n and m.

See Also

InverseDiscreteWaveletTransform

SignalProcessing[DWT]

Wavelet Examples and Applications

WaveletCoefficients

WaveletPlot

Wavelets