function x = iWaveletTransform(wc,qmf)
% iWaveletTransform -- Inverse 2-d MRA wavelet transform (periodized, orthogonal)
% Assumes the Symmlet wavelet, if no other wavelet is specified.
%  Usage
%    x = iWaveletTransform(wc,qmf)
%  Inputs
%    wc    2-d wavelet transform [n by n array, n dyadic]
%    qmf   quadrature mirror filter
%  Outputs
%    x     2-d signal reconstructed from wc
%
%  Description
%    If wc is the result of a forward 2d wavelet transform, with
%    wc = WaveletTransform(x,qmf), then x = iWaveletTransform(wc,qmf) reconstructs x
%    exactly if qmf is a nice qmf, e.g. one made by MakeONFilter.
%
%  See Also
%    WaveletTransform, MakeONFilter
%
    L = 0;
    if (nargin == 1)
        qmf = [
               0.00188995033290
              -0.00030292051455
              -0.01495225833679
               0.00380875201406
               0.04913717967348
              -0.02721902991681
              -0.05194583810788
               0.36444189483596
               0.77718575169975
               0.48135965125920
              -0.06127335906791
              -0.14329423835105
               0.00760748732528
               0.03169508781035
              -0.00054213233164
              -0.00338241595136
		]';
	end
    
	[n,J] = quadlength(wc);
	x = wc; 
	nc = 2^(L+1);
	for jscal=L:J-1,
		top = (nc/2+1):nc; bot = 1:(nc/2); all = 1:nc;
		for iy=1:nc,
			x(all,iy) =  UpDyadLo(x(bot,iy)',qmf)'  ...
					   + UpDyadHi(x(top,iy)',qmf)'; 
		end
		for ix=1:nc,
			x(ix,all) = UpDyadLo(x(ix,bot),qmf)  ... 
					  + UpDyadHi(x(ix,top),qmf);
		end
		nc = 2*nc;
	end
	
%
% Copyright (c) 1993. David L. Donoho
%     
    
    
%   
% Part of WaveLab Version 802
% Built Sunday, October 3, 1999 8:52:27 AM
% This is Copyrighted Material
% For Copying permissions see COPYING.m
% Comments? e-mail wavelab@stat.stanford.edu
%   
    
