bwave::WaveletDecomp< tp_rank > Class Template Reference

Represents a specific wavelet decomposition. More...

#include <WaveletDecomp.h>

List of all members.

Public Member Functions

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).
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.
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 (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


Detailed Description

template<int tp_rank>
class bwave::WaveletDecomp< tp_rank >

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.


Constructor & Destructor Documentation

template<int tp_rank>
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.

Parameters:
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.

See also:
apply(blitz::Array<tp_Type,tp_rank> &data)

applyInv(blitz::Array<tp_Type,tp_rank> &data)


Member Function Documentation

template<int tp_rank>
CoeffStorage bwave::WaveletDecomp< tp_rank >::storageMode (  )  const [inline]

Get the mode in which the wavelet/scaling coefficients are stored.

See also:
CoeffStorage

Referenced by bwave::WaveletDecomp< tp_rank >::apply(), bwave::WaveletDecomp< tp_rank >::applyInv(), and bwave::WaveletDecomp< tp_rank >::coeffs().

template<int tp_rank>
CoeffStorage bwave::WaveletDecomp< tp_rank >::storageMode ( CoeffStorage  newCS  )  [inline]

Set the mode in which the wavelet/scaling coefficients are stored.

Parameters:
newCS the new storage mode
Note that lifting-based operations (i.e. apply(...) and applyInv(...) only work in NESTED_COEFFS mode.
See also:
CoeffStorage

template<int tp_rank>
ExtensionMode bwave::WaveletDecomp< tp_rank >::extensionMode (  )  const [inline]

Get the current method used for boundary handling / array extension.

See also:
ExtensionMode

template<int tp_rank>
ExtensionMode bwave::WaveletDecomp< tp_rank >::extensionMode ( ExtensionMode  newEM  )  [inline]

Set the method to be used for boundary handling / array extension.

Parameters:
newEM The new array extension method.
See also:
ExtensionMode

template<int tp_rank>
blitz::TinyVector<bool, tp_rank> bwave::WaveletDecomp< tp_rank >::dimSelection (  )  const [inline]

Get the dimensions selected for decomposition.

See also:
dimSelection(blitz::TinyVector<bool, tp_rank> selection)

template<int tp_rank>
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.

Parameters:
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.

template<int tp_rank>
template<class tp_Type>
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.

Parameters:
data The data to be decomposed.
Returns:
A vector of the decomposition depths in the different data dimensions.
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.
See also:
coeffs(blitz::Array<tp_Type,tp_rank> &data, blitz::TinyVector<int, tp_rank> indices)

References bwave::WaveletDecomp< tp_rank >::storageMode().

template<int tp_rank>
template<class tp_Type>
blitz::TinyVector<int, tp_rank> bwave::WaveletDecomp< tp_rank >::applyInv ( blitz::Array< tp_Type, tp_rank > &  data  )  const [inline]

Apply the inverse wavelet transformation.

Parameters:
data The wavelet/scaling coefficients.
Returns:
A vector of the recomposition depths in the different data dimensions.
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().

template<int tp_rank>
template<class tp_Type>
blitz::Array< blitz::TinyVector< int, tp_rank >, 1 > bwave::WaveletDecomp< tp_rank >::indices ( blitz::Array< tp_Type, tp_rank > &  data  )  const [inline]

Get the indices of the coefficients that this decomposition will/has produce(d) for the given data.

Parameters:
data original data or transformed data.
Returns:
An array of coefficient scaling indices which occur in the decomposed 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.

See also:
coeffs(blitz::Array<tp_Type,tp_rank> &data, blitz::TinyVector<int, tp_rank> indices)

References bwave::WaveletDecomp< tp_rank >::decompType(), and bwave::WaveletDecomp< tp_rank >::dimSelected().

Referenced by bwave::WaveletDecomp< tp_rank >::coeffs(), and bwave::WaveletDecomp< tp_rank >::normFactor().

template<int tp_rank>
template<class tp_Type>
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 [inline]

Get all wavelet/scaling coefficients of the same type (i.e. corresponding to basis functions differing only by translation).

Parameters:
data The decomposed data to extract the coefficients from.
indices An index vector specifying the coefficient type to extract.
Returns:
An array of the coefficients. This not a copy of the relevant parts of 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.

Note:
This method does not check if the requested coefficient type exists for this decomposition and the given coefficient data. The method indices(...) can be used to get a list of valid index vectors.

References bwave::WaveletDecomp< tp_rank >::indices(), and bwave::WaveletDecomp< tp_rank >::storageMode().

template<int tp_rank>
double bwave::WaveletDecomp< tp_rank >::normFactor ( blitz::TinyVector< int, tp_rank >  indices  )  const [inline]

Get the normalization factor for the specified coefficient type.

Parameters:
indices The index vector specifying the coefficient type
Returns:
The factor needed to normalize the coefficients.
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().


The documentation for this class was generated from the following file:

Generated on Wed Jul 23 11:37:01 2008 by  doxygen 1.5.5