pro WPLWCOEF, wc,L,scal,signaltitle ;+ ; NAME: ; WPLWCOEF ; ; PURPOSE: ; This procedure plots a spike-plot display of wavelet coefficients. ; ; CATEGORY: ; Wavelets ; ; CALLING SEQUENCE: ; WPLWCOEF,wc,L,scal,signaltitle ; ; INPUTS: ; wc: 1-d wavelet transform ; L: level of coarsest scale ; scal: scale factor [0 ==> autoscale] ; signaltitle: title for plot ; ; OUTPUTS: ; A display of wavelet coefficients ; (coarsest level NOT included) by level and position. ; ; SEE ALSO: ; wplmlres, wfwtpo, wiwtpo, wplspike ; ;Note: L controls the lowest resolution level. ;The lowest resolution level will be L out of log_2(n). ;For example if L=0, the lowest resolution level with have 2^L+1 ;element in it, which will represent the overall average. ;We often use L=3. ; ; MODIFICATION HISTORY: ; Written by: Amara Graps November, 1994 ;Translated from MatLab Wavelab routine: plotwavecoeff.m ;- ;Color of text strings IF !p.background EQ 0 THEN cl = 255 ELSE cl = 0 wavecoef = WSHASROW(wc) n = WDYADLNG(wavecoef,J) IF ( scal eq 0) THEN BEGIN scal = 1. / MAX(ABS(wavecoef(2^L : n-1))) !C = 0 END WLCKAXES, [ 0, 1, (-J), (-L+1)] FOR jj=(J-1), L, -1 DO BEGIN ;use the IDL way to create a fractional index array a = .5 & b = 1 & c = fix(2^(jj)) tj = (WMKFARRY( a, b, c))/2^(jj) ;If first time, we want the plot, otherwise, we want an oplot CASE 1 OF jj EQ (J-1): First = 'True' ELSE: First = 'False' ENDCASE WPLSPIKE,-jj,tj,(wavecoef(WDYAD(jj)-1)*scal), First, signaltitle END WULKAXES ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; End ;***************************************************