comparison src/bayesianArray.h @ 0:0f9165f96bdb

started drum tracker project svn
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 30 Aug 2011 20:16:35 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0f9165f96bdb
1 /*
2 * bayesianArray.h
3 * bayesianTest5
4 *
5 * Created by Andrew Robertson on 08/05/2010.
6 * Copyright 2010 __MyCompanyName__. All rights reserved.
7 *
8 */
9
10 #ifndef _BAYESIAN_ARRAY
11 #define _BAYESIAN_ARRAY
12
13 #define ARRAY_SIZE 240
14
15
16 class bayesianArray{
17
18 public:
19
20 bayesianArray();
21 void initialiseArray();
22
23 void setGaussianLikelihoodForBeats(float mean, float StdDev);
24 void setGaussianLikelihood(float mean, float StdDev);
25 void setGaussianPrior(float mean, float StdDev);
26 void setGaussianPosterior(float mean, float StdDev);
27
28 void calculatePosterior();
29 void renormalisePosterior();
30 void resetMaximumPosterior();//resets the max index
31 void decayPosteriorWithGaussianNoise();
32 void translateDistribution(int translationIndex);
33 void setDecayNoiseGaussian(float mean, float StdDev);
34 double calculateStandardDeviation();
35
36
37 float getMaximum(float *ptr, int length);
38 void renormaliseArray(float *ptr, int length);
39 void resetPrior();
40 void decayPosterior();
41 float* getMaximumEstimate(float *ptr, int length);
42 double getIntegratedEstimateIndex();
43
44 float prior [ARRAY_SIZE];
45 float posterior [ARRAY_SIZE];
46 float likelihood [ARRAY_SIZE];
47 float tempPosteriorArray[ARRAY_SIZE];
48
49 float decayNoiseArray[ARRAY_SIZE];
50 float decayNoiseStdDev, decayNoiseAmount;
51
52 float likelihoodMean, likelihoodStdDev, likelihoodNoise;
53 float maximumTest, posteriorDecayRate, maximumValue;
54 float eighthNoteProportion, earlySixteenthNoteProportion, lateSixteenthNoteProportion ;
55 float maximumEstimate, maximumIndex, integratedEstimate;
56 double standardDeviation;
57
58 private:
59 };
60
61 #endif
62