comparison yeti/cqtkernel.yeti @ 4:e026003433e5

Minor fixes
author Chris Cannam <c.cannam@qmul.ac.uk>
date Thu, 24 Oct 2013 15:09:38 +0100
parents 53711c07ae3f
children 6b59109469c4
comparison
equal deleted inserted replaced
3:53711c07ae3f 4:e026003433e5
4 vec = load may.vector; 4 vec = load may.vector;
5 bf = load may.vector.blockfuncs; 5 bf = load may.vector.blockfuncs;
6 complex = load may.complex; 6 complex = load may.complex;
7 window = load may.signal.window; 7 window = load may.signal.window;
8 fft = load may.transform.fft; 8 fft = load may.transform.fft;
9 pl = load may.plot;
9 10
10 { pow, round, floor, ceil, nextPowerOfTwo } = load may.mathmisc; 11 { pow, round, floor, ceil, nextPowerOfTwo } = load may.mathmisc;
11 12
12 fs = 48000; 13 fs = 48000;
13 14
76 77
77 map do i: 78 map do i:
78 79
79 shift = atomOffset + ((i-1) * atomHop); 80 shift = atomOffset + ((i-1) * atomHop);
80 81
82 println "shift = \(shift)";
83
81 specKernel = fftFunc 84 specKernel = fftFunc
82 (complex.complexArray 85 (complex.complexArray
83 (vec.concat [vec.zeros shift, reals]) 86 (vec.concat [vec.zeros shift, reals])
84 (vec.concat [vec.zeros shift, imags])); 87 (vec.concat [vec.zeros shift, imags]));
85 88
86 map do c: 89 map do c:
87 if complex.magnitude c < thresh then complex.zero else c fi 90 if complex.magnitude c < thresh then complex.zero
91 else complex.scale (1/fftLen) c fi
88 done specKernel; 92 done specKernel;
89 93
90 done [1..winNr]; 94 done [1..winNr];
91 95
92 done [1..bins]; 96 done [1..bins];
93 97
94 println "kernels = \(kernels)"; 98 array (map array (concat kernels));
95 99
96 ();
97 100