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

NAG Library Routine Document

C09FYF

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

C09FYF extracts a selected set of discrete wavelet transform (DWT) coefficients from the full set of coefficients stored in compact form, as computed by C09FAF (single level three-dimensional DWT) or C09FCF (multi-level three-dimensional DWT).

2  Specification

SUBROUTINE C09FYF ( ILEV, CINDEX, LENC, C, D, LDD, SDD, ICOMM, IFAIL)
INTEGER  ILEV, CINDEX, LENC, LDD, SDD, ICOMM(260), IFAIL
REAL (KIND=nag_wp)  C(LENC), D(LDD,SDD,*)

3  Description

C09FYF is intended to be used after a call to either C09FAF (single level three-dimensional DWT) or C09FCF (multi-level three-dimensional DWT), either of which must be preceded by a call to C09ACF (three-dimensional wavelet filter initialization). Given an initial three-dimensional data set A, a prior call to C09FAF or C09FCF computes the approximation coefficients (at the highest requested level in the case of C09FCF) and seven sets of detail coefficients (at all levels in the case of C09FCF) and stores these in compact form in a one-dimensional array C. C09FYF can then extract either the approximation coefficients or one of the sets of detail coefficients (at one of the levels following C09FCF) into a three-dimensional data set stored in D.
If a multi-level DWT was performed by a prior call to C09FCF then the dimensions of the three-dimensional data stored in D depend on the level extracted and are available from the arrays DWTLVM, DWTLVN and DWTLVFR as returned by C09FCF which contain the first, second and third dimensions respectively.
If a single level DWT was performed by a prior call to C09FAF then the dimensions of the three-dimensional data stored in D can be determined from NWCT, NWCN and NWCFR as returned by the setup routine C09ACF.
See Section 2.1 in the C09 Chapter Introduction for a discussion of the three-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.
If ILEV=0, it is assumed that the coefficient array C was produced by a preceding call to the single level routine C09FAF.
If ILEV>0, it is assumed that the coefficient array C was produced by a preceding call to the multi-level routine C09FCF.
Constraints:
  • ILEV=0 (following a call to C09FAF);
  • 0ILEVNWL, where NWL is as used in a preceding call to C09FCF;
  • if CINDEX=0, ILEV=NWL (following a call to C09FCF).
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, rows and frames of A (LLL). After a call to the multi-level transform routine C09FCF (which implies that ILEV>0) the approximation coefficients are available only for ILEV=NWL, where NWL is the value used in a preceding call to C09FCF.
CINDEX=1
The detail coefficients produced by applying the low pass filter over columns and rows of A and the high pass filter over frames (LLH).
CINDEX=2
The detail coefficients produced by applying the low pass filter over columns, high pass filter over rows and low pass filter over frames of A (LHL).
CINDEX=3
The detail coefficients produced by applying the low pass filter over columns of A and high pass filter over rows and frames (LHH).
CINDEX=4
The detail coefficients produced by applying the high pass filter over columns of A and low pass filter over rows and frames (HLL).
CINDEX=5
The detail coefficients produced by applying the high pass filter over columns, low pass filter over rows and high pass filter over frames of A (HLH).
CINDEX=6
The detail coefficients produced by applying the high pass filter over columns and rows of A and the low pass filter over frames (HHL).
CINDEX=7
The detail coefficients produced by applying the high pass filter over columns, rows and frames of A (HHH).
Constraints:
  • if ILEV=0, 0CINDEX7;
  • if ILEV=NWL, following a call to C09FCF transforming NWL levels, 0CINDEX7;
  • otherwise 1CINDEX7.
3:     LENC – INTEGERInput
On entry: the dimension of the array C as declared in the (sub)program from which C09FYF is called.
Constraint: LENC must be unchanged from the value used in the preceding call to either C09FAF or C09FCF..
4:     CLENC – REAL (KIND=nag_wp) arrayInput
On entry: DWT coefficients, as computed by C09FAF or C09FCF.
5:     DLDDSDD* – REAL (KIND=nag_wp) arrayOutput
Note: the last dimension of the array D must be at least ncfr.
On exit: the requested coefficients.
If the DWT coefficients were computed by C09FAF then
  • if CINDEX=0, the approximation coefficients are stored in Dijk, for i=1,2,,ncm, j=1,2,,ncn and k=1,2,,ncfr;
  • if 1CINDEX7, the detail coefficients, as indicated by CINDEX, are stored in Dijk, for i=1,2,,ncm, j=1,2,,ncn and k=1,2,,ncfr.
If the DWT coefficients were computed by C09FCF then
  • if CINDEX=0 and ILEV=NWL, the approximation coefficients are stored in Dijk, for i=1,2,,ncm, j=1,2,,ncn and k=1,2,,ncfr;
  • if 1CINDEX7, the detail coefficients, as indicated by CINDEX, for level ILEV are stored in Dijk, for i=1,2,,ncm, j=1,2,,ncn and k=1,2,,ncfr.
6:     LDD – INTEGERInput
On entry: the first dimension of the array D as declared in the (sub)program from which C09FYF is called.
Constraint: LDDncm.
7:     SDD – INTEGERInput
On entry: the second dimension of the array D as declared in the (sub)program from which C09FYF is called.
Constraint: SDDncn.
8:     ICOMM260 – 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 C09ACF.
9:     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: ILEV=0 following a call to the single level routine C09FAF.
On entry, ILEV=value.
Constraint: ILEV>0 following a call to the multi-level routine C09FCF.
On entry, ILEV=value and NWL=value.
Constraint: ILEVNWL, where NWL is the number of levels used in the call to C09FCF.
IFAIL=2
On entry, CINDEX=value.
Constraint: CINDEX7.
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 the preceding call to C09FAF.
On entry, LENC=value and nct=value.
Constraint: LENCnct, where nct is the number of DWT coefficients computed in the preceding call to C09FCF.
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.
On entry, LDD=value and ncm=value.
Constraint: LDDncm, where ncm is the number of DWT coefficients in the first dimension following the single level transform.
On entry, SDD=value and ncn=value.
Constraint: SDDncn, where ncn is the number of DWT coefficients in the second dimension at the selected level ILEV.
On entry, SDD=value and ncn=value.
Constraint: SDDncn, where ncn is the number of DWT coefficients in the second dimension following the single level transform.
IFAIL=5
On entry, ILEV=value and NWL=value, but CINDEX=0.
Constraint: CINDEX>0 when ILEV<NWL in the preceding call to C09FCF.
IFAIL=6
Either the initialization routine has not been called first 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 C09ACF, C09FAF, C09FCF and C09FZF.

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

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