NAG Library Function Document

nag_wfilt_3d (c09acc)

 Contents

    1  Purpose
    7  Accuracy

1
Purpose

nag_wfilt_3d (c09acc) returns the details of the chosen three-dimensional discrete wavelet filter. For a chosen mother wavelet, discrete wavelet transform type (single-level or multi-level DWT) and end extension method, this function returns the maximum number of levels of resolution (appropriate to a multi-level transform), the filter length, the total number of coefficients and the number of wavelet coefficients in the second and third dimensions for the single-level case. This function must be called before any of the three-dimensional transform functions in this chapter.

2
Specification

#include <nag.h>
#include <nagc09.h>
void  nag_wfilt_3d (Nag_Wavelet wavnam, Nag_WaveletTransform wtrans, Nag_WaveletMode mode, Integer m, Integer n, Integer fr, Integer *nwlmax, Integer *nf, Integer *nwct, Integer *nwcn, Integer *nwcfr, Integer icomm[], NagError *fail)

3
Description

Three-dimensional discrete wavelet transforms (DWT) are characterised by the mother wavelet, the end extension method and whether multiresolution analysis is to be performed. For the selected combination of choices for these three characteristics, and for given dimensions (m×n×fr) of data array A, nag_wfilt_3d (c09acc) returns the dimension details for the transform determined by this combination. The dimension details are: lmax, the maximum number of levels of resolution that would be computed were a multi-level DWT applied; nf, the filter length; nct the total number of wavelet coefficients (over all levels in the multi-level DWT case); ncn, the number of coefficients in the second dimension for a single-level DWT; and ncfr, the number of coefficients in the third dimension for a single-level DWT. These values are also stored in the communication array icomm, as are the input choices, so that they may be conveniently communicated to the three-dimensional transform functions in this chapter.

4
References

None.

5
Arguments

1:     wavnam Nag_WaveletInput
On entry: the name of the mother wavelet. See the c09 Chapter Introduction for details.
wavnam=Nag_Haar
Haar wavelet.
wavnam=Nag_Daubechiesn, where n=2,3,,10
Daubechies wavelet with n vanishing moments (2n coefficients). For example, wavnam=Nag_Daubechies4 is the name for the Daubechies wavelet with 4 vanishing moments (8 coefficients).
wavnam=Nag_Biorthogonalx_y, where x_y can be one of 1_1, 1_3, 1_5, 2_2, 2_4, 2_6, 2_8, 3_1, 3_3, 3_5 or 3_7
Biorthogonal wavelet of order x.y. For example wavnam=Nag_Biorthogonal1_1 is the name for the Biorthogonal wavelet of order 1.1.
Constraint: wavnam=Nag_Haar, Nag_Daubechies2, Nag_Daubechies3, Nag_Daubechies4, Nag_Daubechies5, Nag_Daubechies6, Nag_Daubechies7, Nag_Daubechies8, Nag_Daubechies9, Nag_Daubechies10, Nag_Biorthogonal1_1, Nag_Biorthogonal1_3, Nag_Biorthogonal1_5, Nag_Biorthogonal2_2, Nag_Biorthogonal2_4, Nag_Biorthogonal2_6, Nag_Biorthogonal2_8, Nag_Biorthogonal3_1, Nag_Biorthogonal3_3, Nag_Biorthogonal3_5 or Nag_Biorthogonal3_7.
2:     wtrans Nag_WaveletTransformInput
On entry: the type of discrete wavelet transform that is to be applied.
wtrans=Nag_SingleLevel
Single-level decomposition or reconstruction by discrete wavelet transform.
wtrans=Nag_MultiLevel
Multiresolution, by a multi-level DWT or its inverse.
Constraint: wtrans=Nag_SingleLevel or Nag_MultiLevel.
3:     mode Nag_WaveletModeInput
On entry: the end extension method.
mode=Nag_Periodic
Periodic end extension.
mode=Nag_HalfPointSymmetric
Half-point symmetric end extension.
mode=Nag_WholePointSymmetric
Whole-point symmetric end extension.
mode=Nag_ZeroPadded
Zero end extension.
Constraint: mode=Nag_Periodic, Nag_HalfPointSymmetric, Nag_WholePointSymmetric or Nag_ZeroPadded.
4:     m IntegerInput
On entry: the number of elements, m, in the first dimension (number of rows of each two-dimensional frame) of the input data, A.
Constraint: m2.
5:     n IntegerInput
On entry: the number of elements, n, in the second dimension (number of columns of each two-dimensional frame) of the input data, A.
Constraint: n2.
6:     fr IntegerInput
On entry: the number of elements, fr, in the third dimension (number of frames) of the input data, A.
Constraint: fr2.
7:     nwlmax Integer *Output
On exit: the maximum number of levels of resolution, lmax, that can be computed if a multi-level discrete wavelet transform is applied (wtrans=Nag_MultiLevel). It is such that 2lmax minm,n,fr <2lmax+1, for lmax an integer.
If wtrans=Nag_SingleLevel, nwlmax is not set.
8:     nf Integer *Output
On exit: the filter length, nf, for the supplied mother wavelet. This is used to determine the number of coefficients to be generated by the chosen transform.
9:     nwct Integer *Output
On exit: the total number of wavelet coefficients, nct, that will be generated. When wtrans=Nag_SingleLevel the number of rows required (i.e., the first dimension of each two-dimensional frame) in each of the output coefficient arrays can be calculated as ncm=nct/8×ncn×ncfr. When wtrans=Nag_MultiLevel the length of the array used to store all of the coefficient matrices must be at least nct.
10:   nwcn Integer *Output
On exit: for a single-level transform (wtrans=Nag_SingleLevel), the number of coefficients that would be generated in the second dimension, ncn, for each coefficient type. For a multi-level transform (wtrans=Nag_MultiLevel) this is set to 1.
11:   nwcfr Integer *Output
On exit: for a single-level transform (wtrans=Nag_SingleLevel), the number of coefficients that would be generated in the third dimension, ncfr, for each coefficient type. For a multi-level transform (wtrans=Nag_MultiLevel) this is set to 1.
12:   icomm[260] IntegerCommunication Array
On exit: contains details of the wavelet transform and the problem dimension which is to be communicated to the two-dimensional discrete transform functions in this chapter.
13:   fail NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

6
Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, fr=value.
Constraint: fr2.
On entry, m=value.
Constraint: m2.
On entry, n=value.
Constraint: n2.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

Not applicable.

8
Parallelism and Performance

nag_wfilt_3d (c09acc) is not threaded in any implementation.

9
Further Comments

None.

10
Example

This example computes the three-dimensional multi-level resolution for 8×8×8 input data by a discrete wavelet transform using the Daubechies wavelet with four vanishing moments (see wavnam=Nag_Daubechies4 in nag_wfilt_3d (c09acc)) and zero end extension. The number of levels of transformation actually performed is one less than the maximum possible. This number of levels, the length of the wavelet filter, the total number of coefficients and the number of coefficients in each dimension for each level are printed along with the approximation coefficients before a reconstruction is performed. This example also demonstrates in general how to access any set of coefficients at any level following a multi-level transform.

10.1
Program Text

Program Text (c09acce.c)

10.2
Program Data

Program Data (c09acce.d)

10.3
Program Results

Program Results (c09acce.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017