c09cd computes the inverse onedimensional multilevel discrete wavelet transform (DWT). This method reconstructs data from (possibly filtered or otherwise manipulated) wavelet transform coefficients calculated by c09cc from an original set of data. The initialization method C09 Communication class constructor must be called first to set up the DWT options.
Syntax
C# 

public static void c09cd( int nwlinv, double[] c, int n, double[] y, C09..::..C09Communications communications, out int ifail ) 
Visual Basic 

Public Shared Sub c09cd ( _ nwlinv As Integer, _ c As Double(), _ n As Integer, _ y As Double(), _ communications As C09..::..C09Communications, _ <OutAttribute> ByRef ifail As Integer _ ) 
Visual C++ 

public: static void c09cd( int nwlinv, array<double>^ c, int n, array<double>^ y, C09..::..C09Communications^ communications, [OutAttribute] int% ifail ) 
F# 

static member c09cd : nwlinv : int * c : float[] * n : int * y : float[] * communications : C09..::..C09Communications * ifail : int byref > unit 
Parameters
 nwlinv
 Type: System..::..Int32On entry: the number of levels to be used in the inverse multilevel transform. The number of levels must be less than or equal to ${n}_{\mathrm{fwd}}$, which has the value of parameter nwl as used in the computation of the wavelet coefficients using c09cc. The data will be reconstructed to level $\left({\mathbf{nwl}}{\mathbf{nwlinv}}\right)$, where level $0$ is the original input dataset provided to c09cc.
 c
 Type: array<System..::..Double>[]()[][]An array of size [lenc]On entry: the coefficients of a multilevel wavelet transform of the dataset.Let $q\left(\mathit{i}\right)$ be the number of coefficients (of each type) at level $\mathit{i}$, for $\mathit{i}={n}_{\mathrm{fwd}},{n}_{\mathrm{fwd}}1,\dots ,1$. Then, setting ${k}_{1}=q\left({n}_{\mathrm{fwd}}\right)$ and ${k}_{\mathit{j}+1}={k}_{\mathit{j}}+q\left({n}_{\mathrm{fwd}}\mathit{j}+1\right)$, for $\mathit{j}=1,2,\dots ,{n}_{\mathrm{fwd}}$, the coefficients are stored in c as follows:
 ${\mathbf{c}}\left[\mathit{i}1\right]$, for $\mathit{i}=1,2,\dots ,{k}_{1}$
 Contains the level ${n}_{\mathrm{fwd}}$ approximation coefficients, ${a}_{{n}_{\mathrm{fwd}}}$.
 ${\mathbf{c}}\left[\mathit{i}1\right]$, for $\mathit{i}={k}_{1}+1,\dots ,{k}_{2}$
 Contains the level ${n}_{\mathrm{fwd}}$ detail coefficients ${d}_{{n}_{\mathrm{fwd}}}$.
 ${\mathbf{c}}\left[\mathit{i}1\right]$, for $\mathit{i}={k}_{j}+1,\dots ,{k}_{j+1}$
 Contains the level ${n}_{\mathrm{fwd}}\mathit{j}+1$ detail coefficients, for $\mathit{j}=2,3,\dots ,{n}_{\mathrm{fwd}}$.
 n
 Type: System..::..Int32On entry: $n$, the length of the data array, $y$, to be reconstructed. For a full reconstruction of nwl levels, where nwl is as supplied to c09cc, this must be the same as parameter n used in the call to c09cc. For a partial reconstruction of ${\mathbf{nwlinv}}<{\mathbf{nwl}}$, this must be equal to ${\mathbf{dwtlev}}\left[{\mathbf{nwlinv}}+1\right]$, as returned from c09cc.
 y
 Type: array<System..::..Double>[]()[][]An array of size [n]On exit: the dataset reconstructed from the multilevel wavelet transform coefficients and the transformation options supplied to the initialization method c09aa.
 communications
 Type: NagLibrary..::..C09..::..C09CommunicationsAn Object of type C09.c09cdCommunications.
 ifail
 Type: System..::..Int32%On exit: ${\mathbf{ifail}}={0}$ unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
c09cd performs the inverse operation of c09cc. That is, given a set of wavelet coefficients, computed up to level ${n}_{\mathrm{fwd}}$ by c09cc using a DWT as set up by the initialization method C09 Communication class constructor, on a real data array of length $n$, c09cd will reconstruct the data array
${y}_{\mathit{i}}$, for $\mathit{i}=1,2,\dots ,n$,
from which the coefficients were derived. If the original input dataset is level $0$, then it is possible to terminate reconstruction at a higher level by specifying fewer than the number of levels used in the call to c09cc. This results in a partial reconstruction.
References
None.
Error Indicators and Warnings
Errors or warnings detected by the method:
 ${\mathbf{ifail}}=1$

On entry, ${\mathbf{nwlinv}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{nwlinv}}\ge 1$.
 ${\mathbf{ifail}}=2$

On entry, lenc is set too small: ${\mathbf{lenc}}=\u2329\mathit{\text{value}}\u232a$.
Constraint: ${\mathbf{lenc}}\ge \u2329\mathit{\text{value}}\u232a$.
 ${\mathbf{ifail}}=4$
 ${\mathbf{ifail}}=6$

Either the initialization method has not been called first or array icomm has been corrupted.Either the initialization method was called with ${\mathbf{wtrans}}=\text{"S"}$ or array icomm has been corrupted.
 ${\mathbf{ifail}}=999$

Dynamic memory allocation failed.
Accuracy
The accuracy of the wavelet transform depends only on the floatingpoint operations used in the convolution and downsampling and should thus be close to machine precision.
Parallelism and Performance
None.
Further Comments
None.