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@32: // This program is free software: you can redistribute it and/or modify
tomwalters@32: // it under the terms of the GNU General Public License as published by
tomwalters@32: // the Free Software Foundation, either version 3 of the License, or
tomwalters@32: // (at your option) any later version.
tomwalters@32: //
tomwalters@32: // This program is distributed in the hope that it will be useful,
tomwalters@32: // but WITHOUT ANY WARRANTY; without even the implied warranty of
tomwalters@32: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
tomwalters@32: // GNU General Public License for more details.
tomwalters@32: //
tomwalters@32: // You should have received a copy of the GNU General Public License
tomwalters@32: // along with this program. If not, see .
tomwalters@32:
tomwalters@32: /*!
tomwalters@32: * \author Thomas Walters
tomwalters@32: * \date created 2010/02/23
tomwalters@32: * \version \$Id$
tomwalters@32: */
tomwalters@32:
tomwalters@32: #ifndef AIMC_MODULES_STROBES_LOCAL_MAX_H_
tomwalters@32: #define AIMC_MODULES_STROBES_LOCAL_MAX_H_
tomwalters@32:
tomwalters@32: #include
tomwalters@32: #include "Support/Module.h"
tomwalters@32:
tomwalters@32: namespace aimc {
tomwalters@32: using std::vector;
tomwalters@32: class ModuleLocalMax : public Module {
tomwalters@32: public:
tomwalters@32: explicit ModuleLocalMax(Parameters *pParam);
tomwalters@32: virtual ~ModuleLocalMax();
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 decay_time_ms_;
tomwalters@32: float timeout_ms_;
tomwalters@32: int strobe_timeout_samples_;
tomwalters@32: int strobe_decay_samples_;
tomwalters@32:
tomwalters@32: vector threshold_;
tomwalters@32: vector decay_constant_;
tomwalters@32:
tomwalters@32: vector prev_sample_;
tomwalters@32: vector curr_sample_;
tomwalters@32: vector next_sample_;
tomwalters@32: };
tomwalters@32: } // namespace aimc
tomwalters@32:
tomwalters@32: #endif // AIMC_MODULES_STROBES_LOCAL_MAX_H_