# Documentation

### This is machine translation

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

# swt

Discrete stationary wavelet transform 1-D

## Syntax

```SWC = swt(X,N,'wname') SWC = swt(X,N,Lo_D,Hi_D) [SWA,SWD] = swt(___) ```

## Description

`swt` performs a multilevel 1-D stationary wavelet decomposition using either an orthogonal or a biorthogonal wavelet. Specify the wavelet using its name (`'wname'`, see `wfilters` for more information) or its decomposition filters.

`SWC = swt(X,N,'wname')` computes the stationary wavelet decomposition of the signal `X` at level `N`, using `'wname'`.

`N` must be a strictly positive integer (see `wmaxlev` for more information) and `length(X)` must be a multiple of 2N .

`SWC = swt(X,N,Lo_D,Hi_D)` computes the stationary wavelet decomposition as above, given these filters as input:

• `Lo_D` is the decomposition low-pass filter.

• `Hi_D` is the decomposition high-pass filter.

`Lo_D` and `Hi_D` must be the same length.

The output matrix `SWC` contains the vectors of coefficients stored row-wise:

For `1 `` i ``N`, the output matrix `SWC(i,:)` contains the detail coefficients of level `i` and `SWC(N+1,:)` contains the approximation coefficients of level `N`.

`[SWA,SWD] = swt(___)` computes approximations, `SWA`, and details, `SWD`, stationary wavelet coefficients.

The vectors of coefficients are stored row-wise:

For `1 `` i ``N`, the output matrix `SWA(i,:)` contains the approximation coefficients of level `i` and the output matrix `SWD(i,:)` contains the detail coefficients of level `i`.

### Note

`swt` is defined using periodic extension. The length of the approximation and detail coefficients computed at each level equals the length of the signal.

## Examples

collapse all

Perform a multilevel stationary wavelet decomposition of a signal.

Load a one-dimensional signal and acquire its length.

```load noisbloc s = noisbloc; sLen = length(s);```

Perform a stationary wavelet decomposition at level 3 of the signal using `'db1'`. Extract the detail and approximation coefficients at level 3.

```[swa,swd] = swt(s,3,'db1'); swd3 = swd(3,:); swa3 = swa(3,:);```

Plot the output of the decomposition.

```plot(s) xlim([0 sLen]) title('Original Signal')```

Plot the level 3 approximation and detail coefficients.

```subplot(2,1,1) plot(swa3) xlim([0 sLen]) title('Level 3 Approximation coefficients') subplot(2,1,2) plot(swd3) xlim([0 sLen]) title('Level 3 Detail coefficients')```

## Algorithms

Given a signal s of length N, the first step of the SWT produces, starting from s, two sets of coefficients: approximation coefficients cA1 and detail coefficients cD1. These vectors are obtained by convolving s with the low-pass filter `Lo_D` for approximation, and with the high-pass filter `Hi_D` for detail.

More precisely, the first step is

### Note

cA1 and cD1 are of length `N` instead of `N/2` as in the DWT case.

The next step splits the approximation coefficients cA1 in two parts using the same scheme, but with modified filters obtained by upsampling the filters used for the previous step and replacing s by cA1. Then, the SWT produces cA2 and cD2. More generally,

## References

Nason, G.P.; B.W. Silverman (1995), “The stationary wavelet transform and some statistical applications,” Lecture Notes in Statistics, 103, pp. 281–299.

Coifman, R.R.; Donoho, D.L. (1995), “Translation invariant de-noising,” Lecture Notes in Statistics, 103, pp. 125–150.

Pesquet, J.C.; H. Krim, H. Carfatan (1996), “Time-invariant orthonormal wavelet representations,” IEEE Trans. Sign. Proc., vol. 44, 8, pp. 1964–1970.