General Wavelet class. More...
#include <Wavelet.h>
Classes | |
class | LiftingStep |
Instances define a lifting step in a wavelet lifting scheme. More... | |
class | WaveletComponent |
Superclass for LiftingStep and other possible components / operations defining a wavelet. More... | |
Public Member Functions | |
const std::string & | name () const |
Get the name of the wavelet. | |
bool | integerCompatible () const |
Query if wavelet is integer compatible. | |
bool | normalized () const |
Query if wavelet and scaling coefficients are normalized after lifting. | |
int | steps () const |
Get number of steps in the lifting scheme. | |
const LiftingStep & | liftingStep (int i) const |
Get a step of the lifting scheme. | |
double | normS () const |
Get the normalization factor for the scaling coefficients. | |
double | normD () const |
Get the normalization factor for the wavelet coefficients. | |
bool | operator== (const Wavelet &w) const |
Compare with another wavelet. | |
template<class tp_Type > | |
void | lift (blitz::Array< tp_Type, 1 > &s, blitz::Array< tp_Type, 1 > &d, ExtensionMode be=CONSTANT_EXT) const |
Apply the lifting scheme on the data channels s and d. | |
template<class tp_Type > | |
void | invLift (blitz::Array< tp_Type, 1 > &s, blitz::Array< tp_Type, 1 > &d, ExtensionMode be=CONSTANT_EXT) const |
Apply the inverse lifting scheme on the data channels s and d. | |
blitz::Array< double, 1 > | forwardFkt (unsigned int size=1<< 9, int scale=6, unsigned int trans=3) const |
Get sampled values (i.e. the form) of the forward transformation scaling or wavelet function. | |
blitz::Array< double, 1 > | inverseFkt (unsigned int size=1<< 9, int scale=6, unsigned int trans=3) const |
Get sampled values (i.e. the form) of the inverse transformation scaling or wavelet function. | |
Wavelet () | |
Construct an empty wavelet. | |
Wavelet (const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1) | |
Construct a wavelet and it's lifting scheme. | |
Wavelet (const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1, const LiftingStep &s2) | |
Wavelet (const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1, const LiftingStep &s2, const LiftingStep &s3) | |
Static Public Member Functions | |
static bool | equals (double x, double y) |
Compare two numbers within numeric limits. | |
Protected Attributes | |
std::string | m_spec |
double | m_nS |
double | m_nD |
std::vector< LiftingStep > | m_steps |
General Wavelet class.
Instances define specific lifting schemes and therefore specific wavelets. Keep your lifting steps integer compatible if you want do operate on both integer an floating point data-types. Some constant instances of this class are available for instant usage, for example WL_HAAR
and WL_D_4
.
bwave::Wavelet::Wavelet | ( | const std::string & | name, |
double | ns, | ||
double | nd, | ||
const LiftingStep & | s0, | ||
const LiftingStep & | s1 | ||
) |
Construct a wavelet and it's lifting scheme.
name | the name of the wavelet. |
ns | normalization factor for scaling coefficients. |
nd | normalization factor for wavelet coefficients. |
s0 | first lifting step. |
s1 | second lifting step, more steps can be specified. |
The normalisation factors can later be queried using normS() and normD().
bwave::Wavelet::Wavelet | ( | const std::string & | name, |
double | ns, | ||
double | nd, | ||
const LiftingStep & | s0, | ||
const LiftingStep & | s1, | ||
const LiftingStep & | s2 | ||
) |
bwave::Wavelet::Wavelet | ( | const std::string & | name, |
double | ns, | ||
double | nd, | ||
const LiftingStep & | s0, | ||
const LiftingStep & | s1, | ||
const LiftingStep & | s2, | ||
const LiftingStep & | s3 | ||
) |
bool bwave::Wavelet::equals | ( | double | x, |
double | y | ||
) | [static] |
Compare two numbers within numeric limits.
true
if x
and y
and (almost) equal, false
if not. Referenced by bwave::Wavelet::LiftingStep::operator==(), and operator==().
blitz::Array< double, 1 > bwave::Wavelet::forwardFkt | ( | ) | const |
Get sampled values (i.e. the form) of the forward transformation scaling or wavelet function.
size | number of samples. |
scale | the scale of the function, use positive values to generate scaling, negative values to generate wavelet functions. |
trans | the translation of the function. |
Useful for getting the data to plot wavelet and scaling functions. Use a higher number of samples for better resolution.
References bwave::WaveletDecomp< tp_rank >::apply(), bwave::WaveletDecomp< tp_rank >::coeffs(), and bwave::WaveletDecomp< tp_rank >::normFactor().
bool bwave::Wavelet::integerCompatible | ( | ) | const |
Query if wavelet is integer compatible.
true
if wavelet is integer compatible, false
if not.Integer compatibility means that wavelet decomposition and reconstruction do not use floating point operations on the data. Wavelet decomposition and reconstruction may still lead to information loss on integer data if the lifting scheme contains scaling steps.
Not implemented yet!
blitz::Array< double, 1 > bwave::Wavelet::inverseFkt | ( | ) | const |
Get sampled values (i.e. the form) of the inverse transformation scaling or wavelet function.
References bwave::WaveletDecomp< tp_rank >::applyInv(), bwave::WaveletDecomp< tp_rank >::coeffs(), and bwave::WaveletDecomp< tp_rank >::normFactor().
void bwave::Wavelet::invLift | ( | blitz::Array< tp_Type, 1 > & | s, |
blitz::Array< tp_Type, 1 > & | d, | ||
ExtensionMode | be = CONSTANT_EXT |
||
) | const |
Apply the inverse lifting scheme on the data channels s and d.
s | usually initialised with the scaling coefficients. |
d | usually initialised with the wavelet coefficients. |
be | extension method to use for boundary handling. |
References bwave::Wavelet::LiftingStep::apply(), liftingStep(), and steps().
void bwave::Wavelet::lift | ( | blitz::Array< tp_Type, 1 > & | s, |
blitz::Array< tp_Type, 1 > & | d, | ||
ExtensionMode | be = CONSTANT_EXT |
||
) | const |
Apply the lifting scheme on the data channels s and d.
s | usually initialised with the even original data values, contains the scaling coefficients after lifting. |
d | usually initialised with the odd original data values, contains the wavelet coefficients after lifting. |
be | extension method to use for boundary handling. |
References bwave::Wavelet::LiftingStep::apply(), liftingStep(), and steps().
const LiftingStep& bwave::Wavelet::liftingStep | ( | int | i | ) | const [inline] |
Get a step of the lifting scheme.
i | index of the step to get (0 <= i < steps()). |
Referenced by invLift(), lift(), and operator==().
bool bwave::Wavelet::normalized | ( | ) | const |
double bwave::Wavelet::normD | ( | ) | const [inline] |
Get the normalization factor for the wavelet coefficients.
Referenced by operator==().
double bwave::Wavelet::normS | ( | ) | const [inline] |
Get the normalization factor for the scaling coefficients.
Wavelet and scaling coefficients are not automatically normalized after lifting, otherwise integer applications would not be possible.
Referenced by operator==().
bool bwave::Wavelet::operator== | ( | const Wavelet & | w | ) | const |
Compare with another wavelet.
w | the wavelet to compare with. |
true
if the wavelets are equal, false
if not. References equals(), liftingStep(), normD(), normS(), and steps().