Mercurial > hg > constant-q-cpp
comparison src/ConstantQ.cpp @ 137:9bdabd830609
Bins are from high to low, not low to high (for getBinFrequencies)
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Mon, 19 May 2014 17:24:55 +0100 |
parents | 8996465e39fc |
children | ff8ae033615f |
comparison
equal
deleted
inserted
replaced
136:8970f4838285 | 137:9bdabd830609 |
---|---|
78 } | 78 } |
79 | 79 |
80 double | 80 double |
81 ConstantQ::getBinFrequency(int bin) const | 81 ConstantQ::getBinFrequency(int bin) const |
82 { | 82 { |
83 // our bins are returned in high->low order | |
84 bin = (getBinsPerOctave() * getOctaves()) - bin - 1; | |
83 return getMinFrequency() * pow(2, (double(bin) / getBinsPerOctave())); | 85 return getMinFrequency() * pow(2, (double(bin) / getBinsPerOctave())); |
84 } | 86 } |
85 | 87 |
86 void | 88 void |
87 ConstantQ::initialise() | 89 ConstantQ::initialise() |