You are on page 1of 4

>> x = [1, 1, 1, 1, 1, 1, 1, 1];

>> f = [1, 2, 3, 4];


>> newx = conv(x, f);
>> newx
newx =
1 3 6 10 10 10 10 10 9 7 4
>> help wavedec
wavedec Multi-level 1-D wavelet decomposition.
wavedec performs a multilevel 1-D wavelet analysis
using either a specific wavelet 'wname' or a specific set
of wavelet decomposition filters (see WFILTERS).
[C,L] = wavedec(X,N,'wname') returns the wavelet
decomposition of the signal X at level N, using 'wname'.
N must be a strictly positive integer (see WMAXLEV).
The output decomposition structure contains the wavelet
decomposition vector C and the bookkeeping vector L.
For [C,L] = wavedec(X,N,Lo_D,Hi_D),
Lo_D is the decomposition low-pass filter and
Hi_D is the decomposition high-pass filter.
The structure is organized as:
C = [app. coef.(N)|det. coef.(N)|... |det. coef.(1)]
L(1) = length of app. coef.(N)
L(i) = length of det. coef.(N-i+2) for i = 2,...,N+1
L(N+2) = length(X).
See also dwt, waveinfo, waverec, wfilters, wmaxlev.
Reference page in Help browser
doc wavedec
>> [c, l] = wavedec(x, 3, f, f);
>> c
c =
Columns 1 through 8
1000 1000 1000 1000 1000 1000
100 100
Columns 9 through 15
100 100 10 10 10 10
10
>> l
l =
3 3 4 5 8
>> help dwt
dwt Single-level discrete 1-D wavelet transform.
dwt performs a single-level 1-D wavelet decomposition
with respect to either a particular wavelet ('wname',
see WFILTERS for more information) or particular wavelet filters
(Lo_D and Hi_D) that you specify.
[CA,CD] = dwt(X,'wname') computes the approximation
coefficients vector CA and detail coefficients vector CD,
obtained by a wavelet decomposition of the vector X.
'wname' is a string containing the wavelet name.
[CA,CD] = dwt(X,Lo_D,Hi_D) computes the wavelet decomposition
as above given these filters as input:
Lo_D is the decomposition low-pass filter.
Hi_D is the decomposition high-pass filter.
Lo_D and Hi_D must be the same length.
Let LX = length(X) and LF = the length of filters; then
length(CA) = length(CD) = LA where LA = CEIL(LX/2),
if the dwt extension mode is set to periodization.
LA = FLOOR((LX+LF-1)/2) for the other extension modes.
For the different signal extension modes, see DWTMODE.

[CA,CD] = dwt(...,'mode',MODE) computes the wavelet


decomposition with the extension mode MODE you specify.
MODE is a string containing the extension mode.
Example:
x = 1:8;
[ca,cd] = dwt(x,'db1','mode','sym')
See also dwtmode, idwt, wavedec, waveinfo.
Reference page in Help browser
doc dwt
>> help dwtmode
dwtmode Discrete wavelet transform extension mode.
dwtmode sets the signal or image extension mode for
discrete wavelet and wavelet packet transforms.
The extension modes represent different ways of handling
the problem of border distortion in the analysis.
dwtmode or dwtmode('status') display the current mode.
ST = dwtmode or ST = dwtmode('status') display and
return the current mode.
ST = dwtmode('status','nodisp') returns the current mode
and does not display the text.
dwtmode('sym') or dwtmode('symh') sets the DWT mode to
symmetric-padding (half-point): boundary value symmetric
replication - default mode.
dwtmode('symw') sets the DWT mode to symmetric-padding
(whole-point): boundary value symmetric replication.
dwtmode('asym') or dwtmode('asymh') sets the DWT mode to
antisymmetric-padding (half-point): boundary value
antisymmetric replication.
dwtmode('asymw') sets the DWT mode to antisymmetric-padding
(whole-point): boundary value antisymmetric replication.
dwtmode('zpd') sets the DWT mode to zero-padding
dwtmode('spd') or dwtmode('sp1') sets the DWT mode
to smooth-padding of order 1 (first derivative
interpolation at the edges).
dwtmode('sp0') sets the DWT mode to smooth-padding
of order 0 (constant extension at the edges).
dwtmode('ppd') sets the DWT mode to periodic-padding
(periodic extension at the edges).
The DWT associated with these eight modes is slightly
redundant. But IDWT ensures a perfect reconstruction for any
of the five previous modes whatever is the extension mode
used for DWT.
dwtmode('per') sets the DWT mode to periodization.
This mode produces the smallest length wavelet decomposition.
But, the extension mode used for IDWT must be the same to
ensure a perfect reconstruction.
Using this mode, DWT and DWT2 produce the same results as
the obsolete functions DWTPER and DWTPER2, respectively.
All functions and GUI tools that use the DWT (1-D & 2-D) or
Wavelet Packet (1-D & 2-D) use the specified DWT extension mode.
dwtmode updates a global variable allowing the use of these
six signal extensions. The extension mode should only
be changed using this function. Avoid changing the global
variable directly.
--------------------------------------------------------------
The default mode is loaded from the file dwtmode.DEF
if it exists. If not, the file dwtmode.CFG
(in the "toolbox/wavelet/wavelet" directory) is used.
dwtmode('save',mode) saves "mode" as new default mode
in the file dwtmode.DEF (all the files named dwtmode.DEF
are deleted before saving).
dwtmode('save') is equivalent to dwtmode('save',currentMode).
--------------------------------------------------------------

See also dwt, dwt2 ,idwt, idwt2, wextend.


Reference page in Help browser
doc dwtmode
>> dwtmode('zpd')
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! WARNING: Change DWT Extension Mode !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
****************************************
** DWT Extension Mode: Zero Padding **
****************************************
>> [c, l] = wavedec(x, 3, f, f);
>> c
c =
104 476 420 104 476 420 16 72 84 28 3 10 10
10 7
>> l
l =
3 3 4 5 8
>> appcoef(c, l, f, f, 1)
ans =
7584 11984 12204 18792 16856
>> conv([16, 72, 91, 28], f)
ans =
16 104 283 490 617 448 112

You might also like