annotate constant-q-cpp/misc/yeti/experiment.yeti @ 372:af71cbdab621 tip

Update bqvec code
author Chris Cannam
date Tue, 19 Nov 2019 10:13:32 +0000
parents 5d0a2ebb4d17
children
rev   line source
Chris@366 1
Chris@366 2 program experiment;
Chris@366 3
Chris@366 4 af = load may.stream.audiofile;
Chris@366 5 plot = load may.plot;
Chris@366 6 cm = load may.matrix.complex;
Chris@366 7 mat = load may.matrix;
Chris@366 8 vec = load may.vector;
Chris@366 9 manipulate = load may.stream.manipulate;
Chris@366 10 syn = load may.stream.syntheticstream;
Chris@366 11
Chris@366 12 { cqt } = load cqt;
Chris@366 13 { icqt } = load icqt;
Chris@366 14
Chris@366 15 //testStream = manipulate.withDuration 96000 (syn.sinusoid 48000 500);
Chris@366 16 //testStream = manipulate.withDuration 96000 (syn.pulseTrain 48000 4);
Chris@366 17 testStream = af.open "sweep-48000.wav";
Chris@366 18 //testStream = af.open "sweep.wav";
Chris@366 19
Chris@366 20 eprintln "have test stream";
Chris@366 21
Chris@366 22 cq = cqt { maxFreq = testStream.sampleRate/2, minFreq = 50, binsPerOctave = 24 } testStream;
Chris@366 23
Chris@366 24 eprintln "bin frequencies: \(cq.kernel.binFrequencies)";
Chris@366 25
Chris@366 26 icq = icqt cq;
Chris@366 27
Chris@366 28 eprintln "calculated icq...";
Chris@366 29
Chris@366 30 outfile = "test-output.wav";
Chris@366 31 written = af.write icq outfile;
Chris@366 32
Chris@366 33 eprintln "wrote \(written) to \(outfile)";
Chris@366 34
Chris@366 35 //for cq.cqSpectrogram do mm:
Chris@366 36 // for (mat.asColumns mm) (println . strJoin "," . vec.list);
Chris@366 37 //done;
Chris@366 38
Chris@366 39 /*
Chris@366 40 bigM = mat.concatHorizontal (map cm.magnitudes cq.output);
Chris@366 41
Chris@366 42 eprintln "overall output size = \(mat.size bigM)";
Chris@366 43
Chris@366 44 mat.print bigM;
Chris@366 45 */
Chris@366 46 //\() (plot.plot [Contour bigM]);
Chris@366 47 //\() (plot.plot [Grid bigM]);
Chris@366 48
Chris@366 49 ()
Chris@366 50