Mercurial > hg > qm-dsp
comparison dsp/chromagram/Chromagram.h @ 467:1db23b9a8da4
Fix mismatch between time- and frequency-domain versions of the
chromagram process method - the frequency-domain one expects fftshifted
input and the kernel is set up for that, but the time-domain one wasn't
doing it
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Wed, 29 May 2019 15:56:30 +0100 |
parents | 50a97c8d52ed |
children | fdaa63607c15 |
comparison
equal
deleted
inserted
replaced
466:46375e6d1b54 | 467:1db23b9a8da4 |
---|---|
33 { | 33 { |
34 | 34 |
35 public: | 35 public: |
36 Chromagram( ChromaConfig Config ); | 36 Chromagram( ChromaConfig Config ); |
37 ~Chromagram(); | 37 ~Chromagram(); |
38 | 38 |
39 double* process( const double *data ); // time domain | 39 /** |
40 double* process( const double *real, const double *imag ); // frequency domain | 40 * Process a time-domain input signal of length equal to |
41 void unityNormalise( double* src ); | 41 * getFrameSize(). |
42 * | |
43 * The returned buffer contains the chromagram values indexed by | |
44 * bin, with the number of values corresponding to the BPO field | |
45 * in the ChromaConfig supplied at construction. It is owned by | |
46 * the Chromagram object and is reused from one process call to | |
47 * the next. | |
48 */ | |
49 double *process(const double *data); | |
50 | |
51 /** | |
52 * Process a frequency-domain input signal generated from a | |
53 * time-domain signal of length equal to getFrameSize() that has | |
54 * been windowed and "fftshifted" to place the zero index in the | |
55 * centre of the frame. The real and imag buffers must each | |
56 * contain the full getFrameSize() frequency bins. | |
57 * | |
58 * The returned buffer contains the chromagram values indexed by | |
59 * bin, with the number of values corresponding to the BPO field | |
60 * in the ChromaConfig supplied at construction. It is owned by | |
61 * the Chromagram object and is reused from one process call to | |
62 * the next. | |
63 */ | |
64 double *process(const double *real, const double *imag); | |
65 | |
66 void unityNormalise(double* src); | |
42 | 67 |
43 // Complex arithmetic | 68 // Complex arithmetic |
44 double kabs( double real, double imag ); | 69 double kabs( double real, double imag ); |
45 | 70 |
46 // Results | 71 // Results |