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. Axes 1 with title Lowpass Decomposition Filter contains an object of type stem. Axes 2 with title Lowpass Reconstruction Filter contains an object of type stem. Axes 3 with title Highpass Decomposition Filter contains an object of type stem. Axes 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. The axes with title $\psi(x) = e^{-x^2/2} \cos{(5x)}$ 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. Axes 1 with title W0 contains an object of type line. Axes 2 with title W1 contains an object of type line. Axes 3 with title W2 contains an object of type line. Axes 4 with title W3 contains an object of type line. Axes 5 with title W4 contains an object of type line.

See Also

| | |