Represents a specific wavelet decomposition. More...
#include <WaveletDecomp.h>
Public Member Functions | |
const Wavelet & | wavelet () const |
Get the wavelet used in this decomposition. | |
DecompType | decompType () const |
Get the type of this decomposition (i.e. standard or non-standard). | |
int | maxLevel () const |
Get the maximum decomposition level. | |
CoeffStorage | storageMode () const |
Get the mode in which the wavelet/scaling coefficients are stored. | |
CoeffStorage | storageMode (CoeffStorage newCS) |
Set the mode in which the wavelet/scaling coefficients are stored. | |
ExtensionMode | extensionMode () const |
Get the current method used for boundary handling / array extension. | |
ExtensionMode | extensionMode (ExtensionMode newEM) |
Set the method to be used for boundary handling / array extension. | |
const blitz::TinyVector< bool, tp_rank > & | selectedDims () |
Get the selected dimensions. | |
bool | dimSelected (int dim) const |
Query if decomposition will be applied in array dimension dim . | |
blitz::TinyVector< bool, tp_rank > | dimSelection () const |
Get the dimensions selected for decomposition. | |
blitz::TinyVector< bool, tp_rank > | dimSelection (blitz::TinyVector< bool, tp_rank > selection) |
Select the dimensions in which to apply the wavelet decomposition. | |
template<class tp_Type > | |
blitz::TinyVector< int, tp_rank > | apply (blitz::Array< tp_Type, tp_rank > &data) const |
Apply this wavelet decomposition to a data array. | |
template<class tp_Type > | |
blitz::TinyVector< int, tp_rank > | applyInv (blitz::Array< tp_Type, tp_rank > &data) const |
Apply the inverse wavelet transformation. | |
template<class tp_Type > | |
blitz::Array < blitz::TinyVector< int, tp_rank >, 1 > | indices (blitz::Array< tp_Type, tp_rank > &data) const |
Get the indices of the coefficients that this decomposition will/has produce(d) for the given data. | |
template<class tp_Type > | |
blitz::Array< tp_Type, tp_rank > | coeffs (blitz::Array< tp_Type, tp_rank > &data, blitz::TinyVector< int, tp_rank > indices) const |
Get all wavelet/scaling coefficients of the same type (i.e. corresponding to basis functions differing only by translation) | |
double | normFactor (blitz::TinyVector< int, tp_rank > indices) const |
Get the normalization factor for the specified coefficient type. | |
WaveletDecomp (WaveletDecomp< tp_rank > other, CoeffStorage cs) | |
Copy other decomposition while changing coefficient storage mode. | |
WaveletDecomp (Wavelet wl, DecompType decomp=NONSTD_DECOMP, int maxlevel=0, CoeffStorage cs=NESTED_COEFFS, ExtensionMode em=CONSTANT_EXT) | |
Construct a new wavelet decomposition. | |
Protected Member Functions | |
template<class tp_Type > | |
void | trafoStep (blitz::Array< tp_Type, tp_rank > &data, int targetDim, bool inverse) const |
template<class tp_Type > | |
blitz::TinyVector< int, tp_rank > | waveletDecompose (blitz::Array< tp_Type, tp_rank > &data, int maxlevel=0) const |
template<class tp_Type > | |
blitz::TinyVector< int, tp_rank > | waveletRecompose (blitz::Array< tp_Type, tp_rank > &data, int maxlevel=0) const |
Protected Attributes | |
Wavelet | m_wavelet |
DecompType | m_decomp |
CoeffStorage | m_storageMode |
ExtensionMode | m_extMode |
int | m_maxLevel |
blitz::TinyVector< bool, tp_rank > | m_dimSelect |
Represents a specific wavelet decomposition.
Instances of WaveletDecomp specify the details of a wavelet decomposition, which can then be applied to data of any type but fixed dimensionality. The data dimensionality is set with the template parameter tp_rank
.
bwave::WaveletDecomp< tp_rank >::WaveletDecomp | ( | WaveletDecomp< tp_rank > | other, |
CoeffStorage | cs | ||
) | [inline] |
Copy other decomposition while changing coefficient storage mode.
other | Decomposition to copy |
cs | Coefficient storage mode |
Useful to work with data in different coefficient storage modes.
bwave::WaveletDecomp< tp_rank >::WaveletDecomp | ( | Wavelet | wl, |
DecompType | decomp = NONSTD_DECOMP , |
||
int | maxlevel = 0 , |
||
CoeffStorage | cs = NESTED_COEFFS , |
||
ExtensionMode | em = CONSTANT_EXT |
||
) | [inline] |
Construct a new wavelet decomposition.
wavelet | Wavelet to use in the decomposition. |
decomp | Decomposition type. |
maxlevel | Maximum decomposition depth |
cs | Coefficient storage mode |
em | Internal array extension / boundary handling method |
The decomposition can directly be applied to data after construction, no further preparation is necessary.
blitz::TinyVector<int, tp_rank> bwave::WaveletDecomp< tp_rank >::apply | ( | blitz::Array< tp_Type, tp_rank > & | data | ) | const [inline] |
Apply this wavelet decomposition to a data array.
data | The data to be decomposed. |
Does a wavelet decomposition given on the given data. The data is wavelet-decomposed in-place, storageMode() must be NESTED_COEFFS
. Afterwards, data array contains the wavelet/scaling coefficients, use the coeffs
(..) method for coefficient access.
References bwave::WaveletDecomp< tp_rank >::storageMode().
Referenced by bwave::Wavelet::forwardFkt().
blitz::TinyVector<int, tp_rank> bwave::WaveletDecomp< tp_rank >::applyInv | ( | blitz::Array< tp_Type, tp_rank > & | data | ) | const [inline] |
Apply the inverse wavelet transformation.
data | The wavelet/scaling coefficients. |
Does a wavelet recomposition using the given coefficients. The recomposition is done in-place, storageMode() must be NESTED_COEFFS
. Afterwards, the data array contains the recomposed data.
References bwave::WaveletDecomp< tp_rank >::storageMode().
Referenced by bwave::Wavelet::inverseFkt().
blitz::Array< tp_Type, tp_rank > bwave::WaveletDecomp< tp_rank >::coeffs | ( | blitz::Array< tp_Type, tp_rank > & | data, |
blitz::TinyVector< int, tp_rank > | indices | ||
) | const |
Get all wavelet/scaling coefficients of the same type (i.e. corresponding to basis functions differing only by translation)
data | The decomposed data to extract the coefficients from. |
indices | An index vector specifying the coefficient type to extract. |
data
, but a reference to them.Wavelet decomposition of multi-dimensional, non-square data array produces coefficients coefficients corresponding to lots of scaled and translated basis functions, which are themselves mixed products of the basic scaling and wavelet function. Coefficients which differ only by the translation of their basic function are said here to be of the same type. These coefficient types are designated here by an index vector. It's components specify the factory of the basis function in the respective dimensions. A positive value specifies a scaling function, a negative one a wavelet function. The component's absolute value specifies the scale as an exponent of 2.
Example: Let Phi_i be the scaling, Psi_i be the wavelet function of scale i. Let the data have three dimensions x,y,z. Then the coefficients corresponding to the basis function Psi_4(x)*Phi_3(y)*Psi_3(z) would have the index vector (-4, 3, -3).
The bases function Phi_0 can be said to correspond to original, non-decomposed data. Therefore, if data is not decomposed in some dimensions, the only valid index vector component in these dimensions is 0.
indices
(...) can be used to get a list of valid index vectors. Referenced by bwave::Wavelet::forwardFkt(), and bwave::Wavelet::inverseFkt().
blitz::TinyVector<bool, tp_rank> bwave::WaveletDecomp< tp_rank >::dimSelection | ( | ) | const [inline] |
Get the dimensions selected for decomposition.
blitz::TinyVector<bool, tp_rank> bwave::WaveletDecomp< tp_rank >::dimSelection | ( | blitz::TinyVector< bool, tp_rank > | selection | ) | [inline] |
Select the dimensions in which to apply the wavelet decomposition.
selection | A boolean vector, set true for the dimensions in which to apply decomposition. |
The wavelet decomposition can be specified to work in all or only some dimensions (data directions). All possible combinations are valid.
ExtensionMode bwave::WaveletDecomp< tp_rank >::extensionMode | ( | ) | const [inline] |
Get the current method used for boundary handling / array extension.
ExtensionMode bwave::WaveletDecomp< tp_rank >::extensionMode | ( | ExtensionMode | newEM | ) | [inline] |
Set the method to be used for boundary handling / array extension.
newEM | The new array extension method. |
blitz::Array< blitz::TinyVector< int, tp_rank >, 1 > bwave::WaveletDecomp< tp_rank >::indices | ( | blitz::Array< tp_Type, tp_rank > & | data | ) | const |
Get the indices of the coefficients that this decomposition will/has produce(d) for the given data.
data | original data or transformed data. |
There method is useful if you want to iterate over all wavelet/scaling coefficients in the decomposed data. Since wavelet decomposition is done in-place, it does not matter whether this method is called before or after decomposition of the data, since the data extents (which determine the possible indices will stay the same.
Referenced by bwave::WaveletDecomp< tp_rank >::normFactor().
double bwave::WaveletDecomp< tp_rank >::normFactor | ( | blitz::TinyVector< int, tp_rank > | indices | ) | const [inline] |
Get the normalization factor for the specified coefficient type.
indices | The index vector specifying the coefficient type |
The Wavelet and scaling coefficients are not automatically normalized after decomposition, otherwise integer applications would not be possible. Also, normalisation is unneeded or even unwanted for some applications.
References bwave::WaveletDecomp< tp_rank >::indices(), and bwave::WaveletDecomp< tp_rank >::wavelet().
Referenced by bwave::Wavelet::forwardFkt(), and bwave::Wavelet::inverseFkt().
CoeffStorage bwave::WaveletDecomp< tp_rank >::storageMode | ( | ) | const [inline] |
Get the mode in which the wavelet/scaling coefficients are stored.
Referenced by bwave::WaveletDecomp< tp_rank >::apply(), and bwave::WaveletDecomp< tp_rank >::applyInv().
CoeffStorage bwave::WaveletDecomp< tp_rank >::storageMode | ( | CoeffStorage | newCS | ) | [inline] |
Set the mode in which the wavelet/scaling coefficients are stored.
newCS | the new storage mode |
Note that lifting-based operations (i.e. apply
(...) and applyInv
(...) only work in NESTED_COEFFS
mode.