diff 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
line wrap: on
line diff
--- a/dsp/chromagram/Chromagram.h	Wed May 29 14:08:43 2019 +0100
+++ b/dsp/chromagram/Chromagram.h	Wed May 29 15:56:30 2019 +0100
@@ -35,10 +35,35 @@
 public:	
     Chromagram( ChromaConfig Config );
     ~Chromagram();
-	
-    double* process( const double *data ); // time domain
-    double* process( const double *real, const double *imag ); // frequency domain
-    void unityNormalise( double* src );
+
+    /**
+     * Process a time-domain input signal of length equal to
+     * getFrameSize().
+     * 
+     * The returned buffer contains the chromagram values indexed by
+     * bin, with the number of values corresponding to the BPO field
+     * in the ChromaConfig supplied at construction. It is owned by
+     * the Chromagram object and is reused from one process call to
+     * the next.
+     */
+    double *process(const double *data);
+    
+    /**
+     * Process a frequency-domain input signal generated from a
+     * time-domain signal of length equal to getFrameSize() that has
+     * been windowed and "fftshifted" to place the zero index in the
+     * centre of the frame. The real and imag buffers must each
+     * contain the full getFrameSize() frequency bins.
+     * 
+     * The returned buffer contains the chromagram values indexed by
+     * bin, with the number of values corresponding to the BPO field
+     * in the ChromaConfig supplied at construction. It is owned by
+     * the Chromagram object and is reused from one process call to
+     * the next.
+     */
+    double *process(const double *real, const double *imag);
+    
+    void unityNormalise(double* src);
 
     // Complex arithmetic
     double kabs( double real, double imag );