Main Content

mdwtdec

Multisignal 1-D wavelet decomposition

Description

dec = mdwtdec(dirdec,x,lev,wname) returns the 1-D discrete wavelet decomposition at level lev of each row or each column of the matrix x, using the wavelet wname.

example

dec = mdwtdec(dirdec,x,lev,LoD,HiD,LoR,HiR) uses the specified lowpass and highpass wavelet decomposition filters LoD and HiD, respectively, and the lowpass and highpass wavelet reconstruction filters LoR and HiR, respectively.

dec = mdwtdec(___,mode=extmode) uses the specified discrete wavelet transform (DWT) extension mode extmode. For more information, see dwtmode. This syntax can be used with any of the previous syntaxes.

Examples

collapse all

This example shows how to return the wavelet decomposition of a multisignal using a wavelet name and wavelet filters.

Load the 23 channel EEG data Espiga3 [4]. The channels are arranged column-wise. The data is sampled at 200 Hz.

load Espiga3
size(Espiga3)
ans = 1×2

   995    23

Perform a decomposition at level 2 using the db2 wavelet.

dec = mdwtdec("c",Espiga3,2,"db2")
dec = struct with fields:
        dirDec: 'c'
         level: 2
         wname: 'db2'
    dwtFilters: [1x1 struct]
       dwtEXTM: 'sym'
      dwtShift: 0
      dataSize: [995 23]
            ca: [251x23 double]
            cd: {[499x23 double]  [251x23 double]}

Compute the filters associated with the db2 wavelet.

[LoD,HiD,LoR,HiR] = wfilters("db2");

Perform a decomposition at level 2 using the filters.

decBIS = mdwtdec("c",Espiga3,2,LoD,HiD,LoR,HiR)
decBIS = struct with fields:
        dirDec: 'c'
         level: 2
         wname: ''
    dwtFilters: [1x1 struct]
       dwtEXTM: 'sym'
      dwtShift: 0
      dataSize: [995 23]
            ca: [251x23 double]
            cd: {[499x23 double]  [251x23 double]}

Confirm the approximation and detail coefficients of both decompositions are identical.

max(abs(dec.ca(:)-decBIS.ca(:)))
ans = 
0
max(abs(dec.cd{1}(:)-decBIS.cd{1}(:)))
ans = 
0
max(abs(dec.cd{2}(:)-decBIS.cd{2}(:)))
ans = 
0

Input Arguments

collapse all

Direction indicator of the wavelet decomposition, specified as:

  • "r" — Take the 1-D wavelet decomposition of each row of x

  • "c" — Take the 1-D wavelet decomposition of each column of x

Input data, specified as a matrix.

Data Types: single | double
Complex Number Support: Yes

Level of decomposition, specified as a positive integer. mdwtdec does not enforce a maximum level restriction. Use wmaxlev to ensure that the wavelet coefficients are free from boundary effects. If boundary effects are not a concern, a good rule is to set lev less than or equal to fix(log2(length(N))), where N is the number of samples in the 1-D data.

Analyzing wavelet, specified as a character vector or string scalar. The wavelet must be orthogonal or biorthogonal. Orthogonal and biorthogonal wavelets are designated as type 1 and type 2 wavelets respectively in the wavelet manager, wavemngr.

  • Valid built-in orthogonal wavelet families are: Best-localized Daubechies ("bl"), Beylkin ("beyl"), Coiflets ("coif"), Daubechies ("db"), Fejér-Korovkin ("fk"), Haar ("haar"), Han linear-phase moments ("han"), Morris minimum-bandwidth ("mb"), Symlets ("sym"), and Vaidyanathan ("vaid").

  • Valid built-in biorthogonal wavelet families are: Biorthogonal Spline ("bior"), and Reverse Biorthogonal Spline ("rbio").

For a list of wavelets in each family, see wfilters. You can also use waveinfo with the wavelet family short name. For example, waveinfo("db"). Use wavemngr("type",wn) to determine if the wavelet wn is orthogonal (returns 1) or biorthogonal (returns 2). For example, wavemngr("type","db6") returns 1.

Wavelet decomposition filters, specified as a pair of even-length real-valued vectors. LoD is the lowpass decomposition filter, and HiD is the highpass decomposition filter. The lengths of LoD and HiD must be equal. See wfilters for additional information.

Wavelet reconstruction filters, specified as a pair of even-length real-valued vectors. LoR is the lowpass reconstruction filter, and HiR is the highpass reconstruction filter. The lengths of LoR and HiR must be equal. See wfilters for additional information.

Extension mode used when performing the wavelet decomposition, specified as:

mode

DWT Extension Mode

"zpd"

Zero extension

"sp0"

Smooth extension of order 0

"spd" (or "sp1")

Smooth extension of order 1

"sym" or "symh"

Symmetric extension (half point): boundary value symmetric replication

"symw"

Symmetric extension (whole point): boundary value symmetric replication

"asym" or "asymh"

Antisymmetric extension (half point): boundary value antisymmetric replication

"asymw"

Antisymmetric extension (whole point): boundary value antisymmetric replication

"ppd", "per"

Periodized extension

If the signal length is odd and mode is "per", an extra sample equal to the last value is added to the right and the extension is performed in "ppd" mode. If the signal length is even, "per" is equivalent to "ppd".

The global variable managed by dwtmode specifies the default extension mode. Use dwtmode to determine the extension modes.

Output Arguments

collapse all

Wavelet decomposition of the multisignal x, returned as a structure with the following fields:

  • dirDec — Direction indicator: 'r' (row) or 'c' (column)

  • level — Level of wavelet decomposition

  • wname — Wavelet name

  • dwtFilters — Structure with four fields: LoD, HiD, LoR, and HiR

  • dwtEXTM — DWT extension mode

  • dwtShift — DWT shift parameter (0 or 1)

  • dataSize — Size of x

  • ca — Approximation coefficients at level lev

  • cd — Cell array of detail coefficients, from level 1 to level lev

The coefficients ca and cd{k}, for k from 1 to lev, are matrices and are stored in rows if dirdec is "r" or in columns if dirdec is "c".

References

[1] Daubechies, I. Ten Lectures on Wavelets. CBMS-NSF Regional Conference Series in Applied Mathematics. Philadelphia, PA: Society for Industrial and Applied Mathematics, 1992.

[2] Mallat, S.G. “A Theory for Multiresolution Signal Decomposition: The Wavelet Representation.” IEEE Transactions on Pattern Analysis and Machine Intelligence 11, no. 7 (July 1989): 674–93. https://doi.org/10.1109/34.192463.

[3] Meyer, Y. Wavelets and Operators. Translated by D. H. Salinger. Cambridge, UK: Cambridge University Press, 1995.

[4] Mesa, Hector. “Adapted Wavelets for Pattern Detection.” In Progress in Pattern Recognition, Image Analysis and Applications, edited by Alberto Sanfeliu and Manuel Lazo Cortés, 3773:933–44. Berlin, Heidelberg: Springer Berlin Heidelberg, 2005. https://doi.org/10.1007/11578079_96.

Extended Capabilities

Version History

Introduced in R2007a

expand all

See Also

|