annotate dsp/rhythm/BeatSpectrum.h @ 73:dcb555b90924

* 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 cannam
date Fri, 05 Jun 2009 15:12:39 +0000
parents 8bb764969d50
children e5907ae6de17
rev   line source
cannam@31 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
cannam@31 2
cannam@31 3 /*
cannam@31 4 QM DSP Library
cannam@31 5
cannam@31 6 Centre for Digital Music, Queen Mary, University of London.
cannam@31 7 This file copyright 2008 Kurt Jacobson and QMUL.
cannam@31 8 All rights reserved.
cannam@31 9 */
cannam@31 10
cannam@31 11 #ifndef BEATSPECTRUM_H
cannam@31 12 #define BEATSPECTRUM_H
cannam@31 13
cannam@31 14 #include <vector>
cannam@31 15
cannam@31 16 /**
cannam@31 17 * Given a matrix of "feature values", calculate a self-similarity
cannam@31 18 * vector. The resulting vector will have half as many elements as
cannam@31 19 * the number of columns in the matrix. This is based on the
cannam@31 20 * SoundBite rhythmic similarity code.
cannam@31 21 */
cannam@31 22
cannam@31 23 class BeatSpectrum
cannam@31 24 {
cannam@31 25 public:
cannam@32 26 BeatSpectrum() { }
cannam@32 27 ~BeatSpectrum() { }
cannam@31 28
cannam@31 29 std::vector<double> process(const std::vector<std::vector<double> > &inmatrix);
cannam@31 30
cannam@31 31 };
cannam@31 32
cannam@31 33 #endif
cannam@31 34
cannam@31 35