Mercurial > hg > match-vamp
diff src/FeatureExtractor.cpp @ 201:2fed1f101172
Another process wrapper
author | Chris Cannam |
---|---|
date | Fri, 27 Feb 2015 10:44:13 +0000 |
parents | 487261a22b18 |
children | 175c8f044e7c |
line wrap: on
line diff
--- a/src/FeatureExtractor.cpp Fri Feb 27 10:05:04 2015 +0000 +++ b/src/FeatureExtractor.cpp Fri Feb 27 10:44:13 2015 +0000 @@ -179,6 +179,18 @@ } feature_t +FeatureExtractor::process(const float *real, const float *imag) +{ + vector<float> mags(m_params.fftSize/2 + 1, 0.0); + + for (int i = 0; i <= m_params.fftSize/2; i++) { + mags[i] = real[i] * real[i] + imag[i] * imag[i]; + } + + return processMags(mags); +} + +feature_t FeatureExtractor::process(const float *cframe) { vector<float> mags(m_params.fftSize/2 + 1, 0.0);