# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# mswden

Multisignal 1-D denoising using wavelets

## Syntax

```[XD,DECDEN,THRESH] = mswden('den',...) [XD,THRESH] = mswden('densig',...) [DECDEN,THRESH] = mswden('dendec',...) THRESH = mswden('thr',...) [...] = mswden(OPTION,DIRDEC,X,WNAME,LEV,METH,PARAM) [...] = mswden(...,S_OR_H) [...] = mswden(...,S_OR_H,KEEPAPP) [...] = mswden(...,S_OR_H,KEEPAPP,IDXSIG) ```

## Description

`mswden` computes thresholds and, depending on the selected option, performs denoising of 1-D signals using wavelets.

`[XD,DECDEN,THRESH] = mswden('den',...)` returns a denoised version `XD` of the original multisignal matrix `X`, whose wavelet decomposition structure is `DEC`. The output `XD` is obtained by thresholding the wavelet coefficients, `DECDEN` is the wavelet decomposition associated to `XD` (see `mdwtdec`), and `THRESH` is the matrix of threshold values. The input `METH` is the name of the denoising method and `PARAM` is the associated parameter, if required.

Valid denoising methods `METH` and associated parameters `PARAM` are:

 `'rigrsure'` Principle of Stein's Unbiased Risk `'heursure'` Heuristic variant of the first option `'sqtwolog'` Universal threshold `sqrt(2*log(.))` `'minimaxi'` Minimax thresholding (see `thselect`)

For these methods `PARAM` defines the multiplicative threshold rescaling:

 `'one'` No rescaling `'sln'` Rescaling using a single estimation of level noise based on first level coefficients `'mln'` Rescaling using a level dependent estimation of level noise

### Penalization methods

 `'penal'` Penal `'penalhi'` Penal high, `2.5` ℜ≤ `PARAM` ℜ≤ `10` `'penalme'` Penal medium, `1.5` ℜ≤ `PARAM` ℜ≤ `2.5` `'penallo'` Penal low, `1` ℜ≤ `PARAM` ℜ≤ `2`

`PARAM` is a sparsity parameter, and it should be such that: `1``PARAM``10`. For `penal` method, no control is done.

### Manual method

 `'man_thr'` Manual method

`PARAM` is an `NbSIG`-by-`NbLEV` matrix or `NbSIG`-by-(`NbLEV+1`) matrix such that:

• `PARAM(i,j)` is the threshold for the detail coefficients of level `j` for the ith signal (`1``j``NbLEV`).

• `PARAM(i,NbLEV+1)` is the threshold for the approximation coefficients for the `i`th signal (if `KEEPAPP` is `0`).

where `NbSIG` is the number of signals and `NbLEV` the number of levels of decomposition.

Instead of the `'den'` input `OPTION`, you can use `'densig'`, `'dendec'` or `'thr'` `OPTION` to select output arguments:

`[XD,THRESH] = mswden('densig',...)` or ```[DECDEN,THRESH] = mswden('dendec',...)```

`THRESH = mswden('thr',...)` returns the computed thresholds, but denoising is not performed.

The decomposition structure input argument `DEC` can be replaced by four arguments: `DIRDEC`, `X`, `WNAME` and `LEV`.

`[...] = mswden(OPTION,DIRDEC,X,WNAME,LEV,METH,PARAM)` before performing a denoising or computing thresholds, the multisignal matrix `X` is decomposed at level `LEV` using the wavelet `WNAME`, in the direction `DIRDEC`.

You can use three more optional inputs:

`[...] = mswden(...,S_OR_H)` or
```[...] = mswden(...,S_OR_H,KEEPAPP)``` or
```[...] = mswden(...,S_OR_H,KEEPAPP,IDXSIG)```

• `S_OR_H ('s' or 'h') ` stands for soft or hard thresholding (see `mswthresh` for more details).

• `KEEPAPP (true or false)` indicates whether to keep approximation coefficients (`true`) or not (`false`).

• `IDXSIG` is a vector that contains the indices of the initial signals, or the character vector `'all'`.

The defaults are, respectively, `'h'`, `false` and `'all'`.

## Examples

```% Load original 1D-multisignal. load thinker % Perform a decomposition at level 2 using the wavelet db2. dec = mdwtdec('r',X,2,'db2'); % Denoise signals using the universal method % of thresholding (sqtwolog) and the 'sln' % threshold rescaling (with a single estimation % of level noise, based on first level coefficients). [XD,decDEN,THRESH] = mswden('den',dec,'sqtwolog','sln'); % Plot the original signals 1 and 31, and the % corresponding denoised signals. figure; plot(X([1 31],:)','r--','linewidth',2); hold on plot(XD([1 31],:)','b','linewidth',2); grid; set(gca,'Xlim',[1,96]) title('X dashed line and XD solid line') ```

## References

Birgé, L.; P. Massart (1997), “From model selection to adaptive estimation,” in D. Pollard (ed), Festchrift for L. Le Cam, Springer, pp. 55–88.

DeVore, R.A.; B. Jawerth, B.J. Lucier (1992), “Image compression through wavelet transform coding,” IEEE Trans. on Inf. Theory, vol. 38, No 2, pp. 719–746.

Donoho, D.L. (1993), “Progress in wavelet analysis and WVD: a ten minute tour,” in Progress in wavelet analysis and applications, Y. Meyer, S. Roques, pp. 109–128. Frontières Ed.

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, G. Kerkyacharian, D. Picard (1995), “Wavelet shrinkage: asymptopia,” Jour. Roy. Stat. Soc.,series B, vol. 57 no. 2, pp. 301–369.

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

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