annotate dsp/rhythm/BeatSpectrum.h @ 298:255e431ae3d4

* Key detector: when returning key strengths, use the peak value of the three underlying chromagram correlations (from 36-bin chromagram) corresponding to each key, instead of the mean. Rationale: This is the same method as used when returning the key value, and it's nice to have the same results in both returned value and plot. The peak performed better than the sum with a simple test set of triads, so it seems reasonable to change the plot to match the key output rather than the other way around. * FFT: kiss_fftr returns only the non-conjugate bins, synthesise the rest rather than leaving them (perhaps dangerously) undefined. Fixes an uninitialised data error in chromagram that could cause garbage results from key detector. * Constant Q: remove precalculated values again, I reckon they're not proving such a good tradeoff.
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 05 Jun 2009 15:12:39 +0000
parents 9619d6995b73
children e5907ae6de17
rev   line source
c@256 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
c@256 2
c@256 3 /*
c@256 4 QM DSP Library
c@256 5
c@256 6 Centre for Digital Music, Queen Mary, University of London.
c@256 7 This file copyright 2008 Kurt Jacobson and QMUL.
c@256 8 All rights reserved.
c@256 9 */
c@256 10
c@256 11 #ifndef BEATSPECTRUM_H
c@256 12 #define BEATSPECTRUM_H
c@256 13
c@256 14 #include <vector>
c@256 15
c@256 16 /**
c@256 17 * Given a matrix of "feature values", calculate a self-similarity
c@256 18 * vector. The resulting vector will have half as many elements as
c@256 19 * the number of columns in the matrix. This is based on the
c@256 20 * SoundBite rhythmic similarity code.
c@256 21 */
c@256 22
c@256 23 class BeatSpectrum
c@256 24 {
c@256 25 public:
c@257 26 BeatSpectrum() { }
c@257 27 ~BeatSpectrum() { }
c@256 28
c@256 29 std::vector<double> process(const std::vector<std::vector<double> > &inmatrix);
c@256 30
c@256 31 };
c@256 32
c@256 33 #endif
c@256 34
c@256 35