diff dsp/tempotracking/DownBeat.h @ 281:33e03341d541

* Make it possible to retrieve beat spectral difference function from bar detector * Avoid crashes when bar detector is run with very short input
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 27 Feb 2009 10:23:08 +0000
parents 9c403afdd9e9
children 6cb2b3cd5356
line wrap: on
line diff
--- a/dsp/tempotracking/DownBeat.h	Tue Feb 10 16:37:11 2009 +0000
+++ b/dsp/tempotracking/DownBeat.h	Fri Feb 27 10:23:08 2009 +0000
@@ -65,6 +65,17 @@
                        size_t audioLength, // after downsampling
                        const vector<double> &beats,
                        vector<int> &downbeats);
+
+    /**
+     * Return the beat spectral difference function.  This is
+     * calculated during findDownBeats, so this function can only be
+     * meaningfully called after that has completed.  The returned
+     * vector contains one value for each of the beat times passed in
+     * to findDownBeats, less one.  Each value contains the spectral
+     * difference between region prior to the beat's nominal position
+     * and the region following it.
+     */
+    void getBeatSD(vector<double> &beatsd) const;
     
     /**
      * For your downsampling convenience: call this function
@@ -110,6 +121,7 @@
     double *m_beatframe;
     double *m_fftRealOut;
     double *m_fftImagOut;
+    d_vec_t m_beatsd;
 };
 
 #endif