%% dwtmatrix.m
% usage: Y = dwtmatrix(N,lev,la,ha) 
% Compute the matrix for the multilevel DWT linear map 
% N = length of finite signal
% lev number of levels of the DWT
% la = low pass analysis filter
% ha = high pass analysis filter
% la and ha must have the same length
% the periodic transform is used 
% N must be divisible by 2^lev
% uses the wavelet tool box

% S. Allen Broughton - 12 Nov 2010

function W=dwtmatrix(N,lev,la,ha)
dwtmode('per')
E = eye(N); 
W = zeros(N,N);
 for  j = 1:N 
  W(:,j) = wavedec(E(:,j),lev,la,ha);
 end 
   
  
                   
