% set up parameters 

N   = 64;
lev = 4;

[la,ha] = wfilters('db3')
%la = [1,1,1,1]/4; ha = [-2,3,-1,2]/8; 

% set up synthesis ulters
lan = la(:)'*la(:); ls=la/lan;, 
han = ha(:)'*ha(:); hs=ha/han;, 

%Compute transform matrix
W   = fbanlcol(eye(N),la,ha,lev);

%Compute inverse transform matrix
Wi = inv(W); % works for non-othogonal case
%Wi   = fbsyncol(eye(N),ls,hs,lev);

mx  = max(W(:));
mn  = min(W(:));
mxi  = max(Wi(:));
mni  = min(Wi(:));

figure(1) 
for i = 1:N
   D =W;
   D(i,:)= mn*ones(1,N);
   subplot(2,2,1)
   imshow(D,[]); 
   title('Analysis matrix')
   subplot(2,2,2)
   plot(1:N,W(i,:));
   axis([1,N,mn,mx]);
   title('Analysis waveform')
   
   D=Wi;  
   D(:,i)= mni*ones(N,1);
   subplot(2,2,3)
   imshow(D,[]); 
   title('Synthesis matrix')
   subplot(2,2,4)
   plot(1:N,Wi(:,i));
   axis([1,N,mni,mxi]);
   title('Synthesis waveform')

   drawnow;
   pause(1)
   end;




