Single-level discrete 1-D wavelet transform.
Syntax
[cA,cD] = dwt(X,'wname')
[cA,cD] = dwt(X,Lo_D,Hi_D)
Description
The dwt command performs a single-level one-dimensional wavelet decomposition with respect to either a particular wavelet ('wname', see wfilters) or particular wavelet decomposition filters (Lo_D and Hi_D) you specify.
[cA,cD] = dwt(X,'wname') computes the approximation coefficients vector cA and detail coefficients vector cD, obtained by wavelet decomposition of the vector X.
[cA,cD] = dwt(X,Lo_D,Hi_D) computes the wavelet decomposition as above, given these filters as input:
Lo_D and Hi_D must be the same length.
If lx is the length of X and lf is the length of the filters Lo_D and Hi_D, then
length(cA) = length(cD) = floor((lx+lf-1)/2).
For the different signal extension modes, see dwtmode.
Examples
% Construct elementary original one-dimensional signal.
randn('seed',531316785)
s = 2 + kron(ones(1,8),[1 -1]) + ...
((1:16).^2)/32 + 0.2*randn(1,16);
% Perform single-level discrete wavelet transform of s by haar.
[ca1,cd1] = dwt(s,'haar');
subplot(311); plot(s); title('Original signal');
subplot(323); plot(ca1); title('Approx. coef. for haar');
subplot(324); plot(cd1); title('Detail coef. for haar');
% For a given wavelet, compute the two associated decomposition
% filters and compute approximation and detail coefficients
% using directly the filters.
[Lo_D,Hi_D] = wfilters('haar','d');
[ca1,cd1] = dwt(s,Lo_D,Hi_D);
% Perform single-level discrete wavelet transform of s by db2
% and observe edge effects for last coefficients.
% These extra coefficients are only used to ensure exact
% global reconstruction.
[ca2,cd2] = dwt(s,'db2');
subplot(325); plot(ca2); title('Approx. coef. for db2');
subplot(326); plot(cd2); title('Detail coef. for db2');

Algorithm
Starting from a signal s, two sets of coefficients are computed: approximation coefficients CA1 and detail coefficients CD1. These vectors are obtained by convolving s with the low-pass filter Lo_D for approximation, and with the high-pass filter Hi_D for detail, followed by dyadic decimation.
More precisely, the first step is:

The length of each filter is equal to 2N. If n = length(s), the signals F and G are of length n + 2N - 1 and then the coefficients CA1 and CD1 are of length
.
Note: In order to deal with signal-end effects involved by convolution based algorithm, a global variable managed by dwtmode is used. The possible options are: zero-padding (used in the previous example, this mode is the default), symmetric extension, and smooth extension. It should be noted that dwt has the same single inverse function idwt for the three extension modes.
Limitations
Periodized wavelet transform is handled separately (see dwtper and idwtper).
See Also
dwtmode, dwtper, idwt, wavedec, waveinfo
References
I. Daubechies (1992), "Ten lectures on wavelets," CBMS-NSF conference series in applied mathematics. SIAM Ed.
S. Mallat (1989), "A theory for multiresolution signal decomposition: the wavelet representation," IEEE Pattern Anal. and Machine Intell., vol. 11, no. 7, pp 674-693.
Y. Meyer (1990), "Ondelettes et opérateurs," Tome 1, Hermann Ed. (English translation: Wavelets and operators, Cambridge Univ. Press. 1993.)
[ Previous | Help Desk | Next ]