PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_wav_1d_cont (c09ba)
Purpose
nag_wav_1d_cont (c09ba) computes the real, continuous wavelet transform in one dimension.
Syntax
Description
nag_wav_1d_cont (c09ba) 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, . |
References
Daubechies I (1992) Ten Lectures on Wavelets SIAM, Philadelphia
Parameters
Compulsory Input Parameters
- 1:
– string
-
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:
– int64int32nag_int scalar
-
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:
– double array
-
x contains the input dataset
, for
.
- 4:
– int64int32nag_int array
-
The scales at which the transform is to be computed.
Constraint:
, for .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the dimension of the array
x.
The size, , of the input dataset .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
Default:
the dimension of the array
scales.
The dimension of the array
scales and the first dimension of the array
c. the number of scales to be computed.
Constraint:
.
Output Parameters
- 1:
– double array
-
The transform coefficients at the requested scales, where is the transform coefficient at scale and position .
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
-
-
On entry, was an illegal value.
-
-
Constraint: if , .
Constraint: if , .
-
-
Constraint: .
-
-
Constraint: .
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
Accuracy
The accuracy of nag_wav_1d_cont (c09ba) 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.
Further Comments
Workspace is internally allocated by nag_wav_1d_cont (c09ba). The total size of these arrays is double elements and integer elements, where and when or and
when .
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 , , , .
Open in the MATLAB editor:
c09ba_example
function c09ba_example
fprintf('c09ba example results\n\n');
wavnam = 'Morlet';
wparam = int64(5);
scales = [int64(1), 2, 3, 4];
x = zeros(10,1);
x(5) = 1;
[c, ifail] = c09ba(wavnam, wparam, x, scales);
fprintf('\nNumber of Scales : 4\n');
fprintf('Wavelet coefficients c :\n');
fprintf('Scale: %d %d %d %d\n', scales);
for j = 1:10
fprintf(' %11.4e %11.4e %11.4e %11.4e\n', c(:,j));
end
c09ba example results
Number of Scales : 4
Wavelet coefficients c :
Scale: 1 2 3 4
-1.7651e-05 1.5012e-04 5.2331e-02 1.4454e-01
-1.3643e-03 -5.8141e-02 1.7057e-01 -8.4364e-02
4.6511e-03 1.8442e-01 -1.4891e-01 -2.8870e-01
8.9294e-02 -2.6380e-01 -2.6822e-01 -9.4993e-02
-9.2563e-02 1.3289e-01 2.5680e-01 2.8293e-01
-9.2563e-02 1.3289e-01 2.5680e-01 2.8293e-01
8.9294e-02 -2.6380e-01 -2.6822e-01 -9.4993e-02
4.6511e-03 1.8442e-01 -1.4891e-01 -2.8870e-01
-1.3643e-03 -5.8141e-02 1.7057e-01 -8.4364e-02
-1.7651e-05 1.5012e-04 5.2331e-02 1.4454e-01
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015