Wiki » History » Version 18

Chris Cannam, 2013-05-17 10:40 PM

1 1 Chris Cannam
h1. Wiki
2 1 Chris Cannam
3 10 Chris Cannam
h2. The method
4 10 Chris Cannam
5 14 Chris Cannam
*The method to be implemented* is that from "Anssi's Constant-Q Toolbox page":http://www.eecs.qmul.ac.uk/~anssik/cqt/.
6 1 Chris Cannam
7 1 Chris Cannam
 * The MATLAB toolbox reference implementation is "here":/projects/constant-q-toolbox.
8 1 Chris Cannam
9 16 Chris Cannam
 * The "QM-DSP":/projects/qm-dsp library also contains a Constant-Q implementation: there is a Vamp plugin of it in the "QM Vamp Plugins":/projects/qm-vamp-plugins set. I believe it is based on the method of Brown and Puckette. Our version isn't very good. Among other things, we should aim to produce an improved plugin. But this one may be useful as an extra reference.
10 4 Chris Cannam
11 8 Chris Cannam
*Has anyone already made one* corresponding directly to the Schörkhuber/Klapuri method? We don't want to duplicate effort. And if someone has, why don't I know about it? -- can we do anything to help make it more universally known?
12 9 Chris Cannam
13 9 Chris Cannam
*What other modern methods* exist in C++?
14 10 Chris Cannam
15 10 Chris Cannam
h2. What we want it for
16 1 Chris Cannam
17 11 Chris Cannam
The immediate requirement is as the first step in implementing Emmanouil Benetos and Simon Dixon's "music transcription":http://www.mitpressjournals.org/doi/abs/10.1162/COMJ_a_00146 method for a Vamp plugin.
18 11 Chris Cannam
19 11 Chris Cannam
But the reason we aren't using the QM-DSP constant-Q implementation is that it simply isn't good enough, and that means it isn't really good enough for the rest of the world either. We should make a better one to improve upon the existing QM Vamp Plugin as well.
20 13 Chris Cannam
21 17 Chris Cannam
The method described is invertible with some signal loss -- we should implement the inversion as well.
22 17 Chris Cannam
23 13 Chris Cannam
h2. Implementation notes
24 13 Chris Cannam
25 13 Chris Cannam
The Schörkhuber/Klapuri method has (at least) three useful qualities:
26 1 Chris Cannam
27 1 Chris Cannam
 # It's mathematically diligent. Decisions such as kernel and window shape are explained and supported in the paper.
28 17 Chris Cannam
 # There is an open source MATLAB implementation available, and others have tested it.
29 17 Chris Cannam
 # It is (somewhat) invertible. 
30 17 Chris Cannam
31 18 Chris Cannam
Also the nature of the constant-Q transform is such that it should be possible to test it using relatively little data.
32 17 Chris Cannam
33 17 Chris Cannam
This makes it a strong case for implementation using a unit testing or test-first regime. Mathematical support will help in generating synthetic test cases; the existing implementation gives a reference at each step (although we need to be careful not to trust it implicitly); and invertibility means we can test the forward-backward transforms.
34 17 Chris Cannam
35 17 Chris Cannam
(This is unlike some methods such as expectation-maximisation which have randomised initial parameters and few calculation steps using basic methods like matrix multiplication -- inviting code reviews and higher level acceptance testing rather than building on units.)