nag_mlmodwt (c09dcc) computes the one-dimensional multi-level maximal overlap discrete wavelet transform (MODWT). The initialization function
nag_wfilt (c09aac) must be called first to set up the MODWT options.
nag_mlmodwt (c09dcc) computes the multi-level MODWT for a data set,
, for
, in one dimension. For a chosen number of levels,
, with
, where
is returned by the initialization function
nag_wfilt (c09aac) in
nwlmax, the transform is returned as a set of coefficients for the different levels stored in a single array. Periodic reflection is currently the only available end extension method to reduce the edge effects caused by finite data sets.
The argument
keepa can be set to retain both approximation and detail coefficients at each level resulting in
coefficients being returned in the output array,
c, where
is the number of approximation coefficients and
is the number of detail coefficients. Otherwise, only the detail coefficients are stored for each level along with the approximation coefficients for the final level, in which case the length of the output array,
c, is
. In the present implementation, for simplicity,
and
are chosen to be equal by adding zero padding to the wavelet filters where necessary.
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.
The wavelet coefficients at each level can be extracted from the output array
c using the information contained in
na on exit.
A set of data values (
) is decomposed using the MODWT over two levels and then the inverse (
nag_imlmodwt (c09ddc)) is applied to restore the original data set.