Mercurial > hg > constant-q-cpp
changeset 1:f5379a70fc37
Initial kernel parameters
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Wed, 23 Oct 2013 17:31:04 +0100 |
parents | 750529532e53 |
children | 0106107cb972 |
files | yeti/cqtkernel.yeti |
diffstat | 1 files changed, 37 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/yeti/cqtkernel.yeti Wed Oct 23 17:31:04 2013 +0100 @@ -0,0 +1,37 @@ + +module cqtkernel; + +{ pow, round, nextPowerOfTwo } = load may.mathmisc; + +fs = 48000; + +fmax = fs/2; + +bins = 24; + +q = 1; + +atomHopFactor = 0.25; + +thresh = 0.0005; + +fmin = (fmax/2) * (pow 2 (1/bins)); + +bigQ = q / ((pow 2 (1/bins)) - 1); + +nk_max = round(bigQ * fs / fmin); + +nk_min = round(bigQ * fs / (fmin * (pow 2 ((bins-1)/bins)))); + +atomHop = round(nk_min * atomHopFactor); + +first_center = atomHop * Math#ceil(Math#ceil(nk_max/2) / atomHop); + +fftLen = nextPowerOfTwo (first_center + Math#ceil(nk_max/2)); + +println "fs = \(fs), fmax = \(fmax), bins = \(bins), q = \(q), atomHopFactor = \(atomHopFactor), thresh = \(thresh)"; + +println "fmin = \(fmin), bigQ = \(bigQ), nk_max = \(nk_max), nk_min = \(nk_min), atomHop = \(atomHop), first_center = \(first_center), fftLen = \(fftLen)"; + +(); +