diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/bayesianArray.h	Tue Aug 30 20:16:35 2011 +0100
@@ -0,0 +1,62 @@
+/*
+ *  bayesianArray.h
+ *  bayesianTest5
+ *
+ *  Created by Andrew Robertson on 08/05/2010.
+ *  Copyright 2010 __MyCompanyName__. All rights reserved.
+ *
+ */
+
+#ifndef	_BAYESIAN_ARRAY
+#define _BAYESIAN_ARRAY
+
+#define ARRAY_SIZE 240
+
+
+class bayesianArray{
+
+public:
+	
+	bayesianArray();
+	void initialiseArray();
+
+		void setGaussianLikelihoodForBeats(float mean, float StdDev);		
+		void setGaussianLikelihood(float mean, float StdDev);	
+		void setGaussianPrior(float mean, float StdDev);
+		void setGaussianPosterior(float mean, float StdDev);
+			
+		void calculatePosterior();
+		void renormalisePosterior();
+		void resetMaximumPosterior();//resets the max index
+		void decayPosteriorWithGaussianNoise();
+		void translateDistribution(int translationIndex);
+		void setDecayNoiseGaussian(float mean, float StdDev);
+		double calculateStandardDeviation();
+	
+		
+		float getMaximum(float *ptr, int length);
+		void renormaliseArray(float *ptr, int length);
+		void resetPrior();
+		void decayPosterior();
+		float* getMaximumEstimate(float *ptr, int length);
+		double getIntegratedEstimateIndex();
+	
+		float prior [ARRAY_SIZE];
+		float posterior [ARRAY_SIZE];
+		float likelihood [ARRAY_SIZE];	
+		float tempPosteriorArray[ARRAY_SIZE];
+
+		float decayNoiseArray[ARRAY_SIZE];
+		float decayNoiseStdDev, decayNoiseAmount;
+
+		float likelihoodMean, likelihoodStdDev, likelihoodNoise;
+		float maximumTest, posteriorDecayRate, maximumValue;
+		float eighthNoteProportion, earlySixteenthNoteProportion, lateSixteenthNoteProportion ;
+		float maximumEstimate, maximumIndex, integratedEstimate;
+		double standardDeviation;
+			
+private:
+};
+
+#endif
+	
\ No newline at end of file