www.pudn.com > Upload_EZW128.zip > ANAL21.M


function an = anal21(data,lpf,hpf) 
%anal21(data,lpf,hpf) decomposes the input matrix, data, into 
%four subbands using filters lpf and hpf. This is a one level  
%decomposition. Orthonormal filter banks used with circular extension. 
% 
%This routine is used by the routine, anal2d for 2-D wavelet  
%decomposition.  
% 
%Author: Ajit S. Bopardikar 
%Copyright (c) 1998 by Addison Wesley Longman, Inc. 
% 
  l = length(lpf); 
  [m,n] = size(data); 
 
  ext = [data data(:,1:l)]; %circular extension of rows 
 
  ll = conv2(ext,lpf); % Low pass filtering of rows 
  hh = conv2(ext,hpf); % High pass filtering of rows 
 
  ll = ll(:, l:2:(l+n-1)); %choose the circular convolved part 
  hh = hh(:, l:2:(l+n-1)); %and downsample by two. 
 
  anr = [ll hh]'; %the row convolutions are done. 
    
  ext = [anr anr(:,1:l)]; %circular extension of columns 
 
  ll = conv2(ext,lpf); % Low pass filtering of columns 
  hh = conv2(ext,hpf); % High pass filtering of columns 
 
  ll = ll(:, l:2:(l+m-1)); %choose the circular convolved part 
  hh = hh(:, l:2:(l+m-1)); %and downsample by two. 
 
  an = [ll,hh]'; %One level of subband decomposition done.