c09ca computes the one-dimensional discrete wavelet transform (DWT) at a single level. The initialization method C09 Communication class constructor must be called first to set up the DWT options.

Syntax

C#
public static void c09ca(
	int n,
	double[] x,
	double[] ca,
	double[] cd,
	C09..::..C09Communications communications,
	out int ifail
)
Visual Basic
Public Shared Sub c09ca ( _
	n As Integer, _
	x As Double(), _
	ca As Double(), _
	cd As Double(), _
	communications As C09..::..C09Communications, _
	<OutAttribute> ByRef ifail As Integer _
)
Visual C++
public:
static void c09ca(
	int n, 
	array<double>^ x, 
	array<double>^ ca, 
	array<double>^ cd, 
	C09..::..C09Communications^ communications, 
	[OutAttribute] int% ifail
)
F#
static member c09ca : 
        n : int * 
        x : float[] * 
        ca : float[] * 
        cd : float[] * 
        communications : C09..::..C09Communications * 
        ifail : int byref -> unit 

Parameters

n
Type: System..::..Int32
On entry: the number of elements, n, in the data array x.
Constraint: this must be the same as the value n passed to the initialization method c09aa.
x
Type: array<System..::..Double>[]()[][]
An array of size [n]
On entry: x contains the input dataset xi, for i=1,2,,n.
ca
Type: array<System..::..Double>[]()[][]
An array of size [lenc]
On exit: ca[i-1] contains the ith approximation coefficient, Cai, for i=1,2,,nc.
cd
Type: array<System..::..Double>[]()[][]
An array of size [lenc]
On exit: cd[i-1] contains the ith detail coefficient, Cdi, for i=1,2,,nc.
communications
Type: NagLibrary..::..C09..::..C09Communications
An Object of type C09.c09caCommunications.
ifail
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).

Description

c09ca computes the one-dimensional DWT of a given input data array, xi, for i=1,2,,n, at a single level. For a chosen wavelet filter pair, the output coefficients are obtained by applying convolution and downsampling by two to the input, x. The approximation (or smooth) coefficients, Ca, are produced by the low pass filter and the detail coefficients, Cd, by the high pass filter. To reduce distortion effects at the ends of the data array, several end extension methods are commonly used. Those provided are: periodic or circular convolution end extension, half-point symmetric end extension, whole-point symmetric end extension or zero end extension. The number nc, of coefficients Ca or Cd is returned by the initialization method C09 Communication class constructor.

References

Daubechies I (1992) Ten Lectures on Wavelets SIAM, Philadelphia

Error Indicators and Warnings

Errors or warnings detected by the method:
ifail=1
On entry, n is inconsistent with the value passed to the initialization method C09 Communication class constructor.
ifail=2
On entry, lenc<nc, where nc is the value returned in nwc by the call to the initialization method C09 Communication class constructor.
ifail=6
On entry, the initialization method C09 Communication class constructor has not been called first or it has been called with wtrans="M", or the communication array icomm has become corrupted.
ifail=-9000
An error occured, see message report.
ifail=-1000
The array lengths are not the same for arrays
ifail=-8000
Negative dimension for array value
ifail=-6000
Invalid Parameters value

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.

Parallelism and Performance

None.

Further Comments

None.

Example

This example computes the one-dimensional discrete wavelet decomposition for 8 values using the Daubechies wavelet, wavnam="DB4", with zero end extension.

Example program (C#): c09cae.cs

Example program data: c09cae.d

Example program results: c09cae.r

See Also