NAG FL Interface
c09ddf (dim1_​mxolap_​multi_​inv)

Settings help

FL Name Style:

FL Specification Language:

1 Purpose

c09ddf computes the inverse one-dimensional multi-level maximal overlap discrete wavelet transform (MODWT). This routine reconstructs data from (possibly filtered or otherwise manipulated) wavelet transform coefficients calculated by c09dcf from an original set of data. The initialization routine c09aaf must be called first to set up the MODWT options.

2 Specification

Fortran Interface
Subroutine c09ddf ( nwlinv, keepa, lenc, c, n, y, icomm, ifail)
Integer, Intent (In) :: nwlinv, lenc, n, icomm(100)
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: c(lenc)
Real (Kind=nag_wp), Intent (Out) :: y(n)
Character (1), Intent (In) :: keepa
C Header Interface
#include <nag.h>
void  c09ddf_ (const Integer *nwlinv, const char *keepa, const Integer *lenc, const double c[], const Integer *n, double y[], const Integer icomm[], Integer *ifail, const Charlen length_keepa)
The routine may be called by the names c09ddf or nagf_wav_dim1_mxolap_multi_inv.

3 Description

c09ddf performs the inverse operation of c09dcf. That is, given a set of wavelet coefficients computed by c09dcf using a MODWT as set up by the initialization routine c09aaf on a real array of length n, c09ddf will reconstruct the data array yi, for i=1,2,,n, from which the coefficients were derived.

4 References

Percival D B and Walden A T (2000) Wavelet Methods for Time Series Analysis Cambridge University Press

5 Arguments

1: nwlinv Integer Input
On entry: the number of levels to be used in the inverse multi-level transform. The number of levels must be less than or equal to nfwd, which has the value of argument nwl as used in the computation of the wavelet coefficients using c09dcf. The data will be reconstructed to level (nwl-nwlinv), where level 0 is the original input dataset provided to c09dcf.
Constraint: 1nwlinvnwl, where nwl is the value used in a preceding call to c09dcf.
2: keepa Character(1) Input
On entry: determines whether the approximation coefficients are stored in array c for every level of the computed transform or else only for the final level. In both cases, the detail coefficients are stored in c for every level computed.
Retain approximation coefficients for all levels computed.
Retain approximation coefficients for only the final level computed.
Constraint: keepa='A' or 'F'.
3: lenc Integer Input
On entry: the dimension of the array c as declared in the (sub)program from which c09ddf is called.
  • if keepa='F', lenc(nl+1)×na;
  • if keepa='A', lenc2×nl×na, where na is the number of approximation or detail coefficients at each level and is unchanged from the preceding call to c09dcf.
4: c(lenc) Real (Kind=nag_wp) array Input
On entry: the coefficients of a multi-level wavelet transform of the dataset.
The coefficients are stored in c as follows:
If keepa='F',
Contains the level nl approximation coefficients;
c( na + (i-1)×nd+1 : na+i×nd )
Contains the level (nl-i+1) detail coefficients, for i=1,2,,nl;
If keepa='A',
c((i-1) ×na+1:i×na)
Contains the level (nl-i+1) approximation coefficients, for i=1,2,,nl;
c(nl ×na+(i-1) ×nd+1:nl ×na+i×nd)
Contains the level i detail coefficients, for i=1,2,,nl.
The values na and nd denote the numbers of approximation and detail coefficients respectively, which are equal. This number is returned as output in na from a preceding call to c09dcf. See c09dcf for details.
5: n Integer Input
On entry: n, the length of the data array, y, to be reconstructed.
Constraint: This must be the same as the value n passed to the initialization routine c09aaf.
6: y(n) Real (Kind=nag_wp) array Output
On exit: the dataset reconstructed from the multi-level wavelet transform coefficients and the transformation options supplied to the initialization routine c09aaf.
7: icomm(100) Integer array Communication Array
On entry: contains details of the discrete wavelet transform and the problem dimension for the forward transform previously computed by c09dcf.
8: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. 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:
On entry, nwlinv=value.
Constraint: nwlinv1.
On entry, nwlinv is larger than the number of levels computed by the preceding call to c09dcf: nwlinv=value, expected value.
On entry, keepa=value was an illegal value.
On entry, lenc is set too small: lenc=value.
Constraint: lencvalue.
On entry, n is inconsistent with the value passed to the initialization routine: n=value, n should be value.
On entry, the initialization routine c09aaf has not been called first or it has not been called with wtrans='U', or the communication array icomm has become corrupted.
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

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.

8 Parallelism and Performance

c09ddf is not threaded in any implementation.

9 Further Comments


10 Example

See c09dcf.