naginterfaces.library.wav.dim2_​coeff_​ins

naginterfaces.library.wav.dim2_coeff_ins(ilev, cindex, c, d, comm)[source]

dim2_coeff_ins 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 dim2_multi_inv().

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

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/c09/c09ezf.html

Parameters
ilevint

The level at which coefficients are to be inserted.

cindexint

Identifies which coefficients to insert. The coefficients are identified as follows:

The approximation coefficients, produced by application of the low pass filter over columns and rows of the original matrix (LL). The approximation coefficients are present only for , where is the value used in a preceding call to dim2_multi_fwd().

The vertical detail coefficients produced by applying the low pass filter over columns of the original matrix and the high pass filter over rows (LH).

The horizontal detail coefficients produced by applying the high pass filter over columns of the original matrix and the low pass filter over rows (HL).

The diagonal detail coefficients produced by applying the high pass filter over columns and rows of the original matrix (HH).

cfloat, array-like, shape

Contains the DWT coefficients inserted by previous calls to dim2_coeff_ins, or computed by a previous call to dim2_multi_fwd().

dfloat, array-like, shape

The coefficients to be inserted.

If (as used in dim2_multi_fwd()) and , the manipulated approximation coefficients must be stored in , for , for .

Otherwise the manipulated level detail coefficients (of type specified by ) must be stored in , for , for .

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

Contains the same DWT coefficients provided on entry except for those identified by and , which are updated with the values supplied in , inserted into the correct locations as expected by the reconstruction function dim2_multi_inv().

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: , where is the number of levels used in the call to dim2_multi_fwd().

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: , where is the number of DWT coefficients computed in a previous call to dim2_multi_fwd().

(errno )

On entry, and , but .

Constraint: when in the preceding call to dim2_multi_fwd().

(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_coeff_ins inserts a selected set of two-dimensional DWT coefficients into the full set of coefficients stored in compact form in a one-dimensional array . It is required that dim2_coeff_ins is preceded by a call to the initialization function dim2_init() and the forward multi-level transform function dim2_multi_fwd().

Given an initial two-dimensional data set , a prior call to dim2_multi_fwd() computes the approximation coefficients (at the highest requested level) and three sets of detail coefficients at all levels and stores these in compact form in a one-dimensional array . dim2_coeff_ext() can then extract either the approximation coefficients or one of the sets of detail coefficients at one of the levels into a two-dimensional array, . Following some calculation on this set of coefficients (for example, denoising), the updated coefficients in are inserted back into the full set using dim2_coeff_ins. Several extractions and insertions may be performed at different levels. dim2_multi_inv() can then be used to reconstruct a manipulated data set . The dimensions of depend on the level extracted and are available from the arrays and as returned by dim2_multi_fwd() which contain the first and second dimensions respectively. See the C09 Introduction for a discussion of the multi-level two-dimensional DWT.