annotate yeti/test.yeti @ 56:e2b7f7462618
Single Makefile, build Vamp by default
author |
Chris Cannam <c.cannam@qmul.ac.uk> |
date |
Thu, 30 Jan 2014 10:33:38 +0000 |
parents |
337d3b324c75 |
children |
a219bab90abe |
rev |
line source |
c@37
|
1
|
c@37
|
2 program test;
|
c@37
|
3
|
c@37
|
4 af = load may.stream.audiofile;
|
c@37
|
5 plot = load may.plot;
|
c@37
|
6 cm = load may.matrix.complex;
|
c@37
|
7 mat = load may.matrix;
|
c@37
|
8 vec = load may.vector;
|
c@37
|
9 manipulate = load may.stream.manipulate;
|
c@37
|
10 syn = load may.stream.syntheticstream;
|
c@37
|
11
|
c@37
|
12 { cqt } = load cqt;
|
c@37
|
13
|
c@37
|
14 //testStream = manipulate.withDuration 96000 (syn.sinusoid 48000 500);
|
c@37
|
15 //testStream = manipulate.withDuration 96000 (syn.pulseTrain 48000 4);
|
c@44
|
16 testStream = af.open "sweep-48000.wav";
|
c@37
|
17 //testStream = af.open "sweep.wav";
|
c@37
|
18
|
c@43
|
19 // So the stream is [ 0, 1, 0, -1, 0, 1, 0, -1, ... ] :
|
c@44
|
20 //testStream = manipulate.withDuration 64 (syn.sinusoid 8 2);
|
c@38
|
21
|
c@56
|
22 testStream = manipulate.withDuration 32 (syn.pulseTrain 8 0.001);
|
c@37
|
23
|
c@37
|
24 eprintln "have test stream";
|
c@37
|
25
|
c@44
|
26 cq = cqt { maxFreq = testStream.sampleRate/2, minFreq = 50, binsPerOctave = 24 } testStream;
|
c@37
|
27
|
c@40
|
28 eprintln "bin frequencies: \(cq.kernel.binFrequencies)";
|
c@40
|
29
|
c@41
|
30 /*
|
c@40
|
31 for cq.output do c:
|
c@37
|
32 mm = cm.magnitudes c;
|
c@37
|
33 for (mat.asColumns mm) (println . strJoin "," . vec.list);
|
c@37
|
34 done;
|
c@41
|
35 */
|
c@37
|
36
|
c@40
|
37 bigM = mat.concatHorizontal (map cm.magnitudes cq.output);
|
c@37
|
38
|
c@38
|
39 eprintln "overall output size = \(mat.size bigM)";
|
c@38
|
40
|
c@39
|
41 mat.print bigM;
|
c@38
|
42
|
c@38
|
43 //\() (plot.plot [Contour bigM]);
|
c@56
|
44 \() (plot.plot [Grid bigM]);
|
c@37
|
45
|
c@37
|
46 ()
|
c@37
|
47
|