NAG Library Routine Document

c09eyf (dim2_coeff_ext)

1
Purpose

c09eyf extracts a selected set of discrete wavelet transform (DWT) coefficients from the full set of coefficients stored in compact form, as computed by c09ecf (two-dimensional DWT).

2
Specification

Fortran Interface
Subroutine c09eyf ( ilev, cindex, lenc, c, d, ldd, icomm, ifail)
Integer, Intent (In):: ilev, cindex, lenc, ldd
Integer, Intent (Inout):: icomm(180), ifail
Real (Kind=nag_wp), Intent (In):: c(lenc)
Real (Kind=nag_wp), Intent (Inout):: d(ldd,*)
C Header Interface
#include <nagmk26.h>
void  c09eyf_ (const Integer *ilev, const Integer *cindex, const Integer *lenc, const double c[], double d[], const Integer *ldd, Integer icomm[], Integer *ifail)

3
Description

c09eyf is intended to be used after a call to c09ecf (two-dimensional DWT), which in turn should be preceded by a call to c09abf (two-dimensional wavelet filter initialization). Given an initial two-dimensional data set A, a prior call to c09ecf computes the approximation coefficients (at the highest requested level) and three sets of detail coeficients at all levels and stores these in compact form in a one-dimensional array c. c09eyf can then extract either the approximation coefficients or one of the sets of detail coefficients at one of the levels into a matrix D. The dimensions of D depend on the level extracted and are available from the arrays dwtlvm and dwtlvn as returned by c09ecf which contain the first and second dimensions respectively. See Section 2.1 in the C09 Chapter Introduction for a discussion of the two-dimensional DWT.

4
References

None.

5
Arguments

Note: the following notation is used in this section:
1:     ilev – IntegerInput
On entry: the level at which coefficients are to be extracted.
Constraints:
  • 1ilevnwl, where nwl is as used in a preceding call to c09ecf;
  • if cindex=0, ilev=nwl.
2:     cindex – IntegerInput
On entry: identifies which coefficients to extract. The coefficients are identified as follows:
cindex=0
The approximation coefficients, produced by application of the low pass filter over columns and rows of the original matrix (LL). The approximation coefficients are available only for ilev=nwl, where nwl is the value used in a preceding call to c09ecf.
cindex=1
The vertical detail coefficients produced by applying the low pass filter over columns of the original matrix and the high pass filter over rows (LH).
cindex=2
The horizontal detail coefficients produced by applying the high pass filter over columns of the original matrix and the low pass filter over rows (HL).
cindex=3
The diagonal detail coefficients produced by applying the high pass filter over columns and rows of the original matrix (HH).
Constraint: 0cindex3 when ilev=nwl as used in c09ecf, otherwise 1cindex3.
3:     lenc – IntegerInput
On entry: the dimension of the array c as declared in the (sub)program from which c09eyf is called.
Constraint: lenc must be unchanged from the value used in the preceding call to c09ecf..
4:     clenc – Real (Kind=nag_wp) arrayInput
On entry: DWT coefficients, as computed by a preceding call to c09ecf.
5:     dldd* – Real (Kind=nag_wp) arrayOutput
Note: the second dimension of the array d must be at least ncn.
On exit: the requested coefficients.
If ilev=nwl (as used in c09ecf) and cindex=0, the ncm by ncn approximation coefficients aij are stored in dij, for i=1,2,,ncm and j=1,2,,ncn.
Otherwise the ncm by ncn level ilev detail coefficients (of type specified by cindex) dij are stored in dij, for i=1,2,,ncm and j=1,2,,ncn.
6:     ldd – IntegerInput
On entry: the first dimension of the array d as declared in the (sub)program from which c09eyf is called.
Constraint: lddncm.
7:     icomm180 – Integer arrayCommunication Array
On entry: contains details of the discrete wavelet transform and the problem dimension as setup in the call to the initialization routine c09abf.
8:     ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this argument, the recommended value is 0. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6
Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
On entry, ilev=value.
Constraint: ilev1.
On entry, ilev=value and nwl=value.
Constraint: ilevnwl, where nwl is the number of levels used in the call to c09ecf.
ifail=2
On entry, cindex=value.
Constraint: cindex3.
On entry, cindex=value.
Constraint: cindex0.
ifail=3
On entry, lenc=value and nct=value.
Constraint: lencnct, where nct is the number of DWT coefficients computed in a previous call to c09ecf.
ifail=4
On entry, ldd=value and ncm=value.
Constraint: lddncm, where ncm is the number of DWT coefficients in the first dimension at the selected level ilev.
ifail=5
On entry, ilev=value and nwl=value, but cindex=0.
Constraint: cindex>0 when ilev<nwl in the preceding call to c09ecf.
ifail=6
Either the initialization routine has not been called first or icomm has been corrupted.
Either the initialization routine was called with wtrans='S' or icomm has been corrupted.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Not applicable.

8
Parallelism and Performance

c09eyf is not threaded in any implementation.

9
Further Comments

None.

10
Example

See Section 10 in c09abf, c09ecf and c09ezf.