naginterfaces.library.wav.dim2_​multi_​fwd

naginterfaces.library.wav.dim2_multi_fwd(a, nwl, comm)[source]

dim2_multi_fwd computes the two-dimensional multi-level discrete wavelet transform (DWT). The initialization function dim2_init() must be called first to set up the DWT options.

For full information please refer to the NAG Library document for c09ec

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/c09/c09ecf.html

Parameters
afloat, array-like, shape

The data matrix .

nwlint

The number of levels, , in the multi-level resolution to be performed.

commdict, communication object, modified in place

Communication structure.

This argument must have been initialized by a prior call to dim2_init().

Returns
cfloat, ndarray, shape

The coefficients of the discrete wavelet transform. If you need to access or modify the approximation coefficients or any specific set of detail coefficients then the use of dim2_coeff_ext() or dim2_coeff_ins() is recommended. For completeness the following description provides details of precisely how the coefficient are stored in but this information should only be required in rare cases.

Let denote the number of coefficients (of each type) at level , for , such that .

Then, letting and , for , the coefficients are stored in as follows:

, for

Contains the level approximation coefficients, .

, for

Contains the level vertical, horizontal and diagonal coefficients. These are:

vertical coefficients if ;

horizontal coefficients if ;

diagonal coefficients if ,

for .

dwtlvmint, ndarray, shape

The number of coefficients in the first dimension for each coefficient type at each level. contains the number of coefficients in the first dimension (for each coefficient type computed) at the ()th level of resolution, for . Thus for the first levels of resolution, is the size of the first dimension of the matrices of vertical, horizontal and diagonal coefficients computed at this level; for the final level of resolution, is the size of the first dimension of the matrices of approximation, vertical, horizontal and diagonal coefficients computed.

dwtlvnint, ndarray, shape

The number of coefficients in the second dimension for each coefficient type at each level. contains the number of coefficients in the second dimension (for each coefficient type computed) at the ()th level of resolution, for . Thus for the first levels of resolution, is the size of the second dimension of the matrices of vertical, horizontal and diagonal coefficients computed at this level; for the final level of resolution, is the size of the second dimension of the matrices of approximation, vertical, horizontal and diagonal coefficients computed.

Raises
NagValueError
(errno )

On entry, .

Constraint: , the value of on initialization (see dim2_init()).

(errno )

On entry, .

Constraint: , the value of on initialization (see dim2_init()).

(errno )

On entry, and in dim2_init().

Constraint: in dim2_init().

(errno )

On entry, .

Constraint: .

(errno )

Either the initialization function has not been called first or [‘icomm’] has been corrupted.

(errno )

Either the initialization function was called with or [‘icomm’] has been corrupted.

Notes

dim2_multi_fwd computes the multi-level DWT of two-dimensional data. For a given wavelet and end extension method, dim2_multi_fwd will compute a multi-level transform of a matrix , using a specified number, , of levels. The number of levels specified, , must be no more than the value returned in by the initialization function dim2_init() for the given problem. The transform is returned as a set of coefficients for the different levels (packed into a single array) and a representation of the multi-level structure.

The notation used here assigns level to the input matrix, . Level 1 consists of the first set of coefficients computed: the vertical (), horizontal () and diagonal () coefficients are stored at this level while the approximation () coefficients are used as the input to a repeat of the wavelet transform at the next level. This process is continued until, at level , all four types of coefficients are stored. The output array, , stores these sets of coefficients in reverse order, starting with followed by .