I'm trying to make a simple arduino based tone detector.....
the block diagram is as under
The input is through the speaker. when it detects a specific tone (a simple sinewave tone which sounds like Tuuuuuuuuuuuuuuuuu), it switches on the red led...
for testing purpose im generating this tone input sound via a arduino+voice codec+speaker
left_out is the left channel of audio output.
temp2 is a sine wave signal
counter ensures that the tone is produced for roughly 3 seconds duration
//sine wave output
if(counter<4000)
{
left_out = temp2; // put sinusoid out on left channel
right_out =0; // put inverted version out on right chanel
counter++;
}
at the receiver end.... i need to trigger an event (like led switch on) when this tone is heard.
I know in theory what to do....
detect the frequency of inputsignal. when frequency matches the frequency i want to detect, trigger an alarm/event.
I dont know how to write this in code !!!!