nag_wav_2d_coeff_ins (c09ezc) inserts a selected set of two-dimensional discrete wavelet transform (DWT) coefficients into the full set of coefficients stored in compact form, which may be later used as input to the multi-level reconstruction function nag_imldwt_2d (c09edc)
nag_wav_2d_coeff_ins (c09ezc) inserts a selected set of two-dimensional DWT coefficients into the full set of coefficients stored in compact form in a one-dimensional array c
. It is required that nag_wav_2d_coeff_ins (c09ezc) is preceded by a call to the initialization function nag_wfilt_2d (c09abc)
and the forward multi-level transform function nag_mldwt_2d (c09ecc)
Given an initial two-dimensional data set
, a prior call to nag_mldwt_2d (c09ecc)
computes the approximation coefficients (at the highest requested level) and three sets of detail coeficients at all levels and stores these in compact form in a one-dimensional array c
. nag_wav_2d_coeff_ext (c09eyc)
can then extract either the approximation coefficients or one of the sets of detail coefficients at one of the levels
as two-dimensional data into the array,
. Following some calculation on this set of coefficients (for example, denoising), the updated coefficients in d
are inserted back into the full set c
using nag_wav_2d_coeff_ins (c09ezc). Several extractions and insertions may be performed at different levels. nag_imldwt_2d (c09edc)
can then be used to reconstruct a manipulated data set
. The dimensions of
the two-dimensional data stored in
depend on the level extracted and are available from the arrays dwtlvm
as returned by nag_mldwt_2d (c09ecc)
which contain the first and second dimensions respectively. See Section 2.1
in the c09 Chapter Introduction for a discussion of the multi-level two-dimensional DWT.
the following notation is used in this section:
- is the number of wavelet coefficients in the first dimension, which, at level ilev, is equal to as returned by a call to nag_mldwt_2d (c09ecc) transforming nwl levels.
- is the number of wavelet coefficients in the second dimension, which, at level ilev, is equal to as returned by a call to nag_mldwt_2d (c09ecc) transforming nwl levels
nag_wav_2d_coeff_ins (c09ezc) is not threaded in any implementation.
The following example demonstrates using the coefficient extraction and insertion functions in order to apply denoising using a thresholding operation. The original input data, which is horizontally striped, has artificial noise introduced to it, taken from a normal random number distribution. Reconstruction then takes place on both the noisy data and denoised data. The Mean Square Errors (MSE) of the two reconstructions are printed along with the reconstruction of the denoised data. The MSE of the denoised reconstruction is less than that of the noisy reconstruction.