Connected multiple microphones to the IO Expansion board with arduino nano processor inside. Changed the program to read the values from multiple microphones and I noticed that there is a difference of 4 db in sound when we speak onto either direction. If we speak into right left side microphone shows value of 4db less than right and vice versa.
Microphones are connected to the bone conducting headphones to simulate human head.
New Arduino Sketch that reads input from two microphones.
//size of the window
const int inputWindow = 100;
// placeholder for a single measurement
unsigned int inputSample1;
unsigned int inputSample2;
void setup() {
// initializing the analog input
//pinMode(inputPin, INPUT);
// initializing the serial communication
Serial.begin(9600);
}
void loop() {
// two variables for minimum and maximum values in window
unsigned int inputMax1 = 0;
unsigned int inputMin1 = 1024;
unsigned int inputMax2 = 0;
unsigned int inputMin2 = 1024;
// loop for the window
for (unsigned int i = 0; i < inputWindow; i++) {
// read in a single value
inputSample1 = analogRead(A0);
inputSample2 = analogRead(A3);
// get the minimum and maximum value
inputMin1 = min(inputMin1, inputSample1);
inputMax1 = max(inputMax1, inputSample1);
inputMin2 = min(inputMin2, inputSample2);
inputMax2 = max(inputMax2, inputSample2);
}
// send the values on serial
Serial.print(“Min Mic 1 : “);
Serial.print(inputMin1);
Serial.print(” Max Mic 1 : “);
Serial.print(inputMax1);
Serial.print(” Diff Mic 1 :”);
Serial.print(inputMax1 – inputMin1);
Serial.println();
Serial.print(“Min Mic 2 : “);
Serial.print(inputMin2);
Serial.print(” Max Mic 2 : “);
Serial.print(inputMax2);
Serial.print(” Diff Mic 2 :”);
Serial.print(inputMax2 – inputMin2);
Serial.println();
}