ddencmp

Default values for denoising or compression

Syntax

[THR,SORH,KEEPAPP,CRIT] = ddencmp(IN1,IN2,X)
[THR,SORH,KEEPAPP] = ddencmp(IN1,'wv',X)
[THR,SORH,KEEPAPP,CRIT] = ddencmp(IN1,'wp',X)

Description

ddencmp returns default values for denoising or compression for the critically-sampled discrete wavelet or wavelet packet transform.

You can use ddencmp for 1-D signals or 2-D images.

[THR,SORH,KEEPAPP,CRIT] = ddencmp(IN1,IN2,X) returns default values for denoising or compression, using wavelets or wavelet packets, of an input vector or matrix X, which can be a one- or two-dimensional signal. THR is the threshold, SORH is for soft or hard thresholding, KEEPAPP allows you to keep approximation coefficients, and CRIT (used only for wavelet packets) is the entropy name (see wentropy for more information).

IN1 is 'den' for denoising or 'cmp' for compression.

IN2 is 'wv' for wavelet or 'wp' for wavelet packet.

For wavelets (three output arguments):

[THR,SORH,KEEPAPP] = ddencmp(IN1,'wv',X) returns default values for denoising (if IN1 = 'den') or compression (if IN1 = 'cmp') of X. These values can be used for wdencmp.

For wavelet packets (four output arguments):

[THR,SORH,KEEPAPP,CRIT] = ddencmp(IN1,'wp',X) returns default values for denoising (if IN1 = 'den') or compression (if IN1 = 'cmp') of X. These values can be used for wdencmp.

Examples

expand all

Default Global Threshold for Wavelet Denoising

Determine the default global denoising threshold for an N(0,1) white noise input.

Create an N(0,1) white noise input. Set the random number generator to the default initial settings for reproducible results.

dwtmode('per');
rng default;
x = randn(512,1);

Use ddencmp to obtain the default global threshold for wavelet denoising. Demonstrate that the threshold is equal to the universal threshold of Donoho and Johnstone scaled by a robust estimate of the variance.

[thr,sorh,keepapp] = ddencmp('den','wv',x);
[A,D] = dwt(x,'db1');
noiselev = median(abs(D))/0.6745;
thresh = sqrt(2*log(length(x)))*noiselev;

Compare the value of the variable thr to the value of thresh.

Default Global Threshold for Wavelet Packet Compression

Determine the default global compression threshold for an N(0,1) white noise input.

Create an N(0,1) white noise input. Set the random number generator to the default initial settings for reproducible results.

dwtmode('per');
rng default;
x = randn(512,1);

Use ddencmp with the 'cmp' and 'wp' input arguments to return the default global compression threshold for a wavelet packet transform.

[thr,sorh,keepapp,crit] = ddencmp('den','wp',x);

References

Donoho, D.L. (1995), "De-noising by soft-thresholding," IEEE, Trans. on Inf. Theory, 41, 3, pp. 613–627.

Donoho, D.L.; I.M. Johnstone (1994), "Ideal spatial adaptation by wavelet shrinkage," Biometrika, vol 81, pp. 425–455.

Donoho, D.L.; I.M. Johnstone (1994), "Ideal de-noising in an orthonormal basis chosen from a library of bases," C.R.A.S. Paris, Ser. I, t. 319, pp. 1317–1322.

Was this topic helpful?