Main Page | Class List | File List | Class Members | File Members

Perc.h

Go to the documentation of this file.
00001 /*************************************************************************** 00002 Perc.h - description 00003 ------------------- 00004 begin : dom nov 23 2003 00005 copyright : (C) 2003 by 00006 email : 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef PERC_H 00019 #define PERC_H 00020 00021 #include "FreqMask.h" 00022 #include "TimeSpecStruct.h" 00023 00025 char* Perc_GetLastError(); 00026 00028 00029 typedef struct ExampleType {float Input[32]; 00030 int Output; 00031 } ExampleType; 00032 00034 class Perceptron 00035 { 00036 friend class GlDataViewer; 00037 00038 public: 00039 00041 Perceptron(); 00042 00044 ~Perceptron(); 00045 00046 int mMicLevel; 00047 00049 void RandomVector(); 00050 00052 00102 int Load(const char *filename); 00103 00105 00107 int Save(const char *filename); 00108 00110 00114 int Learn(ExampleType *Example,int numExamples,float learningRate); //returns errors 00115 00117 00119 int Exec(float *Input); //returns +1 (Whistle) or -1 (Noise) 00120 00122 00124 void SetFrequencyMask(FrequencyMaskType fMask,bool useDoppler); 00125 00127 00128 void SetTurnOnThreshold(float s); 00129 00131 00132 void SetTurnOffThreshold(float s); 00133 00135 00136 void SetTimes(TimeSpecsType); 00137 00139 00140 TimeSpecsType GetTimes(); 00141 00143 00144 FrequencyMaskType GetFrequencyMask(); 00145 00147 00148 float GetTurnOnThreshold(); 00149 00151 00152 float GetTurnOffThreshold(); 00153 00155 00157 bool UseDoppler(); 00158 00159 private: 00160 int mState; 00161 float mTurnOnThreshold; 00162 float mTurnOffThreshold; 00163 FrequencyMaskType mFmask; 00164 FrequencyMaskType mExtFmask; 00165 float mW[32]; 00166 bool mUseDoppler; 00167 TimeSpecsType mTimeSpecs; 00168 00169 }; 00170 00171 #endif 00172

Generated on Fri Jul 23 11:36:01 2004 for WhistleRecogniser by doxygen 1.3.7