compute the discrete wavelet transform of data
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)
Vector, Matrix, or Array of datatype=float; the data to be transformed
Vectors of datatype=float of the same length; the high and low pass filters
string or name; the name of a supported wavelet family
positive integer or list of two positive integers; the parameters to the family Wavelet
(optional) positive integer; the number of data points to be transformed
(optional) integer; the dimension to be transformed in A, if A has more than one dimension
(optional) Vector, Matrix, or Array of datatype=float; outputs in which to store the transformed data
(optional) positive integer; the number of transforms to be done
(optional) equation(s) of the form keyword = value, where keyword is endconditions or storagetype
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.
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
If Wavelet is a biorthogonal family, then
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.
Here are some small transforms using an artificial filter, to make clear the different options.
w1 ≔ Vector⁡1,0,0,datatype=float8
w2 ≔ Vector⁡0,0,1,datatype=float8
A ≔ Vector⁡6,i→i,datatype=float8
Inversion is not always possible with orthogonal or biorthogonal data. This is illustrated below.
Digits ≔ 20:
w1,w2 ≔ WaveletCoefficients⁡Daubechies,4:
Aprime ≔ Vector⁡A:
Aprime1 ≔ A1−1
Aprime2 ≔ A2+1⁢w11w12:
A1 ≔ Vector⁡3,datatype=float8:
A2 ≔ Vector⁡3,datatype=float8:
A1prime ≔ Vector⁡3,datatype=float8:
A2prime ≔ Vector⁡3,datatype=float8:
See InverseDiscreteWaveletTransform for an example using n and m.
Wavelet Examples and Applications
Download Help Document
What kind of issue would you like to report? (Optional)