# Sound Project

Hello all. I had an idea for a project but I don’t know what it requires. I want to detect a specific noise (like from a small animal, it’s a specific sound)… Sort of like a census I guess.

If you could steer me in the right direction that would be wonderful.

We are going to need more details. How loud is the sound? What frequencies?

You’ll need a microphone to pick up the sound, obviously. Beyond that, though, you’ll need a way to convert that sound to a digital pattern, so that you can compare it to a known sound. That will not be particularly easy, and may exceed the capabilities of an Arduino.

For inputting audio you need something like the circuit shown here:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/

However, distinguishing one type of sound from another will prove almost impossible.

“Fast Fourier transform” would a good keyword to start a googlesearch.
You can seperate the dominant sinewave with it. (theoretically, if you understand all that stuff. I don’t do! )

So you determine the “tone” like a guitar tuner… at least, if the atmega’s capacities are enough…

If you’re just looking for a single tone, I think Goertzel’s algorithm is much simpler than an FFT.

I do believe that OP said that the intent was to listen for the sound made by a young animal. Young animals are not especially known for perfect pitch and tone.

Takes a little bit of practice to moo in the pitch.

You can seperate the dominant sinewave with it. (theoretically, if you understand all that stuff. I don’t do! Smiley )

I do understand it and all you will get is a mass of frequency energies. This does not help you much to distinguish one animal sound from another.

I do believe that OP said that the intent was to listen for the sound made by a young animal.

Do you believe that? That’s isn’t what I read - (small != young)

Oops. My bad. I read small and thought young. Oh, well. Next time, I’ll double-check.

That might be somewhat easy. If the animal has variation in the sound, such as length and pitch, then things might be tricky.

You could start it off by recording the sound of an animal that has very low variation in the sound. You would record this by creating an array(or many variables) and then recording the sound level every millisecond for 20-50 milliseconds, and putting them into the array(or puting them in their own variables.) You could turn this array(or your variables) into the threshold of the sound.

As for detecting a sound, you could set the Arduino to record the sound. You could then proceed to compare each millisecond of the sound to the threshold, and, if there is a low variation from the threshold, you could add a 1 to another array(I’ll explain this later). If there is high variation, you could add a 0 to the array. With the new aray, you can determine if the sound was made by the animal or not by confirming whether 5%-10% of the array is a 0. As for triggering the recorder, you could use the first three milliseconds of the threshold and perpetually compare them to the sound levels of the environment, triggering the recorder when the sound levels almost match the threshold.

In theory you could do that. I also have an idea for an advanced sound detector if the Arduino’s software permits it. Contact me if you would like me to explain my idea for the advanced detector.

Good Luck!

In theory you could do that.

Have you tried that? Suppose the sounds were identical, could you detect that?
I would say that you couldn’t because identical inputs would not necessarily give you identical samples. This is due to things like quantization errors in both time and amplitude, that could give you a completely different set of samples for the same audio input.

I neglected to include some of the other detection parameters. I was planning on comparing a millisecond of the sound to multiple thresholds, each threshold comparing six of the nearby milliseconds of itself to the single millisecond in question. I’ll test it out and see if I can do it with a photo resistor. I might even be able to include a synchronizer(in the case of length variation in the sound).

I have a strange feeling that I am missing something.

If you have any concerns with the theory, please tell

I’ll test it out and see if I can do it with a photo resistor.

I thought we were talking about sound?

I have a strange feeling that I am missing something.

Draw a sin wave and over lay say 12 sample lines evenly spaced. The write down the sample values. Now move the sample grid along one quarter of the distance between the samples and write down the samples again.

Is there any correlation between these samples?
No.
Is it the same input waveform?
Yes.

Can you tell it is the same sound from looking at the numbers?
No.

I was going to use the photo resistor in order to debug the system and to find the right parameters for optimum performance. As for your argument, you are correct. There is a way that I can get good results, but I might have to resort to volume-based comparisons, say a method that finds the highest level read from a microphone from about 10 samples in one millisecond.