pro WPLPKTBL, pkt,scal,st ;+ ; NAME: ; WPLPKTBL ; ; PURPOSE: ; This procedure display entries in wavelet and cosine packet tables. ; ; CATEGORY: ; Wavelets. ; ; CALLING SEQUENCE: ; ; WPLPKTBL, pkt,scal,signaltitle ; ; INPUTS: ; pkt wavelet or cosine packet table ; scal optional scaling factor (0 =gt autoscale) ; st = title of signal or dataset ; ; OUTPUTS: ; spike plot of coefficients in packet table ; ; SEE ALSO: ; wintwave (necessary for this procedure to get QMF), ; wpanalys, wpsynth, wdndydhi, wdndydlo ; ; MODIFICATION HISTORY: ; Written by: Amara Graps August, 1995 ;Translated from MatLab Wavelab routine: plotpackettable.m ;- ;Color of text strings IF !p.background EQ 0 THEN cl = 255 ELSE cl = 0 ss = SIZE(pkt) L = ss(1) ;number of columns n = ss(2) ;number of rows D = L-1 WLCKAXES, [0, 1, (-D-1), (1)] ;use the IDL way to create a fractional array a = .5 & b = 1 & c = (n-.5) t = (WMKFARRY( a, b, c) )/n tt = FLTARR(3*n+2) nxx = N_ELEMENTS(tt) tt(0) = 0 tt(nxx-1)=1 ;use the IDL way to create an index array a = 2 & b = 3 & c = nxx- 3 indx = WMKIARRY( a, b, c) tt(indx) = t a = 3 & b = 3 & c = nxx- 2 indx = WMKIARRY( a, b, c) tt(indx) = t a = 4 & b = 3 & c = nxx- 1 indx = WMKIARRY( a, b, c) tt(indx) = t xx = FLTARR(nxx)+1.0 ; signaltitle = 'Wavelet Packet Decomposition of '+ st ytitle = 'Split Level' xtitle = 'Frequency' FOR dd=0, D DO BEGIN IF ((scal eq 0)) THEN BEGIN mult = .5 / MAX(ABS(pkt(dd, *))) ENDIF ELSE BEGIN mult = scal END ; xx = xx-1 a=3 & b=3 & c=nxx-2 indx = WMKIARRY( a, b, c) xx(indx) = -dd + pkt(dd, *) * mult CASE 1 OF dd EQ 0: PLOT, tt, xx, title=signaltitle, xtitle=xtitle,ytitle=ytitle,/noerase, $ color = cl ELSE: OPLOT, tt, xx, color = cl ENDCASE ; nbox = 2^dd FOR b=0, (nbox-1) DO BEGIN OPLOT, [ b/float(nbox), (b+1)/FLOAT(nbox), (b+1)/FLOAT(nbox), b/FLOAT(nbox)] , $ [-dd-.5,-dd-.5,-dd+.5,-dd+.5], linestyle = 1, color = cl END ;for END ;for WULKAXES ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; END ;***************************************************