view annotationCalculatorSrc/Histogram.h @ 53:5274e3b5479d

Smoothed output, added tempo distribution variation to match the output
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 14 Aug 2012 21:45:12 +0100
parents 8df911733fdc
children
line wrap: on
line source
/*
 *  Histogram.h
 *  annotationResultCalculator
 *
 *  Created by Andrew on 08/05/2012.
 *  Copyright 2012 QMUL. All rights reserved.
 *
 */



#ifndef HISTOGRAM
#define HISTOGRAM

#include "ofMain.h"

class Histogram{
public:	
	Histogram();
	typedef std::vector<double> DoubleVector;
	typedef std::vector<int> IntVector;
	IntVector histogram;
	
	void createHistogram(const int& binWidthIn, const int& numberofBinsIn);
	void createAbsoluteHistogram(const int& binWidthIn, const int& numberofBinsIn);
	void createAbsoluteHistogramForMatchData();
	
	void processDataIntoHistogram(const DoubleVector& data);
	void plotHistogram();
	void plotHistogram(const double& maxHeight);
	
	void setBinPoints();
	void setBinPointsToMatchRange();
	
	int numberofBins;
	int binWidth;
	double minimumBinValue, maximumBinValue;
	
	DoubleVector binPoints;

	double maximum;
	int numberOutsideRange;
	
	int getY(const int& y);
	int screenHeight;
	void labelHistogram();
	void printHistogramPercentages();
};
#endif