tomwalters@32: // Copyright 2010, Thomas Walters tomwalters@32: // tomwalters@32: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@32: // http://www.acousticscale.org/AIMC tomwalters@32: // tomwalters@45: // Licensed under the Apache License, Version 2.0 (the "License"); tomwalters@45: // you may not use this file except in compliance with the License. tomwalters@45: // You may obtain a copy of the License at tomwalters@32: // tomwalters@45: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@32: // tomwalters@45: // Unless required by applicable law or agreed to in writing, software tomwalters@45: // distributed under the License is distributed on an "AS IS" BASIS, tomwalters@45: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. tomwalters@45: // See the License for the specific language governing permissions and tomwalters@45: // limitations under the License. tomwalters@32: tomwalters@32: /*! tomwalters@32: * \author Thomas Walters tomwalters@32: * \date created 2010/02/24 tomwalters@32: * \version \$Id$ tomwalters@32: */ tomwalters@32: tomwalters@32: #ifndef AIMC_MODULES_SNR_NOISE_H_ tomwalters@32: #define AIMC_MODULES_SNR_NOISE_H_ tomwalters@32: tomwalters@32: #include tomwalters@32: tomwalters@32: #include "Support/Module.h" tomwalters@32: tomwalters@32: namespace aimc { tomwalters@32: class ModuleNoise : public Module { tomwalters@32: public: tomwalters@32: explicit ModuleNoise(Parameters *pParam); tomwalters@32: virtual ~ModuleNoise(); tomwalters@32: tomwalters@32: /*! \brief Process a buffer tomwalters@32: */ tomwalters@32: virtual void Process(const SignalBank &input); tomwalters@32: tomwalters@32: private: tomwalters@32: /*! \brief Reset the internal state of the module tomwalters@32: */ tomwalters@32: virtual void ResetInternal(); tomwalters@32: tomwalters@32: /*! \brief Prepare the module tomwalters@32: * \param input Input signal tomwalters@32: * \param output true on success false on failure tomwalters@32: */ tomwalters@32: virtual bool InitializeInternal(const SignalBank &input); tomwalters@32: tomwalters@32: float sample_rate_; tomwalters@32: int buffer_length_; tomwalters@32: int channel_count_; tomwalters@32: tomwalters@32: float multiplier_; tomwalters@32: tomwalters@32: // Random number generator which yeilds Gaussian-distributed values by tomwalters@32: // The generator is a Mersenne twister tomwalters@32: boost::variate_generator > tomwalters@32: gaussian_variate_; tomwalters@32: }; tomwalters@32: } // namespace aimc tomwalters@32: tomwalters@32: #endif // AIMC_MODULES_SNR_NOISE_H_