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@318: // Licensed under the Apache License, Version 2.0 (the "License"); tomwalters@318: // you may not use this file except in compliance with the License. tomwalters@318: // You may obtain a copy of the License at tomwalters@305: // tomwalters@318: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@305: // tomwalters@318: // Unless required by applicable law or agreed to in writing, software tomwalters@318: // distributed under the License is distributed on an "AS IS" BASIS, tomwalters@318: // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. tomwalters@318: // See the License for the specific language governing permissions and tomwalters@318: // limitations under the License. tomwalters@305: tomwalters@305: /*! tomwalters@305: * \author Thomas Walters tomwalters@305: * \date created 2010/02/23 tomwalters@305: * \version \$Id$ tomwalters@305: */ tomwalters@305: tomwalters@305: #ifndef AIMC_MODULES_STROBES_LOCAL_MAX_H_ tomwalters@305: #define AIMC_MODULES_STROBES_LOCAL_MAX_H_ tomwalters@305: tomwalters@305: #include tomwalters@305: #include "Support/Module.h" tomwalters@305: tomwalters@305: namespace aimc { tomwalters@305: using std::vector; tomwalters@305: class ModuleLocalMax : public Module { tomwalters@305: public: tomwalters@305: explicit ModuleLocalMax(Parameters *pParam); tomwalters@305: virtual ~ModuleLocalMax(); 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 decay_time_ms_; tomwalters@305: float timeout_ms_; tomwalters@305: int strobe_timeout_samples_; tomwalters@305: int strobe_decay_samples_; tomwalters@305: tomwalters@305: vector threshold_; tomwalters@305: vector decay_constant_; tomwalters@305: tomwalters@305: vector prev_sample_; tomwalters@305: vector curr_sample_; tomwalters@305: vector next_sample_; tomwalters@305: }; tomwalters@305: } // namespace aimc tomwalters@305: tomwalters@305: #endif // AIMC_MODULES_STROBES_LOCAL_MAX_H_