Mercurial > hg > constant-q-cpp
changeset 41:ae7d2e558ed1
More debug testing
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 19 Nov 2013 19:27:45 +0000 |
parents | 031386846e3c |
children | 53d1e0d59ac5 |
files | yeti/cqt.yeti yeti/test.yeti |
diffstat | 2 files changed, 11 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/yeti/cqt.yeti Tue Nov 19 14:37:23 2013 +0000 +++ b/yeti/cqt.yeti Tue Nov 19 19:27:45 2013 +0000 @@ -17,13 +17,13 @@ octaves = ceil (log2 (maxFreq / minFreq)); actualMinFreq = (maxFreq / (pow 2 octaves)) * (pow 2 (1/binsPerOctave)); - eprintln "sampleRate = \(sampleRate), maxFreq = \(maxFreq), minFreq = \(minFreq), actualMinFreq = \(actualMinFreq), octaves = \(octaves), binsPerOctave = \(binsPerOctave)"; + kdata = cqtkernel.makeKernel { sampleRate, maxFreq, binsPerOctave }; - kdata = cqtkernel.makeKernel { sampleRate, maxFreq, binsPerOctave }; + eprintln "sampleRate = \(sampleRate), maxFreq = \(maxFreq), minFreq = \(minFreq), actualMinFreq = \(actualMinFreq), octaves = \(octaves), binsPerOctave = \(binsPerOctave), fftSize = \(kdata.fftSize), hop = \(kdata.fftHop)"; eprintln "atomsPerFrame = \(kdata.atomsPerFrame)"; - padding = (kdata.fftSize / 2) * (pow 2 (octaves-1)); + padding = (kdata.fftSize * (pow 2 (octaves-1))); eprintln "padding = \(padding)"; @@ -45,6 +45,8 @@ (resample.decimated (pow 2 octave) streams[octave]); map do frame: freq = fftFunc (cplx.complexArray frame (vec.zeros kdata.fftSize)); + println "octave = \(octave), frame = \(vec.list frame)"; + println "octave = \(octave), freq = \(freq)"; cm.product kernel (cm.newComplexColumnVector freq); done frames; done [0..octaves-1]; @@ -104,7 +106,7 @@ cqblocks = array (map2 do octlist octave: d = emptyHops * (pow 2 (octaves-octave)) - emptyHops; - d = 0; //!!! +// d = 0; //!!! eprintln "dropping \(d)"; drop d octlist;
--- a/yeti/test.yeti Tue Nov 19 14:37:23 2013 +0000 +++ b/yeti/test.yeti Tue Nov 19 19:27:45 2013 +0000 @@ -16,9 +16,10 @@ //testStream = af.open "sweep-48000.wav"; //testStream = af.open "sweep.wav"; -testStream = manipulate.withDuration 64 (syn.sinusoid 8 2); +//testStream = manipulate.withDuration 64 (syn.sinusoid 8 2); +// So the stream is [ 0, 1, 0, -1, 0, 1, 0, -1, ... ] -// So the stream is [ 0, 1, 0, -1, 0, 1, 0, -1, ... ] +testStream = manipulate.withDuration 32 (syn.pulseTrain 8 0.001); eprintln "have test stream"; @@ -26,10 +27,12 @@ eprintln "bin frequencies: \(cq.kernel.binFrequencies)"; +/* for cq.output do c: mm = cm.magnitudes c; for (mat.asColumns mm) (println . strJoin "," . vec.list); done; +*/ bigM = mat.concatHorizontal (map cm.magnitudes cq.output);