functionwavDec

Wavelet multilevel decomposition

Information

This function carries out multi-level wavelet decomposition.

Parameter, len, is a vector with (N+2) elements, where N is the number of levels. It contents the length information of the coefficients in all levels. len[1] is the length of the original signal vector; len[2] is the length of the detail coefficient vector of the first decomposition level; len[3] is the length of the detail coefficient vector of the second decomposition level; and so forth. Finally, len[N+2] contains the length of the approximation coefficient vector. Parameter, c, contains the wavelet coefficients of all levels, firstly the first detail level, then the second detail level and so on, and finally the approximation coefficients. This is described again in detail as follows:

Definition of the outputs

Data Length Location
Original signal len[1] u
First level detail coefficients len[2] c[1 : len[2]]
Second level detail coefficients len[3] c[len[2]+1 : len[2]+len[3]]
... ... ...
k-th level detail coefficients len[k+1] c[sum(len[2:k])+1 : sum(len[2:k+1])]
... ... ...
N-th level detail coefficients len[N+1] c[sum(len[2:N])+1 : sum(len[2:N+1])]
Approximation coefficients len[N+2] c[sum(len[2:N+1])+1 : sum(len[2:N+2])]

Refer to the section of wavelet Families for the detailed information about the available wavelets.

The default input values provide a quick example with a simple saw-tooth signal.

Inputs

TypeNameDefaultDescription
Real[:]u{1, 2, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 1}Signal to be analyzed
IntegerN3Decomposition level
Real[:]lod{0.707, 0.707}Low pass filter for decomposition
Real[size(lod, 1)]hid{-0.707, 0.707}High pass filter for decomposition

Outputs

TypeNameDefaultDescription
Real[:]cDetail and approximation coefficients. For data structure see the information section
Integer[N + 2]lenLengths of the coefficient vectors of all levels. For data structure see the information section