Main Content

idwpt

Inverse wavelet packet 1-D transform

Since R2020a

Description

xrec = idwpt(wpt,l) inverts the discrete wavelet packet transform (DWPT) of the terminal node wavelet packet tree wpt using the bookkeeping vector l. The idwpt function assumes that you obtained wpt and l using dwpt with the fk18 wavelet and default settings.

If the input to dwpt was one signal, xrec is a column vector. If the input was a multichannel signal, xrec is a matrix, where each matrix column corresponds to a channel.

xrec = idwpt(wpt,l,wname) uses the wavelet specified by wname to invert the DWPT. wname must be recognized by wavemngr. The specified wavelet must be the same wavelet used to obtain the DWPT.

xrec = idwpt(wpt,l,LoR,HiR) uses the scaling (lowpass) filter, LoR, and wavelet (highpass) filter, HiR. The synthesis filter pair LoR and HiR must be associated with the same wavelet used in the DWPT.

example

xrec = idwpt(___, Boundary=ExtensionMode) specifies the mode to extend the signal.

example

Examples

collapse all

This example shows how to perform the inverse discrete wavelet packet transform using synthesis filters.

Obtain the DWPT of an ECG signal using dwpt with default settings.

load wecg
[wpt,l] = dwpt(wecg);

By default, dwpt uses the fk18 wavelet. Obtain the synthesis (reconstruction) filters associated with the wavelet.

[~,~,lor,hir] = wfilters("fk18");

Invert the DWPT using the synthesis filters and demonstrate perfect reconstruction.

xrec = idwpt(wpt,l,lor,hir);
norm(wecg-xrec,"inf")
ans = 
4.9236e-11

Obtain the DWPT of an ECG signal using dwpt and periodic extension.

load wecg
[wpt,l] = dwpt(wecg,Boundary="periodic");

By default, idwpt uses symmetric extension. Invert the DWPT using periodic and symmetric extension modes.

xrecA = idwpt(wpt,l,Boundary="periodic");
xrecB = idwpt(wpt,l);

Demonstrate perfect reconstruction only when the extension modes of the forward and inverse DWPT agree.

fprintf("Periodic/Periodic : %f\n",norm(wecg-xrecA,"inf"))
Periodic/Periodic : 0.000000
fprintf("Periodic/Symmetric: %f\n",norm(wecg-xrecB,"inf"))
Periodic/Symmetric: 1.477907

Input Arguments

collapse all

Terminal node wavelet packet tree, specified as a cell array. wpt is the output of dwpt with the FullTree set to false.

Example: [wpt,l] = dwpt(X,Level=3,FullTree=false) returns the terminal node wavelet packet tree of the three-level wavelet packet decomposition of X.

Data Types: single | double
Complex Number Support: Yes

Bookkeeping vector, specified as a vector of positive integers. The vector l is the output of dwpt. The bookkeeping vector contains the length of the input signal and the number of coefficients by level and is required for perfect reconstruction.

Data Types: single | double

Wavelet to use in the inverse DWPT, specified as a character vector or string scalar. wname must be recognized by wavemngr. The specified wavelet must be the same wavelet used to obtain the DWPT.

You cannot specify both wname and a filter pair, LoD and HiD.

Example: xrec = idwpt(wpt,l,"sym4") specifies the sym4 wavelet.

Wavelet synthesis (reconstruction) filters to use in the inverse DWPT, specified as a pair of real-valued vectors. LoR is the scaling (lowpass) synthesis filter, and HiR is the wavelet (highpass) synthesis filter. The synthesis filter pair must be associated with the same wavelet as used in the DWPT. You cannot specify both wname and a filter pair, LoR and HiR. See wfilters for additional information.

Note

idwpt does not check that LoR and HiR satisfy the requirements for a perfect reconstruction wavelet packet filter bank. To confirm your filter pair satisfies the requirements, use isorthwfb or isbiorthwfb.

Wavelet packet transform boundary handling, specified as "reflection" or "periodic". When set to "reflection" or "periodic", the wavelet packet coefficients are extended at each level based on the "sym" or "per" mode in dwtmode, respectively. ExtensionMode must be the same mode used in the DWPT. If unspecified, ExtensionMode defaults to "reflection".

Example: xrec = idwpt(wpt,l,Boundary="periodic") and xrec = idwpt(wpt,l,"Boundary","periodic") both specify periodic boundary handling.

References

[1] Wickerhauser, Mladen Victor. Adapted Wavelet Analysis from Theory to Software. Wellesley, MA: A.K. Peters, 1994.

[2] Percival, D. B., and A. T. Walden. Wavelet Methods for Time Series Analysis. Cambridge, UK: Cambridge University Press, 2000.

[3] 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 R2020a

expand all