wpthcoef

Wavelet packet coefficients thresholding

Description

wpthcoef is a denoising and compression utility for one- and two-dimensional wavelet packet trees.

wpt = wpthcoef(T,keepapp,sorh,thr) returns the hard or soft thresholding, indicated by sorh, of the coefficients in the wavelet packet tree T. thr is the threshold value. keepapp indicates whether to threshold the approximation coefficients.

example

Examples

collapse all

Obtain the wavelet packet tree corresponding to the wavelet packet decomposition of the signal at level 3. Use the db1 wavelet. Plot the tree.

wpt = wpdec(noisdopp,3,"db1");
fig = plot(wpt);

Apply a hard threshold of 2 to the wavelet coefficients. Do not threshold the approximation coefficients.

thr = 2;
sorh = "h";
keepapp = 1;
wptNew = wpthcoef(wpt,keepapp,sorh,thr);

Obtain the wavelet coefficients at node depth-position (3,7) from both trees.

dp = [3 7];

Plot the coefficients.

tiledlayout(2,1)
nexttile
plot(coeffsOrig)
title("Original Coefficients")
nexttile
plot(coeffsNew)
title("Coefficients After Thresholding")

Input Arguments

collapse all

Wavelet packet tree, specified as a wptree object.

Threshold approximation coefficients logical which determines whether to keep or threshold the approximation coefficients, specified as a numeric or logical 1 (true) or 0 (false).

• 0 — Threshold approximation coefficients

• 1 — Keep approximation coefficients

Type of thresholding to perform:

• "s" — Soft thresholding

• "h" — Hard thresholding

Threshold value, specified as a positive real number.

Output Arguments

collapse all

Wavelet packet tree, returned as a wptree object.

Version History

Introduced before R2006a