# Convolve and correlate with no assumptions off end of data. # subroutine convin( conj, add, nx, xx, nb, bb, yy) integer ib, iy,ny, conj, add, nx, nb real xx(nx) # input signal real bb(nb) # filter (or output crosscorrelation) real yy(nx-nb+1) # filtered signal (or second input signal) ny = nx - nb + 1 # length of filtered signal if( ny < 1 ) call erexit('convin() filter output negative length.') call conjnull( conj, add, bb, nb, yy, ny) if( conj == 0 ) do iy= 1, ny { do ib= 1, nb { yy( iy) = yy( iy) + bb(ib) * xx( iy-ib+nb) }} else do ib= 1, nb { do iy= 1, ny { bb( ib) = bb( ib) + yy(iy) * xx( iy-ib+nb) }} return; end