comparison data/model/FFTModel.cpp @ 1429:48e9f538e6e9

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents 87ae75da6527
children 0925b37a3ed1
comparison
equal deleted inserted replaced
1428:87ae75da6527 1429:48e9f538e6e9
286 vector<float> pad(pfx, 0.f); 286 vector<float> pad(pfx, 0.f);
287 data.insert(data.begin(), pad.begin(), pad.end()); 287 data.insert(data.begin(), pad.begin(), pad.end());
288 } 288 }
289 289
290 if (m_channel == -1) { 290 if (m_channel == -1) {
291 int channels = m_model->getChannelCount(); 291 int channels = m_model->getChannelCount();
292 if (channels > 1) { 292 if (channels > 1) {
293 int n = int(data.size()); 293 int n = int(data.size());
294 float factor = 1.f / float(channels); 294 float factor = 1.f / float(channels);
295 // use mean instead of sum for fft model input 295 // use mean instead of sum for fft model input
296 for (int i = 0; i < n; ++i) { 296 for (int i = 0; i < n; ++i) {
297 data[i] *= factor; 297 data[i] *= factor;
298 } 298 }
299 } 299 }
300 } 300 }
301 301
302 return data; 302 return data;
303 } 303 }
304 304