Mercurial > hg > match-vamp
comparison src/FeatureConditioner.cpp @ 130:8e240bbea845 refactors
FeatureConditioner tests
author | Chris Cannam |
---|---|
date | Thu, 11 Dec 2014 13:53:16 +0000 |
parents | eed5f9594268 |
children | b62dbe2ba958 |
comparison
equal
deleted
inserted
replaced
129:dad9fdc32a6a | 130:8e240bbea845 |
---|---|
14 */ | 14 */ |
15 | 15 |
16 #include "FeatureConditioner.h" | 16 #include "FeatureConditioner.h" |
17 | 17 |
18 #include <iostream> | 18 #include <iostream> |
19 #include <cmath> | |
19 | 20 |
20 using namespace std; | 21 using namespace std; |
21 | 22 |
22 vector<double> | 23 vector<double> |
23 FeatureConditioner::process(const vector<double> &feature) | 24 FeatureConditioner::process(const vector<double> &feature) |
52 break; | 53 break; |
53 | 54 |
54 case OutputDerivative: | 55 case OutputDerivative: |
55 for (int i = 0; i < size; i++) { | 56 for (int i = 0; i < size; i++) { |
56 totalEnergy += feature[i]; | 57 totalEnergy += feature[i]; |
57 out[i] = feature[i] - m_prev[i]; | 58 out[i] = fabs(feature[i] - m_prev[i]); |
58 } | 59 } |
59 break; | 60 break; |
60 | 61 |
61 case OutputFeatures: | 62 case OutputFeatures: |
62 for (int i = 0; i < size; i++) { | 63 for (int i = 0; i < size; i++) { |