annotate src/EM.h @ 37:947996aac974

Calculate column sums, etc
author Chris Cannam
date Fri, 04 Apr 2014 18:18:18 +0100
parents 74b77a4d6552
children 5164bccf3064
rev   line source
Chris@34 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@34 2
Chris@34 3 /*
Chris@34 4 Silvet
Chris@34 5
Chris@34 6 A Vamp plugin for note transcription.
Chris@34 7 Centre for Digital Music, Queen Mary University of London.
Chris@34 8
Chris@34 9 This program is free software; you can redistribute it and/or
Chris@34 10 modify it under the terms of the GNU General Public License as
Chris@34 11 published by the Free Software Foundation; either version 2 of the
Chris@34 12 License, or (at your option) any later version. See the file
Chris@34 13 COPYING included with this distribution for more information.
Chris@34 14 */
Chris@34 15
Chris@34 16 #ifndef SILVET_EM_H
Chris@34 17 #define SILVET_EM_H
Chris@34 18
Chris@34 19 #include <vector>
Chris@34 20
Chris@34 21 class EM
Chris@34 22 {
Chris@34 23 public:
Chris@34 24 EM();
Chris@34 25 ~EM();
Chris@34 26
Chris@36 27 void iterate(std::vector<double> column);
Chris@36 28 void report();
Chris@34 29
Chris@34 30 private:
Chris@34 31 typedef std::vector<double> V;
Chris@34 32 typedef std::vector<std::vector<double> > Grid;
Chris@34 33
Chris@34 34 V m_pitches;
Chris@34 35 Grid m_sources;
Chris@36 36
Chris@36 37 V m_estimate;
Chris@36 38 V m_q;
Chris@34 39
Chris@35 40 int m_notes;
Chris@35 41 int m_bins;
Chris@35 42 int m_instruments;
Chris@35 43
Chris@34 44 int m_lowest;
Chris@34 45 int m_highest;
Chris@35 46
Chris@36 47 void normalise(V &column);
Chris@36 48 void expectation(const V &column);
Chris@36 49 void maximisation(const V &column);
Chris@36 50
Chris@35 51 bool inRange(int instrument, int note);
Chris@34 52 };
Chris@34 53
Chris@34 54 #endif