comparison src/FeatureExtractor.h @ 183:24ddab06aace re-minimise

Toward allowing types to be small again. Doesn't currently build
author Chris Cannam
date Thu, 19 Feb 2015 17:17:20 +0000
parents 1440773da492
children 6c12db195986
comparison
equal deleted inserted replaced
182:a67663dc698d 183:24ddab06aace
15 */ 15 */
16 16
17 #ifndef FEATURE_EXTRACTOR_H 17 #ifndef FEATURE_EXTRACTOR_H
18 #define FEATURE_EXTRACTOR_H 18 #define FEATURE_EXTRACTOR_H
19 19
20 #include <vector> 20 #include "Types.h"
21 21
22 /** 22 /**
23 * Convert frequency-domain audio frames into features suitable for 23 * Convert frequency-domain audio frames into features suitable for
24 * MATCH alignment calculation. 24 * MATCH alignment calculation.
25 * 25 *
104 * 104 *
105 * Operates by mapping the frequency bins into a part-linear 105 * Operates by mapping the frequency bins into a part-linear
106 * part-logarithmic array, unless useChromaFrequencyMap is true in 106 * part-logarithmic array, unless useChromaFrequencyMap is true in
107 * which case they are mapped into chroma bins. 107 * which case they are mapped into chroma bins.
108 */ 108 */
109 std::vector<double> process(const std::vector<double> &real, 109 feature_t process(const std::vector<double> &real,
110 const std::vector<double> &imag); 110 const std::vector<double> &imag);
111 111
112 /** 112 /**
113 * Process one frequency-domain audio frame, provided as a single 113 * Process one frequency-domain audio frame, provided as a single
114 * array of alternating real and imaginary components. Input array 114 * array of alternating real and imaginary components. Input array
115 * must have at least 2 * (params.fftSize/2 + 1) elements. 115 * must have at least 2 * (params.fftSize/2 + 1) elements.
116 * 116 *
117 * Operates by mapping the frequency bins into a part-linear 117 * Operates by mapping the frequency bins into a part-linear
118 * part-logarithmic array, unless useChromaFrequencyMap is true in 118 * part-logarithmic array, unless useChromaFrequencyMap is true in
119 * which case they are mapped into chroma bins. 119 * which case they are mapped into chroma bins.
120 */ 120 */
121 std::vector<double> process(const float *carray); 121 std::feature_t process(const float *carray);
122 122
123 protected: 123 protected:
124 /** Make either standard or chroma map, depending on m_params */ 124 /** Make either standard or chroma map, depending on m_params */
125 void makeFreqMap(); 125 void makeFreqMap();
126 126
152 * range, it will be mapped to a target bin of -1 and should be 152 * range, it will be mapped to a target bin of -1 and should be
153 * discarded. 153 * discarded.
154 */ 154 */
155 std::vector<int> m_freqMap; 155 std::vector<int> m_freqMap;
156 156
157 std::vector<double> processMags(const std::vector<double> &mags); 157 feature_t processMags(const std::vector<double> &mags);
158 std::vector<double> scaleMags(const std::vector<double> &mags); 158 std::vector<double> scaleMags(const std::vector<double> &mags);
159 159
160 /** The size of a returned feature. */ 160 /** The size of a returned feature. */
161 int m_featureSize; 161 int m_featureSize;
162 }; 162 };