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
|
tomwalters@12
|
27 #include "Support/Module.h"
|
tomwalters@12
|
28
|
tomwalters@12
|
29 namespace aimc {
|
tomwalters@12
|
30 using std::vector;
|
tomwalters@12
|
31 class ModuleSSI : public Module {
|
tomwalters@12
|
32 public:
|
tomwalters@12
|
33 explicit ModuleSSI(Parameters *pParam);
|
tomwalters@12
|
34 virtual ~ModuleSSI();
|
tomwalters@12
|
35
|
tomwalters@12
|
36 /*! \brief Process a buffer
|
tomwalters@12
|
37 */
|
tomwalters@12
|
38 virtual void Process(const SignalBank &input);
|
tomwalters@12
|
39
|
tomwalters@12
|
40 private:
|
tomwalters@12
|
41 /*! \brief Reset the internal state of the module
|
tomwalters@12
|
42 */
|
tomwalters@12
|
43 virtual void ResetInternal();
|
tomwalters@12
|
44
|
tomwalters@12
|
45 /*! \brief Prepare the module
|
tomwalters@12
|
46 * \param input Input signal
|
tomwalters@12
|
47 * \param output true on success false on failure
|
tomwalters@12
|
48 */
|
tomwalters@12
|
49 virtual bool InitializeInternal(const SignalBank &input);
|
tomwalters@12
|
50
|
tomwalters@32
|
51 int ExtractPitchIndex(const SignalBank &input) const;
|
tomwalters@32
|
52
|
tomwalters@12
|
53 float sample_rate_;
|
tomwalters@12
|
54 int buffer_length_;
|
tomwalters@12
|
55 int channel_count_;
|
tomwalters@15
|
56 int ssi_width_samples_;
|
tomwalters@15
|
57 float ssi_width_cycles_;
|
tomwalters@32
|
58 float pivot_cf_;
|
tomwalters@12
|
59
|
tomwalters@12
|
60 bool do_pitch_cutoff_;
|
tomwalters@32
|
61 bool weight_by_cutoff_;
|
tomwalters@32
|
62 bool weight_by_scaling_;
|
tomwalters@32
|
63 bool log_cycles_axis_;
|
tomwalters@32
|
64 float pitch_search_start_ms_;
|
tomwalters@116
|
65 bool do_smooth_offset_;
|
tomwalters@116
|
66 float smooth_offset_cycles_;
|
tomwalters@12
|
67 };
|
tomwalters@12
|
68 } // namespace aimc
|
tomwalters@12
|
69
|
tomwalters@12
|
70 #endif // AIMC_MODULES_SSI_SSI_H_
|