Go to the documentation of this file.
35 #include <itpp/itexports.h>
74 vec decode(
int Index)
const;
80 vec operator()(
const vec &x);
112 double latest_distortion();
164 double decode(
int Index)
const;
168 double Q(
double x)
const;
170 vec
Q(
const vec &x)
const;
172 double operator()(
double x)
const;
174 vec operator()(
const vec &x)
const;
176 void set_levels(
const vec &L);
178 vec get_levels()
const;
208 #endif // #ifndef VQ_H
int nobits() const
Returns the number of bits of the VQ [log2(size)/dim].
double Q(double x) const
Quantize.
void set_levels(const vec &L)
Initialize the codebook by a matrix.
void set_codebook(const mat &CB)
Initialize the codebook by a matrix.
ivec encode(const vec &x, int num)
Encode the input vector, and return the num best indices.
Array< vec > decode(const ivec &Index) const
Decode the indices.
double decode(int Index) const
Decode the index.
double scalar_quantize(double x, vec &Levels)
ADD DOCUMENTATION HERE.
Class for vector quantization.
Vector_Quantizer()
Default constructor.
double latest_distortion()
Returns the distortion at the latest time a vector was encoded.
vec get_levels() const
Returns the codebook.
vec CodeBook
The vector containing the code book.
int size() const
Returns the size (number of codevectors) of the VQ.
int Size
The size of the code book.
int size(const Vec< T > &v)
Length of vector.
int encode(const vec &x)
Encode the input vector.
void set_codevector(int Index, const vec &indata)
Set a codevector in the codebook.
Scalar_Quantizer()
Default constructor.
int dim() const
Returns the dimension of the VQ.
double LatestDist
The distortion at the latest time a vector was encoded.
vec decode(const ivec &Index) const
Decode the indices.
mat get_codebook() const
Returns the codebook.
vec Q(const vec &x)
Quantize the input vector.
double LatestDist
The distortion at the latest time a vector was encoded.
ivec encode(const vec &x) const
Encode the input vector.
double operator()(double x) const
Quantize.
vec Q(const vec &x) const
Quantize the input vector.
ITPP_EXPORT int scalar_encode(double x, vec &Levels)
ADD DOCUMENTATION HERE.
void modify_codevector(int no, double mul, const vec &add)
Rescale and translate a codevector.
void save(const char *Name) const
Save the codebook to a file.
void load(const char *Name)
Load the codebook from a file.
Class for vector quantization.
vec Levels
The vector containing the code book.
vec operator()(const vec &x)
Quantize the input vector.
Templated Vector Class Definitions.
vec decode(int Index) const
Decode the index.
int levels2bits(int n)
Calculate the number of bits needed to represent n different values (levels).
Automatic naming when saving.
Logarithmic and exponenential functions - header file.
Vector_Quantizer(const char *Name)
Create a VQ from a VQ file.
Scalar_Quantizer(const char *Name)
Create a VQ from a VQ file.
int encode(double x) const
Encode.
int Dim
The dimension of the code book.
int size() const
Returns the size (number of codevectors) of the VQ.
vec get_codevector(int Index) const
Returns the codevector at the given index.
Generated on Thu Apr 11 2019 00:00:00 for IT++ by Doxygen 1.8.18