comparison src/BayesianArrayStructure.h @ 0:b299a65a3ad0

start project
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 16 Aug 2011 11:29:59 +0100
parents
children 5581023e0de4
comparison
equal deleted inserted replaced
-1:000000000000 0:b299a65a3ad0
1 /*
2 * BayesianArrayStructure.h
3 * midiCannamReader
4 *
5 * Created by Andrew on 17/07/2011.
6 * Copyright 2011 QMUL. All rights reserved.
7 *
8 */
9
10 #include "ofMain.h"
11 //#include "DynamicBayesianArray.h"
12 #include "DynamicVector.h"
13
14 class BayesianArrayStructure {
15
16 public:
17 // BayesianArrayStructure();
18 BayesianArrayStructure();
19 BayesianArrayStructure(int length);
20
21 void calculatePosterior();
22 void drawArrays();
23 void drawArraysRelativeToTimeframe(const double& startTimeMillis, const double& endTimeMillis);
24
25 void drawTempoArrays();
26
27 void resetSize(int length);
28 void resetArrays();
29 void simpleExample();
30
31 double screenWidth;
32
33 void copyPriorToPosterior();
34 // DynamicBayesianArray bayesArray;
35
36 double lastEventTime;
37
38 DynamicVector tmpPrior;
39
40 DynamicVector prior;
41 DynamicVector posterior;
42 DynamicVector likelihood;
43
44 DynamicVector relativeSpeedPrior;
45 DynamicVector relativeSpeedLikelihood;
46 DynamicVector relativeSpeedPosterior;
47 DynamicVector acceleration;
48
49 void resetSpeedToOne();
50
51 double bestEstimate;
52 void updateBestEstimate();
53 // double lastBestEstimateUpdateTime;
54
55 double speedDecayWidth, speedDecayAmount;
56 void decaySpeedDistribution(double timeDifference);
57
58 void resetSpeedSize(int length);
59 void setRelativeSpeedScalar(double f);
60 void calculateNewPriorOffset(const double& timeDifference);
61 void setNewDistributionOffsets(const double& newOffset);
62
63 void updateTempoDistribution(const double& speedRatio, const double& matchFactor);
64
65 void setFlatTempoLikelihood();
66 void calculateTempoUpdate();
67 void updateTempoLikelihood(const double& speedRatio, const double& matchFactor);
68
69 void crossUpdateArrays(DynamicVector& position, DynamicVector& speed, double timeDifference);
70
71 };
72