annotate src/Modules/SSI/ModuleSSI.h @ 611:0fbaf443ec82

Carfac C++ revision 3, indluding more style improvements. The output structs are now classes again, and have separate storage methods for each output structure along with flags in the Run and RunSegment methods to allow for only storing NAPs if desired.
author alexbrandmeyer
date Fri, 17 May 2013 19:52:45 +0000
parents 0a3342606855
children
rev   line source
tomwalters@12 1 // Copyright 2010, Thomas Walters
tomwalters@12 2 //
tomwalters@12 3 // AIM-C: A C++ implementation of the Auditory Image Model
tomwalters@12 4 // http://www.acousticscale.org/AIMC
tomwalters@12 5 //
tomwalters@45 6 // Licensed under the Apache License, Version 2.0 (the "License");
tomwalters@45 7 // you may not use this file except in compliance with the License.
tomwalters@45 8 // You may obtain a copy of the License at
tomwalters@12 9 //
tomwalters@45 10 // http://www.apache.org/licenses/LICENSE-2.0
tomwalters@12 11 //
tomwalters@45 12 // Unless required by applicable law or agreed to in writing, software
tomwalters@45 13 // distributed under the License is distributed on an "AS IS" BASIS,
tomwalters@45 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
tomwalters@45 15 // See the License for the specific language governing permissions and
tomwalters@45 16 // limitations under the License.
tomwalters@12 17
tomwalters@12 18 /*!
tomwalters@12 19 * \author Thomas Walters <tom@acousticscale.org>
tomwalters@12 20 * \date created 2010/02/19
tomwalters@12 21 * \version \$Id$
tomwalters@12 22 */
tomwalters@12 23
tomwalters@12 24 #ifndef AIMC_MODULES_SSI_SSI_H_
tomwalters@12 25 #define AIMC_MODULES_SSI_SSI_H_
tomwalters@12 26
tom@246 27 #include <vector>
tomwalters@12 28 #include "Support/Module.h"
tomwalters@12 29
tomwalters@12 30 namespace aimc {
tomwalters@12 31 using std::vector;
tomwalters@12 32 class ModuleSSI : public Module {
tomwalters@12 33 public:
tomwalters@12 34 explicit ModuleSSI(Parameters *pParam);
tomwalters@12 35 virtual ~ModuleSSI();
tomwalters@12 36
tomwalters@12 37 /*! \brief Process a buffer
tomwalters@12 38 */
tomwalters@12 39 virtual void Process(const SignalBank &input);
tomwalters@12 40
tomwalters@12 41 private:
tomwalters@12 42 /*! \brief Reset the internal state of the module
tomwalters@12 43 */
tomwalters@12 44 virtual void ResetInternal();
tomwalters@12 45
tomwalters@12 46 /*! \brief Prepare the module
tomwalters@12 47 * \param input Input signal
tomwalters@12 48 * \param output true on success false on failure
tomwalters@12 49 */
tomwalters@12 50 virtual bool InitializeInternal(const SignalBank &input);
tomwalters@12 51
tomwalters@32 52 int ExtractPitchIndex(const SignalBank &input) const;
tomwalters@32 53
tomwalters@12 54 float sample_rate_;
tomwalters@12 55 int buffer_length_;
tomwalters@12 56 int channel_count_;
tomwalters@15 57 int ssi_width_samples_;
tomwalters@15 58 float ssi_width_cycles_;
tomwalters@32 59 float pivot_cf_;
tom@246 60 vector<float> h_;
tomwalters@12 61
tomwalters@12 62 bool do_pitch_cutoff_;
tomwalters@32 63 bool weight_by_cutoff_;
tomwalters@32 64 bool weight_by_scaling_;
tomwalters@32 65 bool log_cycles_axis_;
tomwalters@32 66 float pitch_search_start_ms_;
tomwalters@116 67 bool do_smooth_offset_;
tomwalters@116 68 float smooth_offset_cycles_;
tomwalters@12 69 };
tomwalters@12 70 } // namespace aimc
tomwalters@12 71
tomwalters@12 72 #endif // AIMC_MODULES_SSI_SSI_H_