c@1: c@1: module cqtkernel; c@1: c@1: { pow, round, nextPowerOfTwo } = load may.mathmisc; c@1: c@1: fs = 48000; c@1: c@1: fmax = fs/2; c@1: c@1: bins = 24; c@1: c@1: q = 1; c@1: c@1: atomHopFactor = 0.25; c@1: c@1: thresh = 0.0005; c@1: c@1: fmin = (fmax/2) * (pow 2 (1/bins)); c@1: c@1: bigQ = q / ((pow 2 (1/bins)) - 1); c@1: c@1: nk_max = round(bigQ * fs / fmin); c@1: c@1: nk_min = round(bigQ * fs / (fmin * (pow 2 ((bins-1)/bins)))); c@1: c@1: atomHop = round(nk_min * atomHopFactor); c@1: c@1: first_center = atomHop * Math#ceil(Math#ceil(nk_max/2) / atomHop); c@1: c@1: fftLen = nextPowerOfTwo (first_center + Math#ceil(nk_max/2)); c@1: c@1: println "fs = \(fs), fmax = \(fmax), bins = \(bins), q = \(q), atomHopFactor = \(atomHopFactor), thresh = \(thresh)"; c@1: c@1: println "fmin = \(fmin), bigQ = \(bigQ), nk_max = \(nk_max), nk_min = \(nk_min), atomHop = \(atomHop), first_center = \(first_center), fftLen = \(fftLen)"; c@1: c@1: (); c@1: