; ;---------------------------------------------------------------- ; PV-WAVE: Signal Processing Toolkit | ; Copyright (C) 1994, Visual Numerics, Inc. | ; All rights reserved. Unauthorized reproduction prohibited. | ;---------------------------------------------------------------- ; FUNCTION PARSEWAVELET, wstruct, inn ; ; $Id: parsewavelet.pro,v 1.4 2005/08/26 23:55:59 allanw Exp $ ; ;+ ; Name: ; PARSEWAVELET ; Purpose: ; Pulls output signals out of the wavelet structure ; Category: ; Signal Processing ; Calling Sequence: ; result = PARSEWAVELET(waveletstruct, n) ; Inputs: ; waveletstruct = the output of the forward transform ; n = the "simplified" index of the output desired ; Keyword parameters: ; None ; Outputs: ; This function returns a double precision vector which cor- ; responds to the signal at the output of stage 'n'. ; Common blocks: ; sigpro_common ; Side effects: ; None ; Restrictions: ; n must be between 1 and (number of QMFs + 1), inclusive. ; Procedure: ; This is just a convenience routine to provide an easy way ; to get data back out of the wavelet structure. In this version ; of the software, there is no wavelet packet analysis, so only ; the top 'branch' of the wavelet tree is calculated (see the ; reference page on WAVELET). The 'n' passed into PARSEWAVELET ; is the number of the stage to retrieve the output from. If ; n is one greater than the number of stages, then the terminal ; output (the lowpass output of the last stage) is passed back. ;- ; @sigpro_common ; n = LONG(inn) nstages = N_TAGS(wstruct) - 2 IF n GT nstages+1 THEN MESSAGE, $ '(n-1) must be less than or equal to the number of QMF stages.' IF n LE 0 THEN MESSAGE, $ 'n must be greater than 0.' ; IF n EQ nstages+1 THEN BEGIN ; ; This is the last lowpass output. ; status = EXECUTE(STRCOMPRESS('result = wstruct.hminus' + $ STRING(2l^(n-1) - 1), /Remove_All)) ENDIF ELSE BEGIN ; ; This is one of the lowpass outputs along the way. ; status = EXECUTE(STRCOMPRESS('result = wstruct.hminus' + $ STRING(2l^n - 2), /Remove_All)) ENDELSE RETURN, result END