function WCALCSCG, sig, QMF ;+ ; NAME: ; WCALCSCG ; ; PURPOSE: ; This procedure calculates a scalegram. The scalegram is ; the wavelet analog of the power spectrum. It is just the (squared) ; wavelet coefficient averaged over all location index values at a ; fixed value of the scale index. The sums of squares --> scalegram ; flat if input = white noise ; ; CATEGORY: ; Wavelets. ; ; CALLING SEQUENCE: ; sg = WCALCSCG(sig, QMF) ; ; INPUTS: ; sig: 1-d signal array ; QMF: Quadrature Mirror Filter ; ; OUTPUTS: ; sg: scalegram. ; ; EXAMPLE: ; Truncate sig array appropriately and get QMF ; IDL> WINTWAVE, sig, WaveType, ParVal, QMF, LD ; Call scalegram ; IDL> sg = WCALCSCG(sig, QMF) ; ; ; MODIFICATION HISTORY: ; Written by: Amara Graps February 1996 ;- ndum = WDYADLNG(QMF,L) ;Get dyadic L from Quadrature Mirror Filter nx = WDYADLNG(sig,J) ;Get dyadic J from signal array sg = FLTARR(J-1) ;Initialize scalegram array L_use = L - 1 IF ( L_use lt 1) THEN L_use = 1 ;Calculate Periodized Orthononormal Fast Wavelet Transform wc = WFWTPO(sig, L_use, QMF ) FOR i = L, J-1 DO BEGIN sg(i-L) = WMEAN( (wc(WDYAD(i)-1))^2) ;place the wavelet coeffs into sg END sg = REVERSE( sg ) RETURN, sg END