tomwalters@305: // Copyright 2010, Thomas Walters
tomwalters@305: //
tomwalters@305: // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@305: // http://www.acousticscale.org/AIMC
tomwalters@305: //
tomwalters@305: // This program is free software: you can redistribute it and/or modify
tomwalters@305: // it under the terms of the GNU General Public License as published by
tomwalters@305: // the Free Software Foundation, either version 3 of the License, or
tomwalters@305: // (at your option) any later version.
tomwalters@305: //
tomwalters@305: // This program is distributed in the hope that it will be useful,
tomwalters@305: // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@305: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@305: // GNU General Public License for more details.
tomwalters@305: //
tomwalters@305: // You should have received a copy of the GNU General Public License
tomwalters@305: // along with this program. If not, see .
tomwalters@305:
tomwalters@305: /*!
tomwalters@305: * \author Thomas Walters
tomwalters@305: * \date created 2010/02/24
tomwalters@305: * \version \$Id$
tomwalters@305: */
tomwalters@305:
tomwalters@305: #ifndef AIMC_MODULES_SNR_NOISE_H_
tomwalters@305: #define AIMC_MODULES_SNR_NOISE_H_
tomwalters@305:
tomwalters@305: #include
tomwalters@305:
tomwalters@305: #include "Support/Module.h"
tomwalters@305:
tomwalters@305: namespace aimc {
tomwalters@305: class ModuleNoise : public Module {
tomwalters@305: public:
tomwalters@305: explicit ModuleNoise(Parameters *pParam);
tomwalters@305: virtual ~ModuleNoise();
tomwalters@305:
tomwalters@305: /*! \brief Process a buffer
tomwalters@305: */
tomwalters@305: virtual void Process(const SignalBank &input);
tomwalters@305:
tomwalters@305: private:
tomwalters@305: /*! \brief Reset the internal state of the module
tomwalters@305: */
tomwalters@305: virtual void ResetInternal();
tomwalters@305:
tomwalters@305: /*! \brief Prepare the module
tomwalters@305: * \param input Input signal
tomwalters@305: * \param output true on success false on failure
tomwalters@305: */
tomwalters@305: virtual bool InitializeInternal(const SignalBank &input);
tomwalters@305:
tomwalters@305: float sample_rate_;
tomwalters@305: int buffer_length_;
tomwalters@305: int channel_count_;
tomwalters@305:
tomwalters@305: float multiplier_;
tomwalters@305:
tomwalters@305: // Random number generator which yeilds Gaussian-distributed values by
tomwalters@305: // The generator is a Mersenne twister
tomwalters@305: boost::variate_generator >
tomwalters@305: gaussian_variate_;
tomwalters@305: };
tomwalters@305: } // namespace aimc
tomwalters@305:
tomwalters@305: #endif // AIMC_MODULES_SNR_NOISE_H_