Mercurial > hg > constant-q-cpp
view yeti/test.yeti @ 49:0cecb0f8455b
We shouldn't need to compensate for max(latency)+max(drop) but for max(latency+drop); also the padding can be rounded to hop rather than fft size I think?
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 28 Nov 2013 10:58:02 +0000 |
parents | 337d3b324c75 |
children | e2b7f7462618 |
line wrap: on
line source
program test; af = load may.stream.audiofile; plot = load may.plot; cm = load may.matrix.complex; mat = load may.matrix; vec = load may.vector; manipulate = load may.stream.manipulate; syn = load may.stream.syntheticstream; { cqt } = load cqt; //testStream = manipulate.withDuration 96000 (syn.sinusoid 48000 500); //testStream = manipulate.withDuration 96000 (syn.pulseTrain 48000 4); testStream = af.open "sweep-48000.wav"; //testStream = af.open "sweep.wav"; // So the stream is [ 0, 1, 0, -1, 0, 1, 0, -1, ... ] : //testStream = manipulate.withDuration 64 (syn.sinusoid 8 2); //testStream = manipulate.withDuration 32 (syn.pulseTrain 8 0.001); eprintln "have test stream"; cq = cqt { maxFreq = testStream.sampleRate/2, minFreq = 50, binsPerOctave = 24 } testStream; 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); eprintln "overall output size = \(mat.size bigM)"; mat.print bigM; //\() (plot.plot [Contour bigM]); //\() (plot.plot [Grid bigM]); ()