00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_AIMVQ_H
00020 #define MARSYAS_AIMVQ_H
00021
00022 #include "MarSystem.h"
00023
00024 #ifdef MARSYAS_ANN
00025 #include "ANN.h"
00026 #include "kd_tree.h"
00027 #endif
00028
00029
00030
00031
00032 #include <vector>
00033
00034 namespace Marsyas
00035 {
00051 class AimVQ: public MarSystem
00052 {
00053 private:
00054 void myUpdate(MarControlPtr sender);
00055
00056
00057 void InitializeInternal();
00058
00059
00060 bool is_initialized;
00061
00062
00063 mrs_real initialized_israte;
00064
00065
00066 MarControlPtr ctrl_kd_tree_bucket_size_;
00067 MarControlPtr ctrl_kd_tree_error_bound_;
00068 MarControlPtr ctrl_num_codewords_to_return_;
00069
00070 float sample_rate_;
00071 int buffer_length_;
00072 int channel_count_;
00073
00074 #ifdef MARSYAS_ANN
00075 vector<ANNkd_tree*> sparse_coder_trees_;
00076 vector<ANNpointArray> codebooks_;
00077 #endif
00078
00079 int codebooks_count_;
00080 int codeword_count_;
00081 int codeword_length_;
00082
00083 public:
00084 AimVQ(std::string name);
00085 AimVQ(const AimVQ& a);
00086
00087 ~AimVQ();
00088 MarSystem* clone() const;
00089 void addControls();
00090
00091 void myProcess(realvec& in, realvec& out);
00092 };
00093
00094 }
00095
00096 #endif