Main Content

Visualizing Wavelets, Wavelet Packets, and Wavelet Filters

This example shows how to use wfilters, wavefun, and wpfun to obtain the filters, wavelet, or wavelet packets corresponding to a particular wavelet family. You can visualize 2-D separable wavelets with wavefun2.

Obtain the decomposition (analysis) and reconstruction (synthesis) filters for the biorthogonal spline wavelet filters with 3 vanishing moments in the reconstruction filter and 5 vanishing moments in the decomposition filter.

[LoD,HiD,LoR,HiR] = wfilters('bior3.5');
subplot(2,2,1)
stem(LoD,'markerfacecolor',[0 0 1]); title('Lowpass Decomposition Filter');
subplot(2,2,2)
stem(LoR,'markerfacecolor',[0 0 1]); title('Lowpass Reconstruction Filter');
subplot(2,2,3)
stem(HiD,'markerfacecolor',[0 0 1]); title('Highpass Decomposition Filter');
subplot(2,2,4)
stem(HiR,'markerfacecolor',[0 0 1]); title('Highpass Reconstruction Filter');

Figure contains 4 axes objects. Axes object 1 with title Lowpass Decomposition Filter contains an object of type stem. Axes object 2 with title Lowpass Reconstruction Filter contains an object of type stem. Axes object 3 with title Highpass Decomposition Filter contains an object of type stem. Axes object 4 with title Highpass Reconstruction Filter contains an object of type stem.

Visualize the real-valued Morlet wavelet. There is no associated scaling function.

figure
[psi,xval] = wavefun('morl');
plot(xval,psi,'linewidth',2)
title('$\psi(x) = e^{-x^2/2} \cos{(5x)}$','Interpreter','latex',...
     'fontsize',14);

Figure contains an axes object. The axes object with title psi leftParenthesis x rightParenthesis equals e toThePowerOf minus x Squared baseline slash 2 baseline cos leftParenthesis 5 x rightParenthesis contains an object of type line.

Obtain the first 4 wavelet packets for the Daubechies least-asymmetric wavelet with 4 vanishing moments, sym4.

[wpws,x] = wpfun('sym4',4,10);
for nn = 1:size(wpws,1)
    subplot(3,2,nn)
    plot(x,wpws(nn,:))
    axis tight
    title(['W',num2str(nn-1)]);
end

Figure contains 5 axes objects. Axes object 1 with title W0 contains an object of type line. Axes object 2 with title W1 contains an object of type line. Axes object 3 with title W2 contains an object of type line. Axes object 4 with title W3 contains an object of type line. Axes object 5 with title W4 contains an object of type line.

See Also

| | |