function WPSYNTH, basis,pkt,qmf ;+ ; NAME: ; WPSYNTH ; ; PURPOSE: ; This function synthesize a signal from wavelet packet coefficients. ; ; CATEGORY: ; Wavelets. ; ; CALLING SEQUENCE: ; x = WPSYNTH(basis,wp,qmf) ; ; INPUTS: ; basis = basis tree indicating wavelet packet to use ; wp = wavelet packet table ; qmf = quadrature mirror filter ; ; OUTPUTS: ; x = 1-d signal whose wavelet packet coefft's in ; basis btree are in wp ; ; SEE ALSO: ; wintwave (necessary for this procedure to get QMF) ; wpanalys, wpdnoise, wdndydhi, wdndydlo ; ;REFERENCE: ;title = {Signal processing and compression with wavelet packets}, ;author = {R.R. Coifman and Y. Meyer and S. Quake and M.V. Wickerhauser}, ;booktitle = {Progress in wavelet analysis and applications, ; Proceedings of the International Conference "Wavelets and ; Applications", Toulouse, 1992}, ;editor = {Y. Meyer and S. Roques}, ;publisher = {Editions Frontieres}, ;year = 1993, ;pages = {77-93} ; ; MODIFICATION HISTORY: ; Written by: Amara Graps September, 1995 ;Translated from MatLab Wavelab routine: wpsynthesis.m ;- tt = SIZE(pkt) L = tt(1) ;number of columns n = tt(2) ;number of rows wp = pkt ; ; initialize tree traversal stack ; stack = FLTARR(2^L, 3) k = 1 stack(k-1, *) = TRANSPOSE([0,0,0]) ; WHILE (k GT 0) DO BEGIN d = stack(k-1, 0) b = stack(k-1, 1) marked = stack(k-1, 2) k=k-1 IF ((basis(WNODE(d,b)-1) NE 0) ) THEN BEGIN ; nonterwmminal node IF (marked EQ 0) THEN BEGIN k = k+1 stack(k-1, *) = TRANSPOSE([d,b,1]) k = k+1 stack(k-1, *) = TRANSPOSE([(d+1), (2*b), 0]) k = k+1 stack(k-1, *) = TRANSPOSE([(d+1), (2*b+1), 0]) ENDIF ELSE BEGIN lson = WREM(b,2) lpchan = TRANSPOSE( wp(d+1, WPACKET(d+1,2*b+lson ,n))) hpchan = TRANSPOSE( wp(d+1, WPACKET(d+1,2*b+(1-lson),n))) s = WUPDYDHI(hpchan,qmf) + WUPDYDLO(lpchan,qmf) wp(d,WPACKET(d,b,n)) = TRANSPOSE(s) END ;endif END ;if basis END ;while x = TRANSPOSE( wp(0, *)) ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; RETURN, x END ;***************************************************