itpp::MaxLloydQuantizer< T > Class Template Reference

This class implements an optimal scalar Max-Lloyd-Quantizer. More...

#include <MaxLloydQuantizer.h>

List of all members.

Public Member Functions

 MaxLloydQuantizer ()
 Constructor resulting in an uninitialized and untrained quantizer.
 MaxLloydQuantizer (unsigned int R)
 Constructor which initialize the quantizer.
 MaxLloydQuantizer (unsigned int R, itpp::Vec< T > trainingdata, double epsilon=1e-3, unsigned int max_iter=1e3, unsigned hist_size=1000)
 Constructor which initialize and train the quantizer.
virtual ~MaxLloydQuantizer ()
 Destructor.
bool train (const itpp::Vec< T > &trainingdata, double epsilon=1e-3, unsigned int max_iter=1e3)
 training method.
bool train2 (const itpp::Vec< T > &trainingdata, double epsilon=1e-3, unsigned int max_iter=1e3)
unsigned int getNumberOfQuantizerLevels () const
 Getter for the number of quantizer levels.
unsigned int getTargetRate () const
 Getter for the target rate.
bool isTrained () const
 Inspector for the trained state of the quantizer.
bool isInitialized () const
 Inspector for the initialized state of the quantizer.
void setTargetRate (unsigned int R)
 Setter for the target rate / number of quantization levels $N=2^R$. After calling this method, the quantizer is untrained again!
unsigned int quantize (T x)
 Quantization method. Quantize an input sample. Input samples smaller than the smallest training value will be quantized to 0, input samples greater than the biggest training value will be quantized to N-1.
inv_quant (unsigned int level)
 Inverse quantization method (fast, without range checks).

Protected Attributes

itpp::Vec< T > d
itpp::Vec< T > r
unsigned int Rate
unsigned int N
bool trained
bool initialized


Detailed Description

template<class T>
class itpp::MaxLloydQuantizer< T >

This class implements an optimal scalar Max-Lloyd-Quantizer.

Author:
Ruediger Knoerig
Examples:

main.cpp.


Constructor & Destructor Documentation

template<class T>
itpp::MaxLloydQuantizer< T >::MaxLloydQuantizer ( unsigned int  R  )  [inline]

Constructor which initialize the quantizer.

Parameters:
R Target rate (Number of quantizer levels = $2^R$).

template<class T>
itpp::MaxLloydQuantizer< T >::MaxLloydQuantizer ( unsigned int  R,
itpp::Vec< T >  trainingdata,
double  epsilon = 1e-3,
unsigned int  max_iter = 1e3,
unsigned  hist_size = 1000 
) [inline]

Constructor which initialize and train the quantizer.

Parameters:
R Target rate (Number of quantizer levels = $2^R$).
trainingdata Data to train the quantizer.
epsilon Terminate iteration if $|\vec{d}_{n+1}-\vec{d}_n|\leq \epsilon$
max_iter Maximum number of iterations.
hist_size Number of histogram bins


Member Function Documentation

template<class T>
unsigned int itpp::MaxLloydQuantizer< T >::getNumberOfQuantizerLevels (  )  const [inline]

Getter for the number of quantizer levels.

Returns:
Number of quantizer levels.

template<class T>
unsigned int itpp::MaxLloydQuantizer< T >::getTargetRate (  )  const [inline]

Getter for the target rate.

Returns:
Target rate of the quantizer.

template<class T >
T itpp::MaxLloydQuantizer< T >::inv_quant ( unsigned int  level  )  [inline]

Inverse quantization method (fast, without range checks).

Parameters:
level quantizer level index.
Returns:
reconstruction value

template<class T>
bool itpp::MaxLloydQuantizer< T >::isTrained (  )  const [inline]

Inspector for the trained state of the quantizer.

Returns:
True if the quantizer has been trained.

template<class T >
unsigned int itpp::MaxLloydQuantizer< T >::quantize ( x  )  [inline]

Quantization method. Quantize an input sample. Input samples smaller than the smallest training value will be quantized to 0, input samples greater than the biggest training value will be quantized to N-1.

Parameters:
Input sample.
Returns:
Quantized value of x.

template<class T>
void itpp::MaxLloydQuantizer< T >::setTargetRate ( unsigned int  R  )  [inline]

Setter for the target rate / number of quantization levels $N=2^R$. After calling this method, the quantizer is untrained again!

Parameters:
R new target rate.

template<class T >
bool itpp::MaxLloydQuantizer< T >::train ( const itpp::Vec< T > &  trainingdata,
double  epsilon = 1e-3,
unsigned int  max_iter = 1e3 
) [inline]

training method.

Parameters:
trainingdata Data to train the quantizer.
epsilon Terminate iteration if $|\vec{d}_{n+1}-\vec{d}_n|\leq \epsilon$
max_iter Maximum number of iterations.
Returns:
True if $|\vec{r}_{n+1}-\vec{r}_n|\leq \epsilon$ has been reached.


Member Data Documentation

template<class T>
itpp::Vec<T> itpp::MaxLloydQuantizer< T >::d [protected]

Quantizer cell bounds

template<class T>
bool itpp::MaxLloydQuantizer< T >::initialized [protected]

flag indicating that the quantizer has been initialized

template<class T>
unsigned int itpp::MaxLloydQuantizer< T >::N [protected]

number of quantization levels

template<class T>
itpp::Vec<T> itpp::MaxLloydQuantizer< T >::r [protected]

reconstruction values

template<class T>
unsigned int itpp::MaxLloydQuantizer< T >::Rate [protected]

target rate for the quantizer

template<class T>
bool itpp::MaxLloydQuantizer< T >::trained [protected]

flag indicating if the quantizer has been trained


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

Generated on Thu Feb 19 13:56:18 2009 for MaxLloydQuantisierer by  doxygen 1.5.8