VABinauralTOAEstimator.cpp 539 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
#define _USE_MATH_DEFINES

#define SPEEDOFSOUND 343
#define HEADRADIUS 0.06

#define DELAY HEADRADIUS / SPEEDOFSOUND

#include "VABinauralTOAEstimator.h"

#include <math.h>

VABinauralTOAEstimator::VABinauralTOAEstimator()
{
}


VABinauralTOAEstimator::~VABinauralTOAEstimator()
{
}

double
VABinauralTOAEstimator::getTOALeft(double phi, double theta)
{
	return DELAY * ((sin(phi) * cos(theta) / 2) + 1);
}

double
VABinauralTOAEstimator::getTOARight(double phi, double theta)
{
	return DELAY * ((sin(phi - M_PI) * cos(theta) / 2) + 1);
}