pro WDOWPA ;+ ; NAME: ; WDOWPA ; ; PURPOSE: ; This procedure performs a wave packet analysis ; of the data or signal. ; ; CATEGORY: ; Wavelets. ; ; CALLING SEQUENCE: ; WDOWPA ; ; INPUTS: (via COMMON) ; sig: 1-d signal array ; QMF: Quadrature Mirror Filter ; st: signal title ; ; OUTPUTS: ; A wavelet packet decomposition, an entropy drop tree, ; and a phase plane all plotted to the screen in different ; windows. ; ; COMMON BLOCKS: ; COMMON WWB_COMMON, $ ; TEXT_ANNOUNCE, wd, sig, len, st, noise_type, noise_lev, $ ; QMF, LD, shrinkage_type, WaveType, ParVal ; ; ; SEE ALSO: ; wintwave (necessary for this procedure to get QMF) ; ; EXAMPLE: ; ; IDL> ;Truncate sig array appropriately and get QMF ; IDL> WINTWAVE, sig, WaveType, ParVal, QMF, LD ; IDL> ;Call Wavelet Packet Analysis ; IDL> WDOWPA ; ; MODIFICATION HISTORY: ; Written by: Amara Graps August/Sepember, 1995 ;- COMMON WWB_COMMON, $ TEXT_ANNOUNCE, wd, sig, len, st, noise_type, noise_lev, $ QMF, LD, shrinkage_type, WaveType, ParVal x_work = sig TT = WSIGTYPE(x_work, olen, error) CASE error OF 1: BEGIN ;Valid array or matrix CASE TT OF 'I': BEGIN ;Image WIDGET_CONTROL, TEXT_ANNOUNCE, SET_VALUE='WPA Not Implemented for 2D Data.' END ;image 'S': BEGIN ;Signal ;-------------------------------------------- ;Calculate Wavelet Packet Coefficients ;-------------------------------------------- Dsplit = 6 ;fineness of the frequency splitting wp = WPANALYS(x_work,Dsplit,QMF) ;Set up the plot window ;pt and d are dummy values pt = '' & d = fltarr(2) WPLOTIT, pt, 3, d ;-------------------------------------------- ;Do Packet Table plot ;-------------------------------------------- WPLPKTBL, wp,0,st ;-------------------------------------------- ;Calculate Entropy and Find Best Basis ;-------------------------------------------- Entropy = 'Entropy' ;First figure the parameter value based on entropy type. ;Note, WaveLab uses mostly the Entropy='Entropy' ;(of Coifman & Wickerhauser) switch. I found the following ;values for the parameter for the other Entropy calculations. ;I know very little about the differences between these. The ;Stanford WaveLab group should be referred to for questions ;about the different entropy calculations. (AG) CASE Entropy OF 'Entropy': ent_par = 0. 'l^p': ent_par = 1 'N(eps)': ent_par = 1 'Risk': ent_par = 1 ;namp 'SURE': ent_par = 1 ;namp ENDCASE stree = WSTATREE(wp,Entropy,ent_par) btree = WBBASIS(stree,Dsplit,vtree) ;DO MORE TESTING! ;WaveLab gives: best basis 3.46742 for Doppler signal ;This gives: Best basis 3.11047 for Doppler signal ;-------------------------------------------- ;Do Entropy Drop Tree and Phase Plots ;-------------------------------------------- ;Set up the plot window ;pt and d are dummy values pt = '' & d = FLTARR(2) WPLOTIT, pt, 4, d WPLBTREE, btree,Dsplit,stree,st ;Set up the plot window ;pt and d are dummy values pt = '' & d = fltarr(2) WPLOTIT, pt, 5, d WPHPLANE,'WP',btree,wp,titlestr=st, nTFR = 64 END ;signal/data array ENDCASE ;TT END ;valid array or matrix ELSE: PRINT, 'Not valid data/signal array or matrix!' ENDCASE ;error ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu End ;of pro WDOWPA ;***************************************************