Pages: 1 [2]   Go Down
 Author Topic: Sound Localization  (Read 4249 times) 0 Members and 1 Guest are viewing this topic.
Offline
Newbie
Karma: 0
Posts: 6
 « Reply #15 on: January 25, 2013, 06:12:56 am » Bigger Smaller Reset

So as well as the code for determine the position of the servos that you mentioned should i also remove this

Code:
for ( uint8_t i = 2; i < MIRROR; i++)  // LIMITS: 150 HZ
{                                      // Electrical grid interference, Motor Vibration.
vremn = 0;
if ((x_r[0][i] != -1) && (x_r[1][i] != -1))
{
vremn = x_r[0][i] - x_r[1][i];
if (vremn >  1024) vremn -= 2048;
if (vremn < -1024) vremn += 2048;

vremn = (32 * vremn) / i;
vremn -= 256;                      // MIC Time Offset Correction (1 ADC, 25 usec delay).

if (lokaVect[directin][i] < vremn) lokaVect[directin][i] += srvoAccl[directin];
if (lokaVect[directin][i] > vremn) lokaVect[directin][i] -= srvoAccl[directin];
}
}

Or just a section of this, as it is filtering the motor sound right?

Thank you
John
 Logged

Montreal
Offline
Karma: 27
Posts: 2556
 « Reply #16 on: January 25, 2013, 10:02:41 am » Bigger Smaller Reset

No, chunk of code is filtering multipath propagation / reverberation
 Logged

Offline
Newbie
Karma: 0
Posts: 6
 « Reply #17 on: January 25, 2013, 12:27:29 pm » Bigger Smaller Reset

This is the code i am currently employing however i am fairly sure my coefficient is completely wrong. I understand it should have a relation to the distance of the microphones but not sure how to calculate or determine what this should be. Do I need to workout what the average time it would take for the sound to travel the distance between them and use that as the coefficient?

I have tried a few completely random values for this but as im sure you can guess had no positive results.

Code:
float coefficient = 400;
float soundAngleY = srvoPosn[y];
soundAngleY = asin (coefficient * summa / 2048.0) * 180.0 / PI;
 Logged

Montreal
Offline