Chapter VIII.2. Filters

Table of Contents

VIII.2.1. Descriptors
VIII.2.1.1. Concept
VIII.2.1.2. Table of predefined filter descriptors
VIII.2.2. Generators
VIII.2.2.1. Concepts
VIII.2.2.2. Table of available filter generators
VIII.2.2.3. Usage

Each wavelet family is characterized by one or several sequences of numbers called "filters". We consider only compactly support wavelets, in which case all filters have a finite length.

A single filter is sufficient to characterize an orthogonal wavelet family, whereas two filters are necessary to characterize a biorthogonal family. Four filters are necessary to characterize a biorthogonal complex-valued family.

The library relies on templates to cope with all these different cases. To generate appropriate filters, we rely on a "descriptor/generator" design pattern.

VIII.2.1. Descriptors

VIII.2.1.1. Concept

The Filter descriptor concept has the following types and constants :
typename filter_tag::Dual_t The dual filter, used by the inverse wavelet transform.
typename filter_tag::Hilbert_t (optional) The hilbert transform of the filter, used in the DTCWT.
const size_t filter_tag::static_size The length of the filter (number of taps).
const char* filter_tag::name A string describing the filter (e.g. Daubechies, Cohen, etc.).
const unsigned int filter_tag::midpoint The position of t=0 with respect to the first filter tap.

VIII.2.1.2. Table of predefined filter descriptors

class name(s)orthogonalsymmetrichilbert pair
zeroyesyesno
daubechiesyesnono
coifletyesalmostno
rcoiflet_1, rcoiflet_2, rcoiflet_3yesalmostno
trianglenoyesno
antonininoyesno
near_sym_A, near_sym_Bnoalmostno
qshift_A, qshift_B, qshift_C, qshift_D, qshift_32, qshift_D2yesalmostyes
selesnickyesnoyes

VIII.2.2. Generators

In most cases, one wants to provide the filter coefficients at compile time and be done with it. However, there are situations when it is better to incorporate the algorithm able to compute the filter coefficients in the code and generate them only at runtime. This happens for example if one wants to set the precision of the computation at runtime, using the GMP library.

VIII.2.2.1. Concepts

In order to leave the two options, of defining filter coefficients at run-time or at compile-time, two generator class templates have been defined : qmf_runtime and qmf_predefined.

Let filter_tag design a filter descriptor and TElem design a numeric type.

Valid specializations of qmf_runtime should satisfy the following requirements:

typename qmf_runtime<filter_tag,TElem>::Return_t The return type of the generator, which should behave like a boost::array of length filter_tag::static_size
qmf_runtime<filter_tag,TElem>::invoke() Returns the generated filter

Valid specializations of qmf_predefined should satisfy the following requirements:

typename qmf_predefined<filter_tag,TElem>::value_type The numeric type of the filter coefficients that are provided
qmf_predefined<filter_tag>::value A container behaving like a boost::array, containing filter_tag::static_size elements of type value_type

VIII.2.2.2. Table of available filter generators

filter name(s)predefinedruntime
zeronoyes
daubechiesup to order 10, double precisionyes
coifletup to order 5, single precisionno
rcoiflet_1, rcoiflet_2double precisionyes
rcoiflet_3double precisionno
triangledouble precisionno
antoninidouble precisionno
qshift_A, qshift_B, qshift_C, qshift_D, qshift_32, qshift_D2double precisionno
selesnickdouble precisionno

VIII.2.2.3. Usage