SignalProcessing - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

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

SignalProcessing

 DWT
 compute forward discrete wavelet transform
 InverseDWT
 compute inverse discrete wavelet transform

 Calling Sequence DWT(A) InverseDWT(A1, A2)

Parameters

 A - Array of real numeric values; the signal A1, A2 - Arrays of real numeric values corresponding to the low and high frequency components of the signal

Options

 • container : Array or [Array, Array], predefined Array(s) for holding results

Description

 • The DWT(A) command computes the Haar discrete wavelet transform (DWT) of the Array A and returns a sequence of two Arrays with datatype float[8] and containing the low-frequency and high-frequency components respectively. The number of elements in A must be even, and each of the result Arrays will have half as many elements.
 • The InverseDWT(A1, A2) command computes the inverse Haar discrete wavelet transform from the Arrays A1 and A2 containing low and high frequency components.  It returns the results in an Array with datatype float[8]. The length of A1 and A2 must be the same, and the size of the result Array will be twice this length.
 • Before the code performing the computation runs, the input Array(s) are converted to datatype float[8] if they do not have that datatype already. For this reason, it is most efficient if the input Array(s) have this datatype beforehand.
 • 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. With the forward transform, the container must be a list of two Arrays with datatype float[8] and size equal to half that of A. With the inverse transform, the container must be a single Array with datatype float[8] and size equal to twice that of the input Arrays.

Thread Safety

 • The SignalProcessing[DWT] and SignalProcessing[InverseDWT] commands are thread-safe as of Maple 17.
 • For more information on thread safety, see index/threadsafe.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $\mathrm{with}\left(\mathrm{plots}\right):$
 > $N≔10:$
 > $A≔\mathrm{GenerateTone}\left(N,1,0.1,0\right)+\mathrm{GenerateTone}\left(N,3,0.4,0.2\right):$
 > $\mathrm{B1}≔\mathrm{Array}\left(1..\frac{N}{2},'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right):$
 > $\mathrm{B2}≔\mathrm{Array}\left(1..\frac{N}{2},'\mathrm{datatype}'='\mathrm{float}'\left[8\right]\right):$
 > $\mathrm{DWT}\left(A,'\mathrm{container}'=\left[\mathrm{B1},\mathrm{B2}\right]\right)$
 $\left[\begin{array}{ccccc}{1.01011023422442}& {0.908571684515523}& {-0.448582051978077}& {-1.18581063938115}& {-0.284289227380716}\end{array}\right]{,}\left[\begin{array}{ccccc}{-2.93008949929931}& {-0.875854279296868}& {2.38878178550180}& {2.35220261444364}& {-0.935040621349269}\end{array}\right]$ (1)
 > $\mathrm{B1};$$\mathrm{B2}$
 $\left[\begin{array}{ccccc}1.010110234224416& 0.908571684515523& -0.448582051978077& -1.1858106393811467& -0.28428922738071616\end{array}\right]$
 $\left[\begin{array}{ccccc}-2.930089499299309& -0.8758542792968684& 2.3887817855018025& 2.35220261444364& -0.9350406213492695\end{array}\right]$ (2)
 > $\mathrm{display}\left(⟨⟨⟨\mathrm{listplot}\left(A,'\mathrm{title}'="Signal"\right)⟩,⟨\mathrm{listplot}\left(\mathrm{B1},'\mathrm{title}'="Low"\right)⟩,\mathrm{listplot}\left(\mathrm{B2},'\mathrm{title}'="High"\right)⟩⟩\right)$

 > $C≔\mathrm{InverseDWT}\left(\mathrm{B1},\mathrm{B2}\right)$
 $\left[\begin{array}{cccccccccc}3.940199733523725& -1.9199792650748932& 1.7844259638123914& 0.032717405218654516& -2.8373638374798795& 1.9401997335237255& -3.538013253824787& 1.1663919750624934& 0.6507513939685533& -1.2193298487299855\end{array}\right]$ (3)
 > $\mathrm{map}\left(\mathrm{fnormal},A-C\right)$
 $\left[\begin{array}{cccccccccc}0.& 0.& 0.& 0.& 0.& 0.& 0.& -0.& 0.& 0.\end{array}\right]$ (4)
 > 

Compatibility

 • The SignalProcessing[DWT] and SignalProcessing[InverseDWT] commands were introduced in Maple 17.
 • For more information on Maple 17 changes, see Updates in Maple 17.

 See Also