nag_idwt_2d (c09ebc) (PDF version)
c09 Chapter Contents
c09 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_idwt_2d (c09ebc)

+ Contents

    1  Purpose
    7  Accuracy
    9  Example

1  Purpose

nag_idwt_2d (c09ebc) computes the inverse 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.

2  Specification

#include <nag.h>
#include <nagc09.h>
void  nag_idwt_2d (Integer m, Integer n, const double ca[], Integer ldca, const double ch[], Integer ldch, const double cv[], Integer ldcv, const double cd[], Integer ldcd, double b[], Integer ldb, const Integer icomm[], NagError *fail)

3  Description

nag_idwt_2d (c09ebc) performs the inverse operation of function nag_dwt_2d (c09eac). That is, given sets of approximation, horizontal, vertical and diagonal coefficients computed by function nag_dwt_2d (c09eac) using a DWT as set up by the initialization function nag_wfilt_2d (c09abc), on a real matrix, B, nag_idwt_2d (c09ebc) will reconstruct B.

4  References

None.

5  Arguments

1:     mIntegerInput
On entry: number of rows, m, of data matrix B.
Constraint: this must be the same as the value m passed to the initialization function nag_wfilt_2d (c09abc).
2:     nIntegerInput
On entry: number of columns, n, of data matrix B.
Constraint: this must be the same as the value n passed to the initialization function nag_wfilt_2d (c09abc).
3:     ca[dim]const doubleInput
Note: the dimension, dim, of the array ca must be at least max1,ldca×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in ca[j-1×ldca+i-1].
On entry: contains the ncm by ncn matrix of approximation coefficients, Ca. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
4:     ldcaIntegerInput
On entry: the stride separating matrix row elements in the array ca.
Constraint: ldcancm, where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
5:     ch[dim]const doubleInput
Note: the dimension, dim, of the array ch must be at least max1,ldch×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in ch[j-1×ldch+i-1].
On entry: contains the ncm by ncn matrix of horizontal coefficients, Ch. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
6:     ldchIntegerInput
On entry: the stride separating matrix row elements in the array ch.
Constraint: ldchncm, where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
7:     cv[dim]const doubleInput
Note: the dimension, dim, of the array cv must be at least max1,ldcv×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in cv[j-1×ldcv+i-1].
On entry: contains the ncm by ncn matrix of vertical coefficients, Cv. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
8:     ldcvIntegerInput
On entry: the stride separating matrix row elements in the array cv.
Constraint: ldcvncm, where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
9:     cd[dim]const doubleInput
Note: the dimension, dim, of the array cd must be at least max1,ldcd×ncn where ncn is the argument nwcn returned by function nag_wfilt_2d (c09abc).
The i,jth element of the matrix is stored in cd[j-1×ldcd+i-1].
On entry: contains the ncm by ncn matrix of diagonal coefficients, Cd. This array will normally be the result of some transformation on the coefficients computed by function nag_dwt_2d (c09eac).
10:   ldcdIntegerInput
On entry: the stride separating matrix row elements in the array cd.
Constraint: ldcdncm, where ncm=nct/4ncn and ncn, nct are returned by the initialization function nag_wfilt_2d (c09abc).
11:   b[ldb×n]doubleOutput
Note: the i,jth element of the matrix B is stored in b[j-1×ldb+i-1].
On exit: the m by n reconstructed matrix, B, based on the input approximation, horizontal, vertical and diagonal coefficients and the transform options supplied to the initialization function nag_wfilt_2d (c09abc).
12:   ldbIntegerInput
On entry: the stride separating matrix row elements in the array b.
Constraint: ldbm.
13:   icomm[180]const 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:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INITIALIZATION
Either the initialization function has not been called first or icomm has been corrupted.
Either the initialization function was called with wtrans=Nag_MultiLevel or icomm has been corrupted.
NE_INT
On entry, ldca=value.
Constraint: ldcavalue, the number of wavelet coefficients in the first dimension.
On entry, ldcd=value.
Constraint: ldcdvalue, the number of wavelet coefficients in the first dimension.
On entry, ldch=value.
Constraint: ldchvalue, the number of wavelet coefficients in the first dimension.
On entry, ldcv=value.
Constraint: ldcvvalue, the number of wavelet coefficients in the first dimension.
On entry, m=value.
Constraint: m=value, the value of m on initialization (see nag_wfilt_2d (c09abc)).
On entry, n=value.
Constraint: n=value, the value of n on initialization (see nag_wfilt_2d (c09abc)).
NE_INT_2
On entry, ldb=value and m=value.
Constraint: ldbm.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.

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  Further Comments

None.

9  Example

See Section 9 in nag_dwt_2d (c09eac).

nag_idwt_2d (c09ebc) (PDF version)
c09 Chapter Contents
c09 Chapter Introduction
NAG C Library Manual

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