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,
${\mathit{x}}_{\mathit{i}}$, for
$\mathit{i}=1,2,\dots ,n$, in one dimension. For a chosen number of levels,
${n}_{l}$, with
${n}_{l}\le {l}_{\mathrm{max}}$, where
${l}_{\mathrm{max}}$ 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
${n}_{l}\times \left({n}_{a}+{n}_{d}\right)$ coefficients being returned in the output array,
c, where
${n}_{a}$ is the number of approximation coefficients and
${n}_{d}$ 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
${n}_{a}+{n}_{l}\times {n}_{d}$. In the present implementation, for simplicity,
${n}_{a}$ and
${n}_{d}$ 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 (
${\mathbf{n}}=64$) is decomposed using the MODWT over two levels and then the inverse (
nag_imlmodwt (c09ddc)) is applied to restore the original data set.