annotate src/Modules/SNR/ModuleNoise.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/24
tomwalters@32 22 * \version \$Id$
tomwalters@32 23 */
tomwalters@32 24
tomwalters@32 25 #ifndef AIMC_MODULES_SNR_NOISE_H_
tomwalters@32 26 #define AIMC_MODULES_SNR_NOISE_H_
tomwalters@32 27
tomwalters@32 28 #include <boost/random.hpp>
tomwalters@32 29
tomwalters@32 30 #include "Support/Module.h"
tomwalters@32 31
tomwalters@32 32 namespace aimc {
tomwalters@32 33 class ModuleNoise : public Module {
tomwalters@32 34 public:
tomwalters@32 35 explicit ModuleNoise(Parameters *pParam);
tomwalters@32 36 virtual ~ModuleNoise();
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 multiplier_;
tomwalters@32 58
tomwalters@32 59 // Random number generator which yeilds Gaussian-distributed values by
tomwalters@32 60 // The generator is a Mersenne twister
tomwalters@32 61 boost::variate_generator<boost::mt19937,
tomwalters@32 62 boost::normal_distribution<float> >
tomwalters@32 63 gaussian_variate_;
tomwalters@32 64 };
tomwalters@32 65 } // namespace aimc
tomwalters@32 66
tomwalters@32 67 #endif // AIMC_MODULES_SNR_NOISE_H_