C09EYF (PDF version)
C09 Chapter Contents
C09 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

C09EYF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy
    10  Example

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

SUBROUTINE C09EYF ( ILEV, CINDEX, LENC, C, D, LDD, ICOMM, IFAIL)
INTEGER  ILEV, CINDEX, LENC, LDD, ICOMM(180), IFAIL
REAL (KIND=nag_wp)  C(LENC), D(LDD,*)

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  Parameters

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 parameter you should refer to Section 3.3 in the Essential Introduction 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 parameter, 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.8 in the Essential Introduction for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.7 in the Essential Introduction for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.6 in the Essential Introduction for further information.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

See Section 10 in C09ABF, C09ECF and C09EZF.

C09EYF (PDF version)
C09 Chapter Contents
C09 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015