module helicon { # Convolution, inverse to deconvolution. # Requires the filter be causal with an implicit "1." at the onset. use helix type( filter) :: aa #% _init( aa) #% _lop ( xx, yy) integer iy, ix, ia if( adj) # zero lag xx += yy else yy += xx do ia = 1, size( aa%lag) { do iy = 1 + aa%lag( ia), size( yy) { if( associated( aa%mis)) { if( aa%mis( iy)) cycle} ix = iy - aa%lag( ia) if( adj) xx(ix) += yy(iy) * aa%flt(ia) else yy(iy) += xx(ix) * aa%flt(ia) } } }