1D Wavelet Denoising using the WDEN Function in MATLAB

The wden function in MATLAB provides a comprehensive approach for 1-D signal denoising using wavelet transforms. It offers various thresholding methods, including:

  • 'modwtsqtwolog': Uses the Maximal Overlap Discrete Wavelet Transform (MODWT) for denoising with Donoho and Johnstone's universal threshold and level-dependent thresholding.
  • 'rigrsure': Applies the principle of Stein's Unbiased Risk for denoising using the Discrete Wavelet Transform (DWT).
  • 'heursure': Utilizes a heuristic variant of Stein's Unbiased Risk.
  • 'sqtwolog': Implements Donoho and Johnstone's universal threshold with the DWT.
  • 'minimaxi': Employs minimax thresholding.

Function Signature

[xd,cxd,lxd,thrs] = wden(in1,in2,in3,in4,in5,in6,in7)

Input Arguments

  1. in1: Can be either the input signal X, the DWT coefficient vector C, or the MODWT transform matrix W.
  2. in2: The threshold selection rule (TPTR) specified as a string. See the list of supported options above.
  3. in3: The type of thresholding (SORH) specified as 's' (soft) or 'h' (hard).
  4. in4: The threshold rescaling type (SCAL) specified as:
    • 'one': No rescaling.
    • 'sln': Rescaling using a noise estimate based on the first-level coefficients.
    • 'mln': Rescaling using level-dependent noise estimates (only for MODWT denoising).
  5. in5: The level of the wavelet transform (N) as an integer.
  6. in6: The wavelet name (WNAME) specified as a string. For MODWT denoising, it must correspond to an orthogonal wavelet.
  7. in7: (Optional) The number of DWT coefficients by level (L) if C is provided as input.

Output Arguments

  1. xd: The denoised signal.
  2. cxd: The denoised wavelet coefficients (a vector for DWT or a matrix for MODWT).
  3. lxd: The number of coefficients by level for DWT denoising.
  4. thrs: The denoising thresholds by level.

Examples

Example 1: Denoise a signal with transients using both DWT and MODWT.

N = 1000;
t = linspace(0,1,N);
x = 4*sin(4*pi*t);
x = x - sign(t - .3) - sign(.72 - t);
y = x+0.15*randn(size(t));
xdDWT = wden(y,'sqtwolog','s','mln',3,'db2');
xdMODWT = wden(y,'modwtsqtwolog','s','mln',3,'db2');
subplot(2,1,1)
plot(xdDWT), title('DWT Denoising'); axis tight;
subplot(2,1,2)
plot(xdMODWT), title('MODWT Denoising'); axis tight;

Example 2: Denoise a blocky signal using Haar wavelet with both MODWT and DWT.

[x,xn] = wnoise('blocks',10,3);
xdMODWT = wden(xn,'modwtsqtwolog','s','mln',6,'haar');
xd = wden(xn,'sqtwolog','s','mln',6,'haar');
plot(x)
hold on
plot(xd,'r--')
plot(xdMODWT,'k-.')
legend('Original','DWT','MODWT')
hold off
norm(abs(x-xd),2), norm(abs(x-xd),Inf)
norm(abs(x-xdMODWT),2), norm(abs(x-xdMODWT),Inf)

Notes

  • For MODWT denoising, the 'modwtsqtwolog' thresholding rule is the only supported option.
  • lxd is not supported for MODWT denoising.
  • You must use the same wavelet in both WAVEDEC and WDEN or MODWT and WDEN for consistent results.

See Also

THSELECT, MODWT, WAVEDEC, WDENCMP, WFILTERS, WTHRESH


This content is a modified and expanded version of the original documentation for the wden function in MATLAB. The modifications were made to improve readability and clarity for users seeking a comprehensive understanding of the function and its applications. Remember to consult the official MATLAB documentation for the latest updates and specific details on the function's implementation.

1D Wavelet Denoising using WDEN Function in MATLAB

原文地址: https://www.cveoy.top/t/topic/nSCH 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录