NAG CL Interface
c09bac (dim1_cont)
1
Purpose
c09bac computes the real, continuous wavelet transform in one dimension.
2
Specification
The function may be called by the names: c09bac, nag_wav_dim1_cont or nag_cwt_1d_real.
3
Description
c09bac computes the real part of the one-dimensional, continuous wavelet transform
of a signal
at scale
and position
, where the signal is sampled discretely at
equidistant points
, for
.
is the wavelet function, which can be chosen to be the Morlet wavelet, the derivatives of a Gaussian or the Mexican hat wavelet (
denotes the complex conjugate). The integrals of the scaled, shifted wavelet function are approximated and the convolution is then computed.
The mother wavelets supplied for use with this function are defined as follows.
-
1.The Morlet wavelet (real part) with nondimensional wave number is
where the correction term, (required to satisfy the admissibility condition) is included.
-
2.The derivatives of a Gaussian are obtained from
taking . These are the Hermite polynomials multiplied by the Gaussian. The sign is then adjusted to give when is even while the sign of the succeeding odd derivative, , is made consistent with the preceding even numbered derivative. They are normalized by the -norm,
The resulting normalized derivatives can be written in terms of the Hermite polynomials,
, as
where
Thus, the derivatives of a Gaussian provided here are,
-
3.The second derivative of a Gaussian is known as the Mexican hat wavelet and is supplied as an additional function in the form
The remaining normalized derivatives of a Gaussian can be expressed as multiples of the exponential by applying the substitution followed by multiplication with the scaling factor, .
4
References
Daubechies I (1992) Ten Lectures on Wavelets SIAM, Philadelphia
5
Arguments
-
1:
– Nag_Wavelet
Input
-
On entry: the name of the mother wavelet. See the
C09 Chapter Introduction for details.
- Morlet wavelet.
- Derivative of a Gaussian wavelet.
- Mexican hat wavelet.
Constraint:
, or .
-
2:
– Integer
Input
-
On entry: the nondimensional wave number for the Morlet wavelet or the order of the derivative for the Gaussian wavelet. It is not referenced when .
Constraints:
- if , ;
- if , .
-
3:
– Integer
Input
-
On entry: the size, , of the input dataset .
Constraint:
.
-
4:
– const double
Input
-
On entry:
x contains the input dataset
, for
.
-
5:
– Integer
Input
-
On entry: the number of scales to be computed.
Constraint:
.
-
6:
– const Integer
Input
-
On entry: the scales at which the transform is to be computed.
Constraint:
, for .
-
7:
– double
Output
-
Note: the th element of the matrix is stored in .
On exit: the transform coefficients at the requested scales, where is the transform coefficient at scale and position .
-
8:
– NagError *
Input/Output
-
The
NAG error argument (see
Section 7 in the Introduction to the
NAG Library CL Interface).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the
NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, and .
Constraint: if , .
On entry, and .
Constraint: if , .
- 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.
See
Section 7.5 in the Introduction to the
NAG Library CL Interface for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the
NAG Library CL Interface for further information.
7
Accuracy
The accuracy of c09bac is determined by the fact that the convolution must be computed as a discrete approximation to the continuous form. The input signal, , is taken to be piecewise constant using the supplied discrete values.
8
Parallelism and Performance
Background information to multithreading can be found in the
Multithreading documentation.
c09bac is not threaded in any implementation.
Workspace is internally allocated by c09bac. The total size of these arrays is double elements and Integer elements, where and when or and
when .
10
Example
This example computes the continuous wavelet transform of a dataset containing a single nonzero value representing an impulse. The Morlet wavelet is used with wave number and scales , , , .
10.1
Program Text
10.2
Program Data
10.3
Program Results