# 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.

## Effect of Wavelet Support on Noisy Data

In this example you demonstrate an instance of discontinuities in noisy data being represented more sparsely using a Haar wavelet than when using a wavelet with larger support. This example requires Signal Processing Toolbox.

Create a noisy square wave with 512 samples. Plot the square wave.

```n = 512; t = 0:0.001:(n*0.001)-0.001; yn = square(2*pi*10*t)+0.02*randn(size(t)); plot(yn) grid on title('Noisy Signal')```

Obtain the maximal overlap discrete wavelet transform (MODWT) of the signal using the `haar` wavelet. The `haar` wavelet has a support of length equal to 1

`modhaar = modwt(yn,'haar');`

Obtain the multiresolution analysis from the `haar` MODWT matrix and plot the first-level details.

```mrahaar = modwtmra(modhaar,'haar'); figure hs = stem(mrahaar(1,:)); grid on hs.Marker = 'none'; hs.ShowBaseLine = 'off'; title('First-Level MRA Details Using Haar Wavelet')```

Obtain the MODWT of the signal by using the `db4` wavelet. The `db4` wavelet has a support of length equal to 7.

`moddb4 = modwt(yn,'db4');`

Obtain the multiresolution analysis from the `db4` MODWT matrix and plot the first-level details. The discontinuities are represented less sparsely using the `db4` wavelet than the `haar` wavelet.

```mradb4 = modwtmra(modhaar,'db4'); figure hs = stem(mradb4(1,:)); grid on hs.Marker = 'none'; hs.ShowBaseLine = 'off'; title('First-Level MRA Details Using db4 Wavelet')```