Table of Contents
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.
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. |
class name(s) | orthogonal | symmetric | hilbert pair |
zero | yes | yes | no |
daubechies | yes | no | no |
coiflet | yes | almost | no |
rcoiflet_1, rcoiflet_2, rcoiflet_3 | yes | almost | no |
triangle | no | yes | no |
antonini | no | yes | no |
near_sym_A, near_sym_B | no | almost | no |
qshift_A, qshift_B, qshift_C, qshift_D, qshift_32, qshift_D2 | yes | almost | yes |
selesnick | yes | no | yes |
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.
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 |
filter name(s) | predefined | runtime |
zero | no | yes |
daubechies | up to order 10, double precision | yes |
coiflet | up to order 5, single precision | no |
rcoiflet_1, rcoiflet_2 | double precision | yes |
rcoiflet_3 | double precision | no |
triangle | double precision | no |
antonini | double precision | no |
qshift_A, qshift_B, qshift_C, qshift_D, qshift_32, qshift_D2 | double precision | no |
selesnick | double precision | no |