annotate src/Modules/Strobes/ModuleParabola.h @ 654:a1b82b240328

Rename variables to be consistent with the rest of the library.
author ronw@google.com
date Thu, 27 Jun 2013 15:30:46 +0000
parents c5f5e9569863
children
rev   line source
tomwalters@5 1 // Copyright 2007-2010, Thomas Walters
tomwalters@5 2 //
tomwalters@5 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@5 4 // http://www.acousticscale.org/AIMC
tomwalters@5 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@5 9 //
tomwalters@45 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@5 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@5 17
tomwalters@5 18 /*!
tomwalters@5 19 * \file
tomwalters@5 20 * \brief SAI 2003 module - for any output frame rate
tomwalters@5 21 *
tomwalters@11 22 * \author Thomas Walters <tom@acousticscale.org>
tomwalters@5 23 * \date created 2007/03/28
tomwalters@5 24 * \version \$Id$
tomwalters@5 25 */
tomwalters@5 26
tomwalters@11 27 #ifndef AIMC_MODULES_STROBES_PARABOLA_H_
tomwalters@11 28 #define AIMC_MODULES_STROBES_PARABOLA_H_
tomwalters@5 29
tomwalters@5 30 #include <vector>
tomwalters@5 31
tomwalters@5 32 #include "Support/Module.h"
tomwalters@5 33 #include "Support/Parameters.h"
tomwalters@5 34 #include "Support/SignalBank.h"
tomwalters@5 35
tomwalters@5 36 namespace aimc {
tomwalters@5 37 using std::vector;
tomwalters@5 38 class ModuleParabola : public Module {
tomwalters@5 39 public:
tomwalters@8 40 explicit ModuleParabola(Parameters *params);
tomwalters@7 41 virtual ~ModuleParabola();
tomwalters@7 42 void Process(const SignalBank& input);
tomwalters@8 43 private:
tomwalters@5 44 /*! \brief Prepare the module
tomwalters@7 45 * \param input Input signal bank
tomwalters@7 46 * \param output true on success false on failure
tomwalters@7 47 */
tomwalters@7 48 virtual bool InitializeInternal(const SignalBank& input);
tomwalters@5 49
tomwalters@7 50 virtual void ResetInternal();
tomwalters@5 51
tomwalters@5 52
tomwalters@8 53 /*! \brief Number of samples over which the strobe should be decayed to
tomwalters@8 54 * zero
tomwalters@8 55 */
tomwalters@7 56 int strobe_decay_samples_;
tomwalters@5 57
tomwalters@7 58 /*! \brief Current strobe thresholds, one for each bank channel.
tomwalters@7 59 *
tomwalters@7 60 * This value is decayed over time.
tomwalters@7 61 */
tomwalters@7 62 vector<float> threshold_;
tomwalters@5 63
tomwalters@7 64 /*! \brief Signal value at the last strobe, one for each bank channel.
tomwalters@7 65 *
tomwalters@7 66 * This value is not decayed over time.
tomwalters@7 67 */
tomwalters@7 68 vector<float> last_threshold_;
tomwalters@5 69
tomwalters@8 70 /*! \brief Parabola height parameter
tomwalters@8 71 */
tomwalters@5 72 float height_;
tomwalters@5 73
tomwalters@8 74 /*! \brief Parabola width paramters
tomwalters@8 75 */
tomwalters@5 76 float parabw_;
tomwalters@5 77
tomwalters@8 78 /*! \brief Parabola a value
tomwalters@8 79 */
tomwalters@5 80 vector<float> parab_a_;
tomwalters@5 81
tomwalters@8 82 /*! \brief Parabola b value
tomwalters@8 83 */
tomwalters@5 84 vector<float> parab_b_;
tomwalters@5 85
tomwalters@8 86 /*! \brief Parabola calculation variable
tomwalters@8 87 */
tomwalters@5 88 vector<float> parab_wnull_;
tomwalters@5 89
tomwalters@8 90 /*! \brief Parabola calculation variable
tomwalters@8 91 */
tomwalters@5 92 vector<int> parab_var_samples_;
tomwalters@5 93
tomwalters@8 94 /*! \brief Storage for the number of samples since the last strobe
tomwalters@8 95 */
tomwalters@5 96 vector<int> samples_since_last_strobe_;
tomwalters@5 97
tomwalters@5 98 vector<float> prev_sample_;
tomwalters@5 99 vector<float> curr_sample_;
tomwalters@5 100 vector<float> next_sample_;
tomwalters@5 101
tomwalters@5 102 float alpha_;
tomwalters@5 103 int channel_count_;
tomwalters@5 104 float sample_rate_;
tomwalters@5 105 float strobe_decay_time_;
tomwalters@5 106 };
tomwalters@5 107 } // namespace aimc
tomwalters@5 108
tomwalters@11 109 #endif // AIMC_MODULES_STROBES_PARABOLA_H_