function f = idpwt(w,l,level) % FUNCTION: idpwt Part of the DPWT Toolbox % % SYNOPSIS: F = idpwt(W,L [,LEVEL]) % % DESCRIPTION: This is the inverse discrete periodic % wavelet transform using filter L. The % wavelet coefficient vector is assumed % to be the product of a DPWT decomposition % down to level LEVEL. The output % vector F is the same size as W whose % size should be an integer power of 2. Wavelet % coefficient vector W should have structure, % W = [flevel, wlevel, ...w(p-1), wp] % where flevel and wlevel are the row vectors % that are the level LEVEL decomposition % products of the DPWT applied to a sequence fp. % % This routine does some argument testing and calculations % which are then passed on to the recursive function % r_idpwt which actually implements the IDPWT. % % The length of W must be an integer power of 2. % Filter sequence L is not checked for satisfaction of % perfect reconstruction criteria. It must be of even % length. % % SEE ALSO: r_dpwt, idpwt, r_idpwt % % REFERENCE: N. Getz, "A Fast Discrete Periodic Wavelet Transform", % Electronics Research Laboratory, U.C. Berkeley, 1992. % % AUTHOR: Neil Getz % % ORGANIZATION: University of California % Department of Electrical Engineering % and the Electronics Research Laboratory % Cory Hall % Berkeley, CA 94720 % % DATE: 12-11-92 % % Argument checking. % if(nargin < 2 | nargin > 3), help idpwt; return; end; p = log(length(w))/log(2); N = length(l)/2; if(round(N) ~= N), error('Length of arg 2 must be an even integer.') elseif(p ~= round(p)), error('Length of arg 1 must be an integer power of 2.') elseif(nargin == 3), if((level > p)|(level < 0)) error('Level (arg 3) must not be greater than log2 of length of arg 1.') end end % MATSHIFT = 1; % Matlab indices start at 1, not 0. % Conjugate filter calculation % h = l; % For length. for k = 0:2*N-1, h( MATSHIFT + k ) = (-1)^( MATSHIFT + k ) * l(MATSHIFT + 2*N - 1 - k); end % % If level is not specified then go all the way. if (nargin == 2), level = 0; end % % The beef f = r_idpwt(w, l, h, level); % END idpwt().