Mercurial > hg > pyin
annotate MonoPitchHMM.h @ 164:a7d9c6142f8f tip
Added tag v1.2 for changeset 4a97f7638ffd
author | Chris Cannam |
---|---|
date | Thu, 06 Feb 2020 15:02:47 +0000 |
parents | 3faac48d491d |
children |
rev | line source |
---|---|
matthiasm@0 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@9 | 2 |
matthiasm@0 | 3 /* |
Chris@9 | 4 pYIN - A fundamental frequency estimator for monophonic audio |
Chris@9 | 5 Centre for Digital Music, Queen Mary, University of London. |
Chris@9 | 6 |
Chris@9 | 7 This program is free software; you can redistribute it and/or |
Chris@9 | 8 modify it under the terms of the GNU General Public License as |
Chris@9 | 9 published by the Free Software Foundation; either version 2 of the |
Chris@9 | 10 License, or (at your option) any later version. See the file |
Chris@9 | 11 COPYING included with this distribution for more information. |
matthiasm@0 | 12 */ |
matthiasm@0 | 13 |
matthiasm@0 | 14 #ifndef _MONOPITCHHMM_H_ |
matthiasm@0 | 15 #define _MONOPITCHHMM_H_ |
matthiasm@0 | 16 |
matthiasm@0 | 17 #include "SparseHMM.h" |
matthiasm@0 | 18 |
matthiasm@0 | 19 #include <boost/math/distributions.hpp> |
matthiasm@0 | 20 |
matthiasm@0 | 21 #include <vector> |
matthiasm@0 | 22 #include <cstdio> |
matthiasm@0 | 23 |
matthiasm@0 | 24 using std::vector; |
matthiasm@0 | 25 |
matthiasm@0 | 26 class MonoPitchHMM : public SparseHMM |
matthiasm@0 | 27 { |
matthiasm@0 | 28 public: |
mail@132 | 29 MonoPitchHMM(int fixedLag); |
Chris@156 | 30 std::vector<double> calculateObsProb(const vector<pair<double, double> > &); |
Chris@156 | 31 float nearestFreq(int state, const vector<pair<double, double> > &pitchProb); |
matthiasm@0 | 32 void build(); |
matthiasm@0 | 33 double m_minFreq; // 82.40689f/2 |
Chris@138 | 34 int m_nBPS; |
Chris@138 | 35 int m_nPitch; |
Chris@138 | 36 int m_transitionWidth; |
matthiasm@0 | 37 double m_selfTrans; |
matthiasm@0 | 38 double m_yinTrust; |
matthiasm@0 | 39 vector<double> m_freqs; |
matthiasm@0 | 40 }; |
matthiasm@0 | 41 |
matthiasm@0 | 42 #endif |