HP MLIB User's Guide Vol. 2 7th Ed.

598 HP MLIB User’s Guide
SCONV/DCONV Correlation and convolution
Example 2 Compute the complete discrete convolution of the REAL*4 vectors x = (1, 3, 5)
and w = (2, 1) stored in arrays X and W, respectively. To get the complete
convolution, append n1 = 1 zeros to each end of x, getting .
Then, you have n = 2 and m+n1 = 5, so m =4.
INTEGER*4 INCX,INCW,INCY,M,N
REAL*4 X(5),W(2),Y(4)
DATA X / 0.0 , 1.0 , 3.0 , 5.0, 0.0 /
DATA W / 2.0 , 1.0 /
M = 4
N = 2
INCX = 1
INCW = -1
INCY = 1
CALL SCONV (X,INCX,W(N),INCW,Y,INCY,M,N)
The result is y = (2, 7, 13, 5).
x (0, 1, 3, 5, 0)=