Mercurial > hg > match-vamp
comparison test/TestFeatureExtractor.cpp @ 165:31602361fb65 refactors
Build stuff
author | Chris Cannam |
---|---|
date | Fri, 30 Jan 2015 14:54:18 +0000 |
parents | 8e240bbea845 |
children | d1bc89794cd4 |
comparison
equal
deleted
inserted
replaced
164:13774b008b6a | 165:31602361fb65 |
---|---|
12 | 12 |
13 #include <boost/test/unit_test.hpp> | 13 #include <boost/test/unit_test.hpp> |
14 | 14 |
15 static int freq2mid(double freq) | 15 static int freq2mid(double freq) |
16 { | 16 { |
17 return round(57.0 + 12.0 * log(freq / 220.) / log(2.)); | 17 return int(round(57.0 + 12.0 * log(freq / 220.) / log(2.))); |
18 } | 18 } |
19 | 19 |
20 static int freq2chroma(double freq) | 20 static int freq2chroma(double freq) |
21 { | 21 { |
22 return freq2mid(freq) % 12; | 22 return freq2mid(freq) % 12; |