% fbsyn2.m
% usage: Y = fbsyn2(X,l,h,s) 
% Performs an s-stage 2D inverse (logarithmic) DWT transform on X. (synthesis filterbank)
% It is assumed that l and h are smaller than #rows(X)/2^s and #cols(X)/2^s
% and that 2^s divides #rows(X) and #cols(X)
% time reversals of the masks l and h are used

function Y=fbsyn2(X,l,h,s)
  [m,n] = size(X);
  Y = X;
  for  r =  (s-1):(-1):0
     mr = m/2^(r); 
     nr = n/2^(r); 
     Y(1:mr,1:nr) = hilosyn2(Y(1:mr,1:nr),l,h,l,h);
     end;
    

                   
