Matalb signal threshold value Denoising

Source: Internet
Author: User

MATLAB implements signal threshold de-noise, mainly including threshold de-noise and threshold acquisition.


1. Threshold Value acquisition
Functions for threshold value acquisition in MATLAB include ddencmp, thselect, wbmp en, and wwdcbm. The usage of these functions is briefly described below.

Ddencmp has the following three calling formats:
(1) [Thr, sorh, keepapp, crit] = ddencmp (in1, in2, X)
(2) [Thr, sorh, keepapp, crit] = ddencmp (in1, 'wp ', X)
(3) [Thr, sorh, keepapp, crit] = ddencmp (in1, 'wv ', X)
Function ddencmp is used to obtain the default threshold value of a signal during noise reduction or compression. The input parameter X is a one-dimensional or two-dimensional signal. The in1 value is 'den 'or 'cmp', 'den 'indicates denoising, and 'cmp' indicates compression; in2 is set to 'wv 'or 'wp'. WV indicates wavelet and WP indicates wavelet packet. The returned value of thr is the returned threshold, sorh is the soft threshold or hard threshold selection parameter, keepapp indicates that the low-frequency signal is saved, and crit is the entropy name (used only when the wavelet packet is selected ).

The call format of the function thselect is as follows:
Thr = thselect (x, tptr );
Thr = thselect (x, tptr) selects the adaptive threshold of signal X based on the threshold selection rules defined by the string tptr.
Adaptive Threshold selection rules include the following:
* Tptr = 'rigrsure '. The adaptive threshold value uses the non-biased risk estimation principle of Stein.
* Tptr = 'heursure ', which is selected using the heuristic threshold.
* Tptr = 'sqtwolog', With the threshold equal to SQRT (2 * log (length (X ))).
* Tptr = 'minmaxi', which is used to select the threshold based on the extremely small principle.
The threshold selection rules are based on the model Y = f (t) + e, and E is Gaussian white noise N (0, 1 ).

The Calling format of the wbmp function is as follows:
Thr = wbmp en (C, L, Sigma, alpha );
Thr = wbmp en (C, L, Sigma, alpha) returns the global denoising threshold value thr. THR is calculated based on a given wavelet coefficient selection rule. The wavelet coefficient selection rule uses the birge-Massart penalty algorithm. {C, L] is the de-noise signal or image wavelet decomposition structure; Sigma is the standard deviation of zero-mean Gaussian white noise; Alpha is the adjustment parameter for penalty, it must be a real number greater than 1, usually alpha = 2.
Set T * To make CRIT (t) =-sum (C (k) ^ 2, K <= T) + 2 * Sigma ^ 2 * T * (alpha + Log (N/t) Minimum value, where C (k) is a wavelet packet coefficient arranged in ascending order of absolute values, if n is the number of coefficients, Thr = | C (t *) |.
Wbmp en (C, L, Sigma, Alpha, ARG) calculates the threshold and draws three curves.
2 * Sigma ^ 2 * T * (alpha + Log (N/t ))
Sum (C (k) ^ 2, K <= T)
CRIT (t)

The Calling format of wdcbm is as follows:
(1) [Thr, nkeep] = wdcbm (C, L, alpha );
(2) [Thr, nkeep] = wdcbm (C, L, Alpha, M );
The wdcbm function uses the birge-Massart algorithm to obtain the threshold of one-dimensional wavelet transformation. The returned value thr is a scale-independent threshold, and nkeep is the number of coefficients. [C, L] is the decomposition structure of the signal for compression or de-noise at Layer J = length (L)-2. lapha and m must be real numbers greater than 1; THR is the vector about J, Thr (I) is the threshold of the I layer, nkeep is also the vector about J, and nkeep (I) is the number of coefficients of the I layer. Generally, Alpha is 1.5 for compression, and Alpha is 3 for Noise Removal.


2. Signal threshold value Denoising
The functions that implement signal threshold denoising in MATLAB include wden, wdencmp, wthresh, wthcoef, wpthcoef, and wpdencmp. The following describes their usage.

The wden function can be called in the following two formats:
(1) [XD, cxd, LXD] = wden (x, tptr, sorh, Scal, N, 'wname ')
(2) [XD, cxd, LXD] = wden (C, L, tptr, sorh, Scal, N, 'wname ')
The wden function is used for automatic noise reduction of one-dimensional signals. X is the original signal, [C, L] is the signal wavelet decomposition, and N is the number of layers of wavelet decomposition.
THR is the threshold selection rule:
* Tptr = 'rigrsure '. The adaptive threshold value uses the non-biased risk estimation principle of Stein.
* Tptr = 'heursure ', which is selected using the heuristic threshold.
* Tptr = 'sqtwolog', With the threshold equal to SQRT (2 * log (length (X ))).
* Tptr = 'minmaxi', which is used to select the threshold based on the extremely small principle.
Sorh is the choice of soft or hard thresholds (corresponding to 'S' and 'H' respectively ').
Scal indicates whether the threshold value needs to be adjusted again, which includes the following three types:
* Scal = 'one' is not adjusted;
* Scal = 'sln' adjusts the threshold value based on the noise layer Estimation Based on the coefficients of the first layer.
* Scal = 'mln' adjust the threshold value based on different noise estimates.
XD is the signal after noise reduction, and [cxd, LXD] is the wavelet decomposition structure of the signal after noise reduction. Format (1) return the de-noise signal XD after threshold processing on the wavelet coefficients after signal X undergoes N-layer decomposition and the wavelet decomposition structure of signal XD [cxd, LXD]. Format (2) return parameters are the same as format (1), but the structure is obtained by directly processing the threshold value of the signal wavelet decomposition structure [C, L.

The Calling format of the function wdencmp is as follows:
(1) [XC, CXC, lxc, perf0, perfl2] = wdencmp ('gbl', X, 'wname', N, thtr, sorh, keepapp );
(2) [XC, CXC, lxc, perf0, perfl2] = wdencmp ('lvd ', X, 'wname', N, thtr, sorh );
(3) [XC, CXC, lxc, perf0, perfl2] = wdencmp ('lvd ', C, L, 'wname', N, thtr, sorh );
The function wdencmp is used for noise reduction or compression of one or two dimensional signals. Wname is the wavelet function used. GBL (abbreviation of Global) indicates that each layer uses the same threshold for processing, and LVD indicates that each layer uses different thresholds for processing, N indicates the number of layers of wavelet decomposition. Thr is the threshold vector. For the format (2) and (3), each layer requires a threshold. Therefore, the length of the threshold vector thr is n, sorh indicates soft threshold or hard threshold (values: 's' and 'H' respectively). If the keepapp parameter is set to 1, the low frequency coefficient is not quantified. Otherwise, the low frequency coefficient must be quantified by the threshold. XC is the signal for noise reduction or compression, [CXC, lxc] is the XC wavelet decomposition structure, and perf0 and perfl2 are the norm percentage for restoring or compressing L ^ 2. If [C, L] is X's wavelet decomposition structure, perfl2 = 100 * (CXC vector's norm/C vector's Norm) ^ 2; if X is a one-dimensional signal, if wavelet wname is an orthogonal wavelet, perfl2 = 100 | XC | ^ 2/| x | ^ 2.

The call format of the wthresh function is as follows:
Y = wthresh (x, sorh, T)
Y = wthresh (x, sorh, T) returns the soft threshold (if sorh = 's') or hard threshold (if sorh = 'H') of the input vector or matrix X ') the processed signal. T is the threshold.
Y = wthresh (x,'s ', T) returns y = sig (x) * (| x |-t) +, that is, the absolute value of the signal is compared with the threshold value, the point that is less than or equal to the threshold value becomes zero. The point that is greater than the threshold value is the difference between the value and the threshold value.
Y = wthresh (x, 'h', T) returns y = x * 1 (| x |> T), which compares the absolute value of the signal with the threshold value, the vertex smaller than or equal to the threshold value changes to zero, and the vertex greater than the threshold value remains unchanged. Generally, the signal processed with a hard threshold is more rough than the signal processed with a soft threshold.

The Calling format of the function wthcoef is as follows:
(1) NC = wthcoef ('D', C, L, N, P)
(2) NC = wthcoef ('D', C, L, n)
(3) NC = wthcoef ('A', C, L)
(4) NC = wthcoef ('T', C, L, N, T, sorh)
The wthcoef function is used to process the threshold of one-dimensional wavelet coefficients.
Format (1) return the wavelet decomposition structure [C, L] The new wavelet decomposition vector NC, [NC, l] form a new wavelet decomposition structure. N contains the detail vector to be compressed. P is the vector that sets the smaller coefficient to 0. The length of N and P must be the same, and that of vector n must be 1 <= N (I) <= length (L)-2.
Format (2) return the wavelet decomposition structure [C, L] the wavelet decomposition vector NC after the specified detail coefficient in vector N is set to 0.
Format (3) return the wavelet decomposition structure [C, L] the wavelet decomposition vector NC after the approximate coefficient is set to 0.
Format (4) return the wavelet decomposition structure [C, L] the wavelet decomposition vector NC after processing the vector N as the threshold. If sorh = 's', the soft threshold is used; If sorh = 'h', the hard threshold is used. N contains the detailed scale vector, and T is the threshold vector corresponding to n. The length of N and T must be equal.

The call format of the function wpdencmp is as follows:
(1) [XD, treed, perf0, perfl2] = wpdencmp (x, sorh, N, 'wname', crit, par, keepapp)
(2) [XD, treed, perf0, perfl2] = wpdencmp (tree, sorh, crit, par, keepapp)
The function wpdencmp is used to compress or de-noise Signals Using Wavelet Packet Transform.
Format (1) returns the input signal X (one-dimensional or two-dimensional) after denoising or compressing the signal XD. The output parameters treed are the best wavelet packet decomposition tree for XD, and perfl2 and perf0 are the percentage of energy used to restore and compress L2. Perfl2 = 100 * (X's wavelet packet coefficient norm/X's wavelet packet coefficient) ^ 2; if X is a one-dimensional signal, wavelet wname is an orthogonal wavelet, perfl2 = 100 * | XD | ^ 2/| x | ^ 2. The sorh value is 's' or 'h', indicating a soft or hard threshold.
The input parameter n is the number of decomposition layers of the wavelet package, and the wname is a string containing the wavelet name. The function uses the entropy defined by the string crit and the Threshold Parameter par for optimal decomposition. If keepapp = 1, the wavelet coefficients of the approximate signal are not quantified by the threshold. Otherwise, the threshold is quantified.
The format (2) is the same as the output parameter of format (1), and the input options are the same, except that it is used to perform de-noise or compression from the wavelet packet decomposition tree of the signal.
 

 

Reprinted from: http://blog.chinaaet.com/detail/3083.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.