1D Wavelet Denoising using WDEN Function in MATLAB
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
- in1: Can be either the input signal
X, the DWT coefficient vectorC, or the MODWT transform matrixW. - in2: The threshold selection rule (
TPTR) specified as a string. See the list of supported options above. - in3: The type of thresholding (
SORH) specified as 's' (soft) or 'h' (hard). - 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).
- in5: The level of the wavelet transform (
N) as an integer. - in6: The wavelet name (
WNAME) specified as a string. For MODWT denoising, it must correspond to an orthogonal wavelet. - in7: (Optional) The number of DWT coefficients by level (
L) ifCis provided as input.
Output Arguments
- xd: The denoised signal.
- cxd: The denoised wavelet coefficients (a vector for DWT or a matrix for MODWT).
- lxd: The number of coefficients by level for DWT denoising.
- 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. lxdis not supported for MODWT denoising.- You must use the same wavelet in both
WAVEDECandWDENorMODWTandWDENfor 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.
原文地址: https://www.cveoy.top/t/topic/nSCH 著作权归作者所有。请勿转载和采集!