nag_dwt_2d (c09eac) computes the two-dimensional discrete wavelet transform (DWT) at a single level. The initialization function
nag_wfilt_2d (c09abc) must be called first to set up the DWT options.
nag_dwt_2d (c09eac) computes the two-dimensional DWT of a given input data array, considered as a matrix
, at a single level. For a chosen wavelet filter pair, the output coefficients are obtained by applying convolution and downsampling by two to the input,
, first over columns and then to the result over rows. The matrix of approximation (or smooth) coefficients,
, is produced by the low pass filter over columns and rows; the matrix of horizontal coefficients,
, is produced by the high pass filter over columns and the low pass filter over rows; the matrix of vertical coefficients,
, is produced by the low pass filter over columns and the high pass filter over rows; and the matrix of diagonal coefficients,
, is produced by the high pass filter over columns and rows. To reduce distortion effects at the ends of the data array, several end extension methods are commonly used. Those provided are: periodic or circular convolution end extension, half-point symmetric end extension, whole-point symmetric end extension and zero end extension. The total number,
, of coefficients computed for
,
,
, and
together and the number of columns of each coefficients matrix,
, are returned by the initialization function
nag_wfilt_2d (c09abc). These values can be used to calculate the number of rows of each coefficients matrix,
, using the formula
.
- 1:
m – IntegerInput
On entry: number of rows, , of data matrix .
Constraint:
this must be the same as the value
m passed to the initialization function
nag_wfilt_2d (c09abc).
- 2:
n – IntegerInput
On entry: number of columns, , of data matrix .
Constraint:
this must be the same as the value
n passed to the initialization function
nag_wfilt_2d (c09abc).
- 3:
a[] – const doubleInput
-
Note: the th element of the matrix is stored in .
On entry: the by data matrix .
- 4:
lda – IntegerInput
-
On entry: the stride separating matrix row elements in the array
a.
Constraint:
.
- 5:
ca[] – doubleOutput
-
Note: the dimension,
dim, of the array
ca
must be at least
where
is the argument
nwcn returned by function
nag_wfilt_2d (c09abc).
The th element of the matrix is stored in .
On exit: contains the by matrix of approximation coefficients, .
- 6:
ldca – IntegerInput
-
On entry: the stride separating matrix row elements in the array
ca.
Constraint:
where
and
,
are returned by the initialization function
nag_wfilt_2d (c09abc).
- 7:
ch[] – doubleOutput
-
Note: the dimension,
dim, of the array
ch
must be at least
where
is the argument
nwcn returned by function
nag_wfilt_2d (c09abc).
The th element of the matrix is stored in .
On exit: contains the by matrix of horizontal coefficients, .
- 8:
ldch – IntegerInput
-
On entry: the stride separating matrix row elements in the array
ch.
Constraint:
where
and
,
are returned by the initialization function
nag_wfilt_2d (c09abc).
- 9:
cv[] – doubleOutput
-
Note: the dimension,
dim, of the array
cv
must be at least
where
is the argument
nwcn returned by function
nag_wfilt_2d (c09abc).
The th element of the matrix is stored in .
On exit: contains the by matrix of vertical coefficients, .
- 10:
ldcv – IntegerInput
-
On entry: the stride separating matrix row elements in the array
cv.
Constraint:
where
and
,
are returned by the initialization function
nag_wfilt_2d (c09abc).
- 11:
cd[] – doubleOutput
-
Note: the dimension,
dim, of the array
cd
must be at least
where
is the argument
nwcn returned by function
nag_wfilt_2d (c09abc).
The th element of the matrix is stored in .
On exit: contains the by matrix of diagonal coefficients, .
- 12:
ldcd – IntegerInput
-
On entry: the stride separating matrix row elements in the array
cd.
Constraint:
where
and
,
are returned by the initialization function
nag_wfilt_2d (c09abc).
- 13:
icomm[] – IntegerCommunication Array
On entry: contains details of the discrete wavelet transform and the problem dimension as setup in the call to the initialization function
nag_wfilt_2d (c09abc).
- 14:
fail – NagError *Input/Output
-
The NAG error argument (see
Section 3.6 in the Essential Introduction).
The accuracy of the wavelet transform depends only on the floating-point operations used in the convolution and downsampling and should thus be close to machine precision.
nag_dwt_2d (c09eac) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
Users' Note for your implementation for any additional implementation-specific information.
None.