Mercurial > hg > adaptinstrspec
comparison functions/getNumBinsPerSemitoneFromFreqVec.m @ 0:b4e26b53072f tip
Initial commit.
author | Holger Kirchhoff <holger.kirchhoff@eecs.qmul.ac.uk> |
---|---|
date | Tue, 04 Dec 2012 13:57:15 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:b4e26b53072f |
---|---|
1 function numBinsPerSemitone = getNumBinsPerSemitoneFromFreqVec(freqsInHz) | |
2 % numBinsPerSemitone = getNumBinsPerSemitoneFromFreqVec(freqsInHz) | |
3 % | |
4 % infers the number of bins per semitone from a given constant-Q frequency | |
5 % vector in Hz | |
6 | |
7 ratios = freqsInHz(2:end) ./ freqsInHz(1:end-1); | |
8 avgRatio = mean(ratios); | |
9 numBinsPerSemitone = round( 1/(12*log2(avgRatio)) ); |