function WPIPULSE, wp,d,b,k,qmf ;+ ; NAME: ; WPIPULSE ; ; PURPOSE: ; This function calculates location of wavelet packet entry. ; ; CATEGORY: ; Wavelets. ; ; CALLING SEQUENCE: ; ; dwp = WPIPULSE(wp,d,b,k,qmf) ; ; INPUTS: ; wp = packet table, ignored except for size ; d,b,k = 1-d packet-index ; qmf = quadrature mirror filter ; ; OUTPUTS: ; dwp = packet table -- complete wavelet packet analysis of ; wavelet packet (d,b,k) ; ; MODIFICATION HISTORY: ; Written by: Amara Graps November, 1995 ;Translated from MatLab Wavelab routine: wpimpulse.m ;- tt = SIZE(wp) L = tt(1) ;number of columns n = tt(2) ;number of rows DD = L-1 dwp = FLTARR(DD+1,n) dwp(d, b * (n/2^d) + k) = 1 IF (d LT DD) THEN BEGIN blo = b bhi = blo+1 FOR dl=d, (DD-1) DO BEGIN FOR bi=blo, (bhi-1) DO BEGIN x = TRANSPOSE( dwp(dl, WPACKET(dl,bi,n))) xl = WDNDYDLO(x,qmf) xh = WDNDYDHI(x,qmf) lson = WREM(bi,2) dwp(dl+1, WPACKET(dl+1,2*bi + lson,n)) = TRANSPOSE(xl) dwp(dl+1, WPACKET(dl+1,2*bi + 1-lson,n)) = TRANSPOSE(xh) END ;FOR blo = 2*blo bhi = 2*bhi END ;FOR END ;IF ; IF (d GT 0) THEN BEGIN xl = TRANSPOSE( dwp(d, WPACKET(d,b,n))) bi = b FOR dl=(d-1), 0, -1 DO BEGIN bparent = FLOOR(bi/2) upchan = WREM(WREM(bparent,2) + WREM(bi,2),2) IF upchan THEN BEGIN xl = WUPDYDHI(xl,qmf) ELSE xl = WUPDYDLO(xl,qmf) END dwp(dl, WPACKET(dl,bparent,n)) = TRANSPOSE(xl) bi = bparent END ;FOR END :IF ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; RETURN, dwp END ;***************************************************