annotate trunk/src/Modules/SAI/ModuleSAI.h @ 316:66a23c0545b6

-Added MFCCs back to the feature generation script
author tomwalters
date Thu, 04 Mar 2010 17:38:58 +0000
parents fe5ce00a64f5
children 30dde71d0230
rev   line source
tomwalters@268 1 // Copyright 2006-2010, Thomas Walters
tomwalters@268 2 //
tomwalters@268 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@268 4 // http://www.acousticscale.org/AIMC
tomwalters@268 5 //
tomwalters@268 6 // This program is free software: you can redistribute it and/or modify
tomwalters@268 7 // it under the terms of the GNU General Public License as published by
tomwalters@268 8 // the Free Software Foundation, either version 3 of the License, or
tomwalters@268 9 // (at your option) any later version.
tomwalters@268 10 //
tomwalters@268 11 // This program is distributed in the hope that it will be useful,
tomwalters@268 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@268 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@268 14 // GNU General Public License for more details.
tomwalters@268 15 //
tomwalters@268 16 // You should have received a copy of the GNU General Public License
tomwalters@268 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@268 18
tomwalters@268 19 /*! \file
tomwalters@268 20 * \brief SAI module
tomwalters@268 21 */
tomwalters@268 22
tomwalters@268 23 /*! \author Thomas Walters <tom@acousticscale.org>
tomwalters@268 24 * \date created 2007/08/29
tomwalters@296 25 * \version \$Id$
tomwalters@268 26 */
tomwalters@283 27 #ifndef AIMC_MODULES_SAI_SAI_H_
tomwalters@283 28 #define AIMC_MODULES_SAI_SAI_H_
tomwalters@268 29
tomwalters@268 30 #include <vector>
tomwalters@268 31
tomwalters@268 32 #include "Support/Module.h"
tomwalters@268 33 #include "Support/SignalBank.h"
tomwalters@268 34 #include "Support/StrobeList.h"
tomwalters@268 35
tomwalters@268 36 namespace aimc {
tomwalters@268 37 using std::vector;
tomwalters@268 38 class ModuleSAI : public Module {
tomwalters@268 39 public:
tomwalters@280 40 explicit ModuleSAI(Parameters *parameters);
tomwalters@268 41 virtual ~ModuleSAI();
tomwalters@268 42 void Process(const SignalBank &input);
tomwalters@268 43
tomwalters@268 44 private:
tomwalters@268 45 /*! \brief Prepare the module
tomwalters@268 46 * \param input Input signal bank
tomwalters@268 47 * \param output true on success false on failure
tomwalters@268 48 */
tomwalters@268 49 bool InitializeInternal(const SignalBank &input);
tomwalters@268 50
tomwalters@275 51 virtual void ResetInternal();
tomwalters@275 52
tomwalters@280 53 /*! \brief Temporary buffer for constructing the current SAI frame
tomwalters@280 54 */
tomwalters@268 55 SignalBank sai_temp_;
tomwalters@268 56
tomwalters@280 57 /*! \brief List of strobes for each channel
tomwalters@280 58 */
tomwalters@268 59 vector<StrobeList> active_strobes_;
tomwalters@268 60
tomwalters@280 61 /*! \brief Buffer decay parameter
tomwalters@280 62 */
tomwalters@268 63 float buffer_memory_decay_;
tomwalters@268 64
tomwalters@280 65 /*! \brief Sample index of minimum strobe delay
tomwalters@280 66 */
tomwalters@268 67 int min_strobe_delay_idx_;
tomwalters@268 68
tomwalters@280 69 /*! \brief Sample index of maximum strobe delay
tomwalters@280 70 */
tomwalters@268 71 int max_strobe_delay_idx_;
tomwalters@268 72
tomwalters@280 73 /*! \brief Factor with which the SAI should be decayed
tomwalters@280 74 */
tomwalters@268 75 float sai_decay_factor_;
tomwalters@268 76
tomwalters@280 77 /*! \brief Precomputed 1/n^alpha values for strobe weighting
tomwalters@280 78 */
tomwalters@268 79 vector<float> strobe_weights_;
tomwalters@268 80
tomwalters@280 81 /*! \brief Next Strobe for each channels
tomwalters@280 82 */
tomwalters@268 83 vector<int> next_strobes_;
tomwalters@268 84
tomwalters@268 85 float strobe_weight_alpha_;
tomwalters@268 86
tomwalters@268 87 /*! \brief The maximum number strobes that can be active at the same time.
tomwalters@268 88 *
tomwalters@268 89 */
tomwalters@268 90 int max_concurrent_strobes_;
tomwalters@268 91
tomwalters@268 92 int fire_counter_;
tomwalters@268 93
tomwalters@280 94 /*! \brief Period in milliseconds between output frames
tomwalters@280 95 */
tomwalters@277 96 float frame_period_ms_;
tomwalters@277 97 int frame_period_samples_;
tomwalters@268 98
tomwalters@277 99 float min_delay_ms_;
tomwalters@277 100 float max_delay_ms_;
tomwalters@277 101 int channel_count_;
tomwalters@268 102 };
tomwalters@268 103 } // namespace aimc
tomwalters@268 104
tomwalters@283 105 #endif // AIMC_MODULES_SAI_SAI_H_