## 2 Principles of Denoising  
Wavelet analysis is based in the multi-resolution analysis. Signals are decomposed into localized component waves of variable duration (wavelets). A discrete signal \(f\) is first decomposed into a first trend \(a^{1}\) and a first fluctuation \(d^{1}\): \(f\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\! \!\!\!\!\!\!\!\!\! from a set of samples \(x_{i}=s_{i}+n_{i}\,(i=1,\ldots,\,M)\) corrupted by a zero mean white Gaussian noise \(n_{i}\,\). The Discrete Wavelet Transform (DWT) can be used for denoising a noisy signal. If \(W\) denotes a \(M\) by \(M\) orthonormal wavelet transformation matrix, the previous equation can be expressed in the wavelet domain as:  
\[X=S+N\,, \tag{2}\]  
where \(X\,\triangleleft\,Wx\), \(S\,\triangleleft\,Ws\) and \(N\,\triangleleft\,Wn\) are the wavelet transforms of \(x\), \(s\) and \(n\). For a smooth function with additive Gaussian white noise, a theoretical threshold exists that completely removes the noise and successfully reproduces the original function:  
\[\hat{s}=W^{-1}HWx\,, \tag{3}\]  
where \(H=diag[h(1),h(2),...,h(M)]\) is a filter. One method of filtering is thresholding. A denoised signal is obtained by applying the inverse wavelet transform \(W^{-1}\) (with the same wavelet basis) to a limited number of the highest coefficients of the DWT spectrum (\(Y\)). There are a number of ways to decide which coefficients should be retained. The two simplest methods are the hard and soft thresholding:  
* The hard threshold filter \(H_{hard}\) removes the coefficients below a threshold value \(T\), determined by the noise variance and keeps the others to the same value: \[Y=X\cdot\left(\left|X\right|>T\right)\] (4)
* The soft threshold filter \(H_{soft}\) shrinks the wavelet coefficients above, and below the threshold reduces them towards zero: \[Y=sign(X)\cdot\left(\left|X\right|-T\right)\] (5)  
Figure 2 shows the transfer function of the hard (red) and soft (blue) threshold filters (with \(T=1\)). If the resulting signal has to be smooth, it has been shown that the soft threshold filter must be used [22]. The selection of the threshold value can be difficult. In practice, if the noise-free signal \(s\left(t\right)\) is unknown, a smooth approximation of the signal is looked for. Small threshold values lead to noisy  
Figure 2: \(H_{hard}\) and \(H_{soft}\) transfer functions of the threshold filters (with \(T=1\)) currently used in denoising. results, while large threshold values introduce bias. Experimental studies have demonstrated that for some applications, the optimal threshold is simply computed as a constant \(c\) times the noise variance [23]. Four approaches are used in this study [18]:  
* One approach utilizes a selection rule based on [PERSON]'s Unbiased Risk Estimate or SURE (quadratic loss function). If the signal to noise ratio is very small, the SURE estimate is very noisy. * The Universal method assigns a threshold level equal to the noise variance times \(\sqrt{2\log(M)}\), where \(M\) is the sample size [21]. * The heuristic approach is a mixture of the two previous ones, and if the signal to noise ratio is detected to be very small, the fixed threshold is used. * The fourth method uses a fixed threshold selected to yield the minimax performance for mean square error against an ideal procedure (minimum of the maximum mean square error). The choice of the proper wavelet scaling function is always the most important thing. Generally, for denoising, the wavelet scaling function must have mathematical properties (shape, continuity of the signal and its derivatives) similar to the original signal. For example, to denoise pulsed signals, the Haar wavelet (box scaling function) will perform well, but it will not perform as well to denoise sinusoidal signals. On the other hand, high order Daubechies wavelets (e.g. order 8) will perform well for sinusoidal signals. If the level of decomposition increases (higher fluctuation terms \(d^{L}\) included), signals can be reproduced with increasingly accuracy.