Mercurial > hg > bayesian-drum-tracker
view newOFsrc/bayesianArray.h @ 4:1ea18717ba7c
Adding in evaluation program for the tests - has the ouput of five trackers plus the input times in ms
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Fri, 24 Feb 2012 15:51:09 +0000 |
parents | 6565c7cb9c71 |
children | fc095148e2a8 |
line wrap: on
line source
/* * 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 renormalisePrior(); 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; double getKLdivergence(); double getEntropyOfPosterior(); private: }; #endif