function WACONV, f,x ;+ ; NAME: ; WACONV ; ; PURPOSE: ; This function performs a Convolution for Two-Scale Transform. ; ; CATEGORY: ; Wavelets ; ; CALLING SEQUENCE: ; y = WACONV(f,x) ; ; INPUTS: ; f: filter. ; x: 1-d signal. ; ; OUTPUTS: ; y: filtered result. ; ; NOTES: ; Filtering by periodic convolution of x with the ; time-reverse of f. ; ; EXAMPLE: ; ; SEE ALSO: ; wiconv, wupdydhi, wupdydlo, wdndydhi, wdndydlo ; ; MODIFICATION HISTORY: ; Written by: Amara Graps October, 1994 ;Translated from MatLab Wavelab routine: aconv.m ;- n = N_ELEMENTS(x) p = N_ELEMENTS(f) IF ( p LT n) THEN BEGIN xpadded = [x, x(0:p-1) ] ENDIF ELSE BEGIN z = FLTARR(p) FOR i=1,p DO BEGIN imod = 1 + WREM(i-1,n) z(i-1) = x(imod-1) END xpadded = [x,z] END fflip = REVERSE(f) ypadded = WMFILT(fflip,xpadded) y = ypadded(p-1:n+p-2) ; ; Algorithm Source: WaveLab Version 0.600 ; WaveLab WWW site: http://playfair.stanford.edu/ ; WaveLab Questions? e-mail wavelab@playfair.stanford.edu ; RETURN, y End ;***************************************************