pro WDODWT, x_work, QMF, LD, st, plotwin, wc ;+ ; NAME: ; WDODWT ; ; PURPOSE: ; This procedure performs a discrete wavelet transform and plots the coefficients. ; ; CATEGORY: ; Wavelets. ; ; CALLING SEQUENCE: ; ; WDODWT, X_work, QMF, LD, plotwin, wc ; ; INPUTS: ; X_work: 1-d signal array ; QMF: Quadrature Mirror Filter ; LD: lowest resolution level ; st: signal title ; plotwin: plot window to plot into ; ; OUTPUTS: ; wc = the array of wavelet coefficients ; The discrete wavelet transform coeffs plotted to the screen. ; ; ; SEE ALSO: ; wintwave (necessary for this procedure to get QMF) ; ; EXAMPLE: ; Truncate sig array appropriately and get QMF ; IDL> WINTWAVE, sig, WaveType, ParVal, QMF, LD ; Calculate Discrete Wavelet Transform ; IDL> WDODWT, sig, QMF, LD, st, 3, wc ; ; MODIFICATION HISTORY: ; Written by: Amara Graps August/September, 1995 ;- signaltitle = 'WT of ' + st TT = WSIGTYPE(x_work, len, error) ;Color of text strings IF !p.background EQ 0 THEN cl = 255 ELSE cl = 0 CASE error OF 1: BEGIN ;Valid array or matrix CASE TT OF 'I': BEGIN ;Image ;Get wavelet transform coeffs wc = WFWT2PO(x_work,LD,QMF) WPLOTIT, signaltitle, 10, ABS(wc) END ;image 'S': BEGIN ;Signal spiketitle = 'WT (Dyadic coeffs) of ' + st ;Get wavelet transform coeffs wc = WFWTPO(x_work,LD,QMF) ;Set up the plot window ;pt and d are dummy values pt = '' & d = fltarr(2) WPLOTIT, pt, plotwin, d ;Stack two plots vertically on the page !p.multi = [0, 1, 2] ;Plot the coeffs in a spike plot for each of the dyads WPLWCOEF,wc,LD,0., spiketitle ;Plot the coefficients in bottom plot PLOT, wc, title = signaltitle, ystyle = 1, color = cl !p.multi = 0 ;reset to no multiple plots END ;signal/data array ENDCASE ;TT END ;valid array or matrix ELSE: PRINT, 'Not valid data/signal array or matrix!' ENDCASE ;error END ;of pro WDODWT ;***************************************************