function plotbasisfuns(p,n) % FUNCTION: plotbasisfuns Part of DPWT Toolbox % % SYNOPSIS: plotbasisfuns(P,N) % % DESCRIPTION: Plot representative basis sequences for the DPWT % basis using a Daubechies wavelet filter of length 2*N % for sequences of length 2^P. The level number is printed % above each basis function. Only the first basis element % is shown for each level. % AUTHOR: Neil Getz % DATE: 3-30-94 if(nargin<2), help plotbasisfuns, return; end rows = floor(sqrt(p)); % how many plot rows cols = ceil(p/rows); % how many plot columns L = daubcofs(n); clg; % levels and shifts LS = [([-1:1:p-1]'),zeros(p+1,1)]; for i = 1:(rows*cols), lev = LS(i,1); % level sh = LS(i,2); % shift if(lev == -1), w = [1; zeros(2^p - 1,1)]; f = idpwt(w,L,0); else, w = putlevel(zeros(2^p,1), ([0:(2^lev - 1)]==sh), lev); f = idpwt(w,L,lev); end % Scale f to lie between -1 and 1 m = max(abs(f)); ff = f/m; subplot(rows,cols,i); plotperdisc(ff); title(sprintf('level %d',i-2)); drawnow end;