Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Wavelets and Vanishing Moments

This example shows how the number of vanishing moments can affect wavelet coefficients.

Create a signal defined over the interval . The signal is constant over the interval and quadratic over the interval . Plot the signal.

n = 1024;
x = linspace(0,2,n);
sig = zeros(1,n);
ind0 = (0<=x)&(x<1);
ind1 = (1<=x)&(x<=2);
sig(ind0) = 1;
sig(ind1) = x(ind1).^2;
plot(sig)
grid on
title('Signal')

Compute a single-level wavelet decomposition of the signal using the db1 wavelet. This wavelet has one vanishing moment. Plot the approximation coefficients and wavelet coefficients.

[a1,d1] = dwt(sig,'db1');
figure
subplot(2,1,1)
plot(a1)
grid on
title('Approximation Coefficients - db1')
subplot(2,1,2)
plot(d1)
grid on
title('Wavelet Coefficients - db1')

The wavelet coefficients corresponding with the constant portion of the signal are approximately 0. The magnitude of the wavelet coefficients corresponding with the quadratic portion of the signal are increasing. Because the db1 wavelet has one vanishing moment, the wavelet is not orthogonal to the quadratic portion of the signal.

Compute a single-level wavelet decomposition of the signal using the db3 wavelet. This wavelet has three vanishing moments. Plot the approximation coefficients and wavelet coefficients.

[a2,d2] = dwt(sig,'db3');
figure
subplot(2,1,1)
plot(a2)
grid on
title('Approximation Coefficients - db3')
subplot(2,1,2)
plot(d2)
grid on
title('Wavelet Coefficients - db3')

The wavelet coefficients corresponding with the constant portion of the signal are approximately 0. The spike in the middle corresponds to where the constant and quadratic pieces of the signal meet. The spike at the end is a boundary effect. The magnitude of the wavelet coefficients corresponding with the quadratic portion of the signal are approximately 0. Because the db3 wavelet has three vanishing moments, the wavelet is orthogonal to the quadratic part of the signal.

See Also

Was this topic helpful?