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