Go to the documentation of this file.
35 #include <itpp/itexports.h>
70 int encode(
const vec &x);
72 ivec encode(
const vec &x,
int num);
74 vec decode(
int Index)
const;
80 vec operator()(
const vec &x);
82 void set_codebook(
const mat &CB);
84 mat get_codebook()
const;
86 void set_codevector(
int Index,
const vec &indata);
88 vec get_codevector(
int Index)
const;
90 void modify_codevector(
int no,
double mul,
const vec &add);
103 void load(
const char *
Name);
110 void save(
const char *
Name)
const;
112 double latest_distortion();
160 int encode(
double x)
const;
162 ivec encode(
const vec &x)
const;
164 double decode(
int Index)
const;
166 vec decode(
const ivec &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.
double decode(int Index) const
Decode the index.
double scalar_quantize(double x, vec &Levels)
ADD DOCUMENTATION HERE.
Class for vector quantization.
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.
int dim() const
Returns the dimension of the VQ.
double LatestDist
The distortion at the latest time a vector was encoded.
vec Q(const vec &x)
Quantize the input vector.
double LatestDist
The distortion at the latest time a vector was encoded.
double operator()(double x) const
Quantize.
ITPP_EXPORT int scalar_encode(double x, vec &Levels)
ADD DOCUMENTATION HERE.
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.
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 Mon Apr 25 2022 14:03:04 for IT++ by Doxygen 1.8.17