NAG Library Routine Document
C09BAF computes the real, continuous wavelet transform in one dimension.
||WPARAM, N, NSCAL, SCALES(NSCAL), IFAIL
C09BAF computes the real part of the one-dimensional, continuous wavelet transform
of a signal
, where the signal is sampled discretely at
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 routine are defined as follows.
- The Morlet wavelet (real part) with nondimensional wave number is
where the correction term, (required to satisfy the admissibility condition) is included.
- 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,
Thus, the derivatives of a Gaussian provided here are,
- 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, .
Daubechies I (1992) Ten Lectures on Wavelets SIAM, Philadelphia
- 1: WAVNAM – CHARACTER(*)Input
: the name of the mother wavelet. See the C09 Chapter Introduction
- Morlet wavelet.
- Derivative of a Gaussian wavelet.
- Mexican hat wavelet.
, or .
- 2: WPARAM – INTEGERInput
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 .
- if , ;
- if , .
- 3: N – INTEGERInput
On entry: the size, , of the input dataset .
- 4: X(N) – REAL (KIND=nag_wp) arrayInput
contains the input dataset
- 5: NSCAL – INTEGERInput
: the dimension of the array SCALES
and the first dimension of the array C
as declared in the (sub)program from which C09BAF is called. The number of scales to be computed.
- 6: SCALES(NSCAL) – INTEGER arrayInput
On entry: the scales at which the transform is to be computed.
, for .
- 7: C(NSCAL,N) – REAL (KIND=nag_wp) arrayOutput
On exit: the transform coefficients at the requested scales, where is the transform coefficient at scale and position .
- 8: IFAIL – INTEGERInput/Output
must be set to
. If you are unfamiliar with this parameter you should refer to Section 3.3
in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
. When the value is used it is essential to test the value of IFAIL on exit.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
If on entry
, explanatory error messages are output on the current error message unit (as defined by X04AAF
Errors or warnings detected by the routine:
|On entry,||, or |
|On entry,||, and or .|
|or||, and or .|
Internal memory allocation failed.
The accuracy of C09BAF 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.
Workspace is internally allocated by C09BAF. The total size of these arrays is real elements and integer elements, where and when or and
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 , , , .
9.1 Program Text
Program Text (c09bafe.f90)
9.2 Program Data
Program Data (c09bafe.d)
9.3 Program Results
Program Results (c09bafe.r)