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