Previous Next Contents Generated Index Doc Set Home



Two-Dimensional Convolution or Correlation

The subroutines described in this section compute the convolution or correlation of a filter with one or more input vectors.

Calling Sequence

CALL SCNVCOR2
(CNVCOR, METHOD, TRANSX, SCRATCHX, TRANSY, SCRATCHY, 
MX, NX, SX, LDX, MY, NY, MPRE, NPRE, SY, LDY, MZ, NZ, 
SZ, LDZ, SWORK, LWORK)
CALL DCNVCOR2
(CNVCOR, METHOD, TRANSX, SCRATCHX, TRANSY, SCRATCHY, 
MX, NX, DX, LDX, MY, NY, MPRE, NPRE, DY, LDY, MZ, NZ, 
DZ, LDZ, DWORK, LWORK)
CALL CCNVCOR2
(CNVCOR, METHOD, TRANSX, SCRATCHX, TRANSY, SCRATCHY, 
MX, NX, CX, LDX, MY, NY, MPRE, NPRE, CY, LDY, MZ, NZ, 
CZ, LDZ, CWORK, LWORK)
CALL ZCNVCOR2
(CNVCOR, METHOD, TRANSX, SCRATCHX, TRANSY, SCRATCHY, 
MX, NX, ZX, LDX, MY, NY, MPRE, NPRE, ZY, LDY, MZ, NZ, 
ZZ, LDZ, ZWORK, LWORK)






void scnvcor2
(char cnvcor, char method, char transx, char scratchx, 
char transy, char scratchy, int mx, int nx, float *sx, 
int ldx, int my, int ny, int mpre, int npre, float *sy, 
int ldy, int mz, int nz, float *sz, int ldz, float 
*swork, int lwork)
void dcnvcor2
(char cnvcor, char method, char transx, char scratchx, 
char transy, char scratchy, int mx, int nx, double *dx, 
int ldx, int my, int ny, int mpre, int npre, double 
*dy, int ldy, int mz, int nz, double *dz, int ldz, 
double *dwork, int lwork)
void ccnvcor2
(char cnvcor, char method, char transx, char scratchx, 
char transy, char scratchy, int mx, int nx, complex 
*cx, int ldx, int my, int ny, int mpre, int npre, 
complex *cy, int ldy, int mz, int nz, complex *cz, int 
ldz, complex *cwork, int lwork)
void zcnvcor2
(char cnvcor, char method, char transx, char scratchx, 
char transy, char scratchy, int mx, int nx, 
doublecomplex *zx, int ldx, int my, int ny, int mpre, 
int npre, doublecomplex *zy, int ldy, int mz, int nz, 
doublecomplex *zz, int ldz, doublecomplex *zwork, int 
lwork)

Arguments

CNVCOR

Indicates whether to perform convolution or correlation. The legal values for CNVCOR are listed below. Any values not listed below are illegal.

`V' or `v' Convolution

`R' or `r' Correlation

METHOD

Indicates which method to use to compute the convolution or correlation. The legal values for METHOD are listed below. Any values not listed below are illegal.

`T' or `t' Fourier transform

`D' or `d' Direct method

TRANSX

Indicates whether to use xX as it appears or to transpose it. The legal values for TRANSX are listed below. Any values not listed below are illegal.

`N' or `n' Do not transpose xX.

T' or `t' Transpose xX.

SCRATCHX

Indicates whether xX can be used as scratch space. If xX can be used as scratch space then the contents of xX are undefined on exit. The legal values for SCRATCHX are listed below. Any values not listed below are illegal.

`N' or `n' Do not use xX as scratch space.

T' or `t' It is allowed to use xX as scratch space.

TRANSY

Indicates whether to use xY as it appears or to transpose it. The legal values for TRANSY are listed below. Any values not listed below are illegal.

`N' or `n' Do not transpose xY.

T' or `t' Transpose xY.

SCRATCHY

Indicates whether xY can be used as scratch space. If xY can be used as scratch space then the contents of xY are undefined on exit. The legal values for SCRATCHY are listed below. Any values not listed below are illegal.

`N' or `n' Do not use xY as scratch space.

T' or `t' It is allowed to use xY as scratch space.

MX

On entry, the number of rows in the X filter. MX 0.

NX

On entry, the number of columns in the X filter. NX 0.

xX

On entry, the filter vector xX(LDX,*).

LDX

On entry, the leading dimension of the array containing the filter. LDX > 0.

MY

On entry, the number of rows in the Y array. MY 0.

NY

On entry, the number of columns in the Y array. NY 0.

MPRE

On entry, the number of implicit zeros prepended to each Y vector in the M dimension. MPRE 0.

NPRE

On entry, the number of implicit zeros prepended to each Y vector in the N dimension. NPRE 0.

xY

On entry, the leading dimension of the array containing the data. LDY > 0.

LDY

On entry, the leading dimension of the array containing the data. LDY > 0.

MZ

On entry, the number of rows in the output array. MZ 0.

NZ

On entry, the number of columns in the output array. NZ 0.

xZ

Undefined on entry. On exit, the output vectors Z(LDZ,*).

LDZ

On entry, the leading dimension of the output array. LDZ > 0.

xWORK

On entry, an array with dimension of at least (MX + NX + MY + NY + MZ + NZ + 90). For the Fourier method, the first element of the work array should be zero the first time the routines are called. After the first call, as long as the work array has not been altered and the values of NX, NY, and NZ are the same, the same work array can be reused and the routine will be able to run faster. If the work array is changed or is used for different values of NX, NY, or NZ then set the first element of xWORK to zero before calling this routine.

xLWORK

On entry, the length of xWORK.

Sample Program




      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           M, N
      PARAMETER        (M = 2)
      PARAMETER        (N = 3)
C
      INTEGER           I, J
      COMPLEX           P1(M,N), P2(M,N), P3(M,N)
C
      DATA P1 / 1, -2, 3, -4, 5, -6 /,  P2 / -1, 2, -3, 4, -5, 6 /
C
      EXTERNAL          CCNVCOR2
C
      PRINT *, `P1:'
      PRINT 1000, ((P1(I,J), J = 1, N), I = 1, M)
      PRINT *, `P2:'
      PRINT 1000, ((P2(I,J), J = 1, N), I = 1, M)
C
      CALL CCNVCOR2 (`V', `Direct', `No Transpose X', `No Overwrite 
X',
     $   `No Transpose Y', `No Overwrite Y', M, N, P1, M,
     $   M, N, 0, 0, P2, M, M, N, P3, M, 0, 0)
C
      PRINT *, `P3:'
      PRINT 1000, ((P3(I,J), J = 1, N), I = 1, M)
C
 1000 FORMAT (3(F5.1' +',F5.1,'i  `))
C
      END
      

Sample Output




 P1:
  1.0 +  0.0i    3.0 +  0.0i    5.0 +  0.0i  
 -2.0 +  0.0i   -4.0 +  0.0i   -6.0 +  0.0i  
 P2:
 -1.0 +  0.0i   -3.0 +  0.0i   -5.0 +  0.0i  
  2.0 +  0.0i    4.0 +  0.0i    6.0 +  0.0i  
 P3:
-83.0 +  0.0i  -83.0 +  0.0i  -59.0 +  0.0i  
 80.0 +  0.0i   80.0 +  0.0i   56.0 +  0.0i  
 




Previous Next Contents Generated Index Doc Set Home