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

594 HP MLIB User’s Guide
Subprograms for correlations and convolutions Correlation and convolution
Subprograms for correlations and convolutions
The following sections describe subprograms included with VECLIB for
correlations and convolutions.
Name SCONV/DCONV
Correlation and convolution
Purpose These subprograms compute the fully engaged portion of the discrete
correlation or discrete convolution of two real data sequences. They can be used
to compute the complete discrete correlation or convolution (the fully engaged
portion plus the tails) by appending zeros to the ends of the longer of the
operand vectors. Refer to “Example 2” on page 598.
If x
i
, i = 1, 2, ..., l and w
j
, j = 1, 2, ..., n are two data sequences, their
discrete correlation y
k
is defined by
for k = n+1, n+2, ..., l1, where the sum is taken over all indices i for which
both x
k+i−1
and w
i
are defined.
If x
i
, i = 1, 2, ..., l and w
j
, j = 1, 2, ..., n are two data sequences, their
discrete convolution z
k
is defined by
for k = 1, 2, ..., l+n1, where the sum is taken over all indices i for which both
x
ki+1
and w
i
are defined.
These subprograms compute only the fully engaged portion of the correlation or
convolution, that is, the part where the sums have exactly min(l,n) terms.
Hence, if l n, they compute
for k = 1, 2, ..., m, where m = l n +1. This is the correlation operation if w is
stored or indexed in the same direction as x and is the convolution operation if x
and w are stored or indexed in opposite directions.
y
k
x
ki1+
w
i
,
i
=
z
k
x
ki1+
w
i
,
i
=
y
˜
k
x
ki1+
w
i
,
i 1=
n
=