tomwalters@284: // Copyright 2010, Thomas Walters tomwalters@284: // tomwalters@284: // AIM-C: A C++ implementation of the Auditory Image Model tomwalters@284: // http://www.acousticscale.org/AIMC tomwalters@284: // 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@284: // tomwalters@318: // http://www.apache.org/licenses/LICENSE-2.0 tomwalters@284: // 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@284: tomwalters@284: /*! tomwalters@284: * \author Thomas Walters tomwalters@284: * \date created 2010/02/19 tomwalters@284: * \version \$Id$ tomwalters@284: */ tomwalters@284: tomwalters@284: #ifndef AIMC_MODULES_SSI_SSI_H_ tomwalters@284: #define AIMC_MODULES_SSI_SSI_H_ tomwalters@284: tom@420: #include tomwalters@284: #include "Support/Module.h" tomwalters@284: tomwalters@284: namespace aimc { tomwalters@284: using std::vector; tomwalters@284: class ModuleSSI : public Module { tomwalters@284: public: tomwalters@284: explicit ModuleSSI(Parameters *pParam); tomwalters@284: virtual ~ModuleSSI(); tomwalters@284: tomwalters@284: /*! \brief Process a buffer tomwalters@284: */ tomwalters@284: virtual void Process(const SignalBank &input); tomwalters@284: tomwalters@284: private: tomwalters@284: /*! \brief Reset the internal state of the module tomwalters@284: */ tomwalters@284: virtual void ResetInternal(); tomwalters@284: tomwalters@284: /*! \brief Prepare the module tomwalters@284: * \param input Input signal tomwalters@284: * \param output true on success false on failure tomwalters@284: */ tomwalters@284: virtual bool InitializeInternal(const SignalBank &input); tomwalters@284: tomwalters@305: int ExtractPitchIndex(const SignalBank &input) const; tomwalters@305: tomwalters@284: float sample_rate_; tomwalters@284: int buffer_length_; tomwalters@284: int channel_count_; tomwalters@287: int ssi_width_samples_; tomwalters@287: float ssi_width_cycles_; tomwalters@305: float pivot_cf_; tom@420: vector h_; tomwalters@284: tomwalters@284: bool do_pitch_cutoff_; tomwalters@305: bool weight_by_cutoff_; tomwalters@305: bool weight_by_scaling_; tomwalters@305: bool log_cycles_axis_; tomwalters@305: float pitch_search_start_ms_; tomwalters@397: bool do_smooth_offset_; tomwalters@397: float smooth_offset_cycles_; tomwalters@284: }; tomwalters@284: } // namespace aimc tomwalters@284: tomwalters@284: #endif // AIMC_MODULES_SSI_SSI_H_