Z — Vector of length NZ containing the convolution Z = X*Y. (Output)
Optional Arguments
NX — Length of the vector X. (Input) Default: NX = SIZE (X,1).
NY — Length of the vector Y. (Input) Default: NY = SIZE (Y,1).
NZ — Length of the vector Z. (Input) NZ must be at least NX + NY 1. Default: NZ = SIZE (Z,1).
FORTRAN 90 Interface
Generic: CALLVCONR (X, Y, Z[, …])
Specific: The specific interface names are S_VCONR and D_VCONR.
FORTRAN 77 Interface
Single: CALLVCONR (NX, X, NY, Y, NZ, Z)
Double: The double precision name is DVCONR.
Description
The routine VCONR computes the convolution z of two real vectors x and y. Let nx = NX, ny = NY and nz = NZ. The vector z is defined to be
where nz = nx + ny‑ 1. If the index j‑k + 1 is outside the range 1, 2, …, nx, then xj‑ k+ 1 is taken to be zero.
The fast Fourier transform is used to compute the convolution. Define the complex vector u of length nz = nx + ny‑ 1 to be
The complex vector v, also of length nz, is defined similarly using y. Then, by the Fourier convolution theorem,
where the indicates the Fourier transform of u computed via IMSL routines FFTCF and FFTCB (see Chapter 6, “Transforms”) is used to compute the complex vector w from . The vector z is then found by taking the real part of the vector w.
Comments
Workspace may be explicitly provided, if desired, by use of V2ONR/DV2ONR. The reference is
WK — Real work array of length 6 * (NX + NY‑ 1) + 15.
Example
In this example, the convolution of a vector x of length 8 and a vector y of length 3 is computed. The resulting vector z is of length 8 + 3 ‑ 1 = 10. (The vector y is sometimes called a filter.)