#include <itpp/srccode/vq.h>
Public Member Functions | |
Scalar_Quantizer () | |
Default constructor. | |
Scalar_Quantizer (const char *Name) | |
Create a VQ from a VQ file. | |
int | encode (double x) const |
Encode. | |
ivec | encode (const vec &x) const |
Encode the input vector. | |
double | decode (int Index) const |
Decode the index. | |
vec | decode (const ivec &Index) const |
Decode the indices. | |
double | Q (double x) const |
Quantize. | |
vec | Q (const vec &x) const |
Quantize the input vector. | |
double | operator() (double x) const |
Quantize. | |
vec | operator() (const vec &x) const |
Quantize the input vector. | |
void | set_levels (const vec &L) |
Initialize the codebook by a matrix. | |
vec | get_levels () const |
Returns the codebook. | |
int | size () const |
Returns the size (number of codevectors) of the VQ. | |
Protected Attributes | |
vec | Levels |
The vector containing the code book. | |
double | LatestDist |
The distortion at the latest time a vector was encoded. |
The following code illustrates how the quantizer can be initialized from a file and used to quantize a random vector.
Scalar_Quantizer Quantizer; double x,y; int i; Quantizer.load("random.sq"); x=randn(); i=Quantizer.encode(x); y=Quantizer.decode(i);
Definition at line 153 of file vq.h.
|
Default constructor.
|
|
Create a VQ from a VQ file.
|
|
Encode.
Definition at line 277 of file vq.cpp. References itpp::Vec< Num_T >::length(), and Levels. |
|
Encode the input vector.
Definition at line 290 of file vq.cpp. References encode(), and itpp::Vec< Num_T >::length(). |
|
Decode the index.
Definition at line 189 of file vq.h. References Levels. |
|
Decode the indices.
Definition at line 301 of file vq.cpp. References decode(), and itpp::Vec< Num_T >::length(). |
|
Quantize.
Definition at line 190 of file vq.h. References decode(), and encode(). Referenced by operator()(), and Q(). |
|
Quantize the input vector.
Definition at line 312 of file vq.cpp. References itpp::Vec< Num_T >::length(), and Q(). |
|
Quantize.
Definition at line 191 of file vq.h. References Q(). |
|
Quantize the input vector.
Definition at line 192 of file vq.h. References Q(). |
|
Initialize the codebook by a matrix.
Definition at line 193 of file vq.h. References Levels. |
|
Returns the codebook.
|
|
Returns the size (number of codevectors) of the VQ.
Definition at line 188 of file vq.h. References itpp::Vec< Num_T >::length(), and Levels. |
|
The vector containing the code book.
Definition at line 183 of file vq.h. Referenced by decode(), encode(), set_levels(), and size(). |
|
The distortion at the latest time a vector was encoded.
|
Generated on Fri Jan 11 08:51:43 2008 for IT++ by Doxygen 1.3.9.1