annotate src/Modules/SAI/ModuleSAI.h @ 45:c5f5e9569863

- Modified licence from GPL 3 to Apache v2
author tomwalters
date Tue, 30 Mar 2010 22:06:24 +0000
parents 491b1b1d1dc5
children
rev   line source
tomwalters@0 1 // Copyright 2006-2010, Thomas Walters
tomwalters@0 2 //
tomwalters@0 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@0 4 // http://www.acousticscale.org/AIMC
tomwalters@0 5 //
tomwalters@45 6 // Licensed under the Apache License, Version 2.0 (the "License");
tomwalters@45 7 // you may not use this file except in compliance with the License.
tomwalters@45 8 // You may obtain a copy of the License at
tomwalters@0 9 //
tomwalters@45 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@0 11 //
tomwalters@45 12 // Unless required by applicable law or agreed to in writing, software
tomwalters@45 13 // distributed under the License is distributed on an "AS IS" BASIS,
tomwalters@45 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tomwalters@45 15 // See the License for the specific language governing permissions and
tomwalters@45 16 // limitations under the License.
tomwalters@0 17
tomwalters@0 18 /*! \file
tomwalters@0 19 * \brief SAI module
tomwalters@0 20 */
tomwalters@0 21
tomwalters@0 22 /*! \author Thomas Walters <tom@acousticscale.org>
tomwalters@0 23 * \date created 2007/08/29
tomwalters@23 24 * \version \$Id$
tomwalters@0 25 */
tomwalters@11 26 #ifndef AIMC_MODULES_SAI_SAI_H_
tomwalters@11 27 #define AIMC_MODULES_SAI_SAI_H_
tomwalters@0 28
tomwalters@0 29 #include <vector>
tomwalters@0 30
tomwalters@0 31 #include "Support/Module.h"
tomwalters@0 32 #include "Support/SignalBank.h"
tomwalters@0 33 #include "Support/StrobeList.h"
tomwalters@0 34
tomwalters@0 35 namespace aimc {
tomwalters@0 36 using std::vector;
tomwalters@0 37 class ModuleSAI : public Module {
tomwalters@0 38 public:
tomwalters@8 39 explicit ModuleSAI(Parameters *parameters);
tomwalters@0 40 virtual ~ModuleSAI();
tomwalters@0 41 void Process(const SignalBank &input);
tomwalters@0 42
tomwalters@0 43 private:
tomwalters@0 44 /*! \brief Prepare the module
tomwalters@0 45 * \param input Input signal bank
tomwalters@0 46 * \param output true on success false on failure
tomwalters@0 47 */
tomwalters@0 48 bool InitializeInternal(const SignalBank &input);
tomwalters@0 49
tomwalters@3 50 virtual void ResetInternal();
tomwalters@3 51
tomwalters@8 52 /*! \brief Temporary buffer for constructing the current SAI frame
tomwalters@8 53 */
tomwalters@0 54 SignalBank sai_temp_;
tomwalters@0 55
tomwalters@8 56 /*! \brief List of strobes for each channel
tomwalters@8 57 */
tomwalters@0 58 vector<StrobeList> active_strobes_;
tomwalters@0 59
tomwalters@8 60 /*! \brief Buffer decay parameter
tomwalters@8 61 */
tomwalters@0 62 float buffer_memory_decay_;
tomwalters@0 63
tomwalters@8 64 /*! \brief Sample index of minimum strobe delay
tomwalters@8 65 */
tomwalters@0 66 int min_strobe_delay_idx_;
tomwalters@0 67
tomwalters@8 68 /*! \brief Sample index of maximum strobe delay
tomwalters@8 69 */
tomwalters@0 70 int max_strobe_delay_idx_;
tomwalters@0 71
tomwalters@8 72 /*! \brief Factor with which the SAI should be decayed
tomwalters@8 73 */
tomwalters@0 74 float sai_decay_factor_;
tomwalters@0 75
tomwalters@8 76 /*! \brief Precomputed 1/n^alpha values for strobe weighting
tomwalters@8 77 */
tomwalters@0 78 vector<float> strobe_weights_;
tomwalters@0 79
tomwalters@8 80 /*! \brief Next Strobe for each channels
tomwalters@8 81 */
tomwalters@0 82 vector<int> next_strobes_;
tomwalters@0 83
tomwalters@0 84 float strobe_weight_alpha_;
tomwalters@0 85
tomwalters@0 86 /*! \brief The maximum number strobes that can be active at the same time.
tomwalters@0 87 *
tomwalters@0 88 */
tomwalters@0 89 int max_concurrent_strobes_;
tomwalters@0 90
tomwalters@0 91 int fire_counter_;
tomwalters@0 92
tomwalters@8 93 /*! \brief Period in milliseconds between output frames
tomwalters@8 94 */
tomwalters@5 95 float frame_period_ms_;
tomwalters@5 96 int frame_period_samples_;
tomwalters@0 97
tomwalters@5 98 float min_delay_ms_;
tomwalters@5 99 float max_delay_ms_;
tomwalters@5 100 int channel_count_;
tomwalters@0 101 };
tomwalters@0 102 } // namespace aimc
tomwalters@0 103
tomwalters@11 104 #endif // AIMC_MODULES_SAI_SAI_H_