comparison data/model/FFTModel.cpp @ 1159:444d133b5ab7 3.0-integration

Merge from branch "tony-2.0-integration"
author Chris Cannam
date Thu, 04 Feb 2016 11:13:39 +0000
parents 546d4e417346 e94719f941ba
children 12a8daa89970
comparison
equal deleted inserted replaced
1156:2dc27f0f97ad 1159:444d133b5ab7
147 values[i] = abs(col[minbin + i]); 147 values[i] = abs(col[minbin + i]);
148 } 148 }
149 return true; 149 return true;
150 } 150 }
151 151
152 bool 152 float
153 FFTModel::getNormalizedMagnitudesAt(int x, float *values, int minbin, int count) const 153 FFTModel::getNormalizedMagnitudesAt(int x, float *values, int minbin, int count) const
154 { 154 {
155 if (!getMagnitudesAt(x, values, minbin, count)) return false; 155 if (!getMagnitudesAt(x, values, minbin, count)) return false;
156 if (count == 0) count = getHeight(); 156 if (count == 0) count = getHeight();
157 float max = 0.f; 157 float max = 0.f;
161 if (max > 0.f) { 161 if (max > 0.f) {
162 for (int i = 0; i < count; ++i) { 162 for (int i = 0; i < count; ++i) {
163 values[i] /= max; 163 values[i] /= max;
164 } 164 }
165 } 165 }
166 return true; 166 return max;
167 } 167 }
168 168
169 bool 169 bool
170 FFTModel::getPhasesAt(int x, float *values, int minbin, int count) const 170 FFTModel::getPhasesAt(int x, float *values, int minbin, int count) const
171 { 171 {