annotate src/Modules/Strobes/ModuleLocalMax.h @ 32:9122efd2b227

-New AIMCopy main for the SSI features (temporary hack till I get a working module load system) -LocalMax strobe criterion. This is faster and better than the parabola version, which still seems buggy. -Noise generator module. Adds noise to a signal. Uses boost for the random number generator. -New options for the SSI -Slice now respects all its flags (oops!). -MATLAB functions for visualisation -Scripts for generating data to view in MATLAB -Script to download and build HTK - useful for running experiments
author tomwalters
date Thu, 25 Feb 2010 22:02:00 +0000
parents
children c5f5e9569863
rev   line source
tomwalters@32 1 // Copyright 2010, Thomas Walters
tomwalters@32 2 //
tomwalters@32 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@32 4 // http://www.acousticscale.org/AIMC
tomwalters@32 5 //
tomwalters@32 6 // This program is free software: you can redistribute it and/or modify
tomwalters@32 7 // it under the terms of the GNU General Public License as published by
tomwalters@32 8 // the Free Software Foundation, either version 3 of the License, or
tomwalters@32 9 // (at your option) any later version.
tomwalters@32 10 //
tomwalters@32 11 // This program is distributed in the hope that it will be useful,
tomwalters@32 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@32 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@32 14 // GNU General Public License for more details.
tomwalters@32 15 //
tomwalters@32 16 // You should have received a copy of the GNU General Public License
tomwalters@32 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
tomwalters@32 18
tomwalters@32 19 /*!
tomwalters@32 20 * \author Thomas Walters <tom@acousticscale.org>
tomwalters@32 21 * \date created 2010/02/23
tomwalters@32 22 * \version \$Id$
tomwalters@32 23 */
tomwalters@32 24
tomwalters@32 25 #ifndef AIMC_MODULES_STROBES_LOCAL_MAX_H_
tomwalters@32 26 #define AIMC_MODULES_STROBES_LOCAL_MAX_H_
tomwalters@32 27
tomwalters@32 28 #include <vector>
tomwalters@32 29 #include "Support/Module.h"
tomwalters@32 30
tomwalters@32 31 namespace aimc {
tomwalters@32 32 using std::vector;
tomwalters@32 33 class ModuleLocalMax : public Module {
tomwalters@32 34 public:
tomwalters@32 35 explicit ModuleLocalMax(Parameters *pParam);
tomwalters@32 36 virtual ~ModuleLocalMax();
tomwalters@32 37
tomwalters@32 38 /*! \brief Process a buffer
tomwalters@32 39 */
tomwalters@32 40 virtual void Process(const SignalBank &input);
tomwalters@32 41
tomwalters@32 42 private:
tomwalters@32 43 /*! \brief Reset the internal state of the module
tomwalters@32 44 */
tomwalters@32 45 virtual void ResetInternal();
tomwalters@32 46
tomwalters@32 47 /*! \brief Prepare the module
tomwalters@32 48 * \param input Input signal
tomwalters@32 49 * \param output true on success false on failure
tomwalters@32 50 */
tomwalters@32 51 virtual bool InitializeInternal(const SignalBank &input);
tomwalters@32 52
tomwalters@32 53 float sample_rate_;
tomwalters@32 54 int buffer_length_;
tomwalters@32 55 int channel_count_;
tomwalters@32 56
tomwalters@32 57 float decay_time_ms_;
tomwalters@32 58 float timeout_ms_;
tomwalters@32 59 int strobe_timeout_samples_;
tomwalters@32 60 int strobe_decay_samples_;
tomwalters@32 61
tomwalters@32 62 vector<float> threshold_;
tomwalters@32 63 vector<float> decay_constant_;
tomwalters@32 64
tomwalters@32 65 vector<float> prev_sample_;
tomwalters@32 66 vector<float> curr_sample_;
tomwalters@32 67 vector<float> next_sample_;
tomwalters@32 68 };
tomwalters@32 69 } // namespace aimc
tomwalters@32 70
tomwalters@32 71 #endif // AIMC_MODULES_STROBES_LOCAL_MAX_H_