Go Down

Topic: Sound comparison (Read 3 times) previous topic - next topic

Grumpy_Mike

@ ameora
The reason that there are so few replies is that this is a near impossible project. Differentiating between sounds is not easy given unlimited memory and processing power. With the limited amount of memory and processing on the arduino you are wasting your time.

qwertygin

Maybe if ELM Chan's FFT Library for Arduino was used it could work?
http://arduino.cc/forum/index.php/topic,56331.0.html

the dull sound would have less high frequency energy compared to the high pitched frequency components of the normal sound...
correct me if i'm wrong,but sampling should also be very fast to accurately record high pitched components, but maybe...
If shit didn't happen..
..you would explode..

brucethehoon


Maybe if ELM Chan's FFT Library for Arduino was used it could work?
http://arduino.cc/forum/index.php/topic,56331.0.html

the dull sound would have less high frequency energy compared to the high pitched frequency components of the normal sound...
correct me if i'm wrong,but sampling should also be very fast to accurately record high pitched components, but maybe...



This has potential.  Offloading the spectrum analysis to the MSGEQ7 would help reduce CPU cycles spent sampling the audio and free them up for the actual fingerprint analysis.   Essentially, you'd need to  record as many example sounds as possible, play them into the device, note the spectrum spread, convert this into percentage values for each spectrum as compared to the others, keeping in mind volume variations and allowing a certain percentage of variation.   

Test, repeat, repeat (repeat......) until you have a reasonable table of sounds to values.

It's more and more possible the more I think about it, though not easy at all.    Decay of the sound will also play a big part when testing against certain sounds, as well.  The MSGEQ7 has variable delay by just resetting and throwing away samples.  Play with that as well...  Keep the expected duration of your event in mind, and sample continuously, then go back by the appropriate amount of time and process your array then.  This let's you do nothing but sample for most cycles then do the hard work only when a threshold is hit. 

Have fun out there

qwertygin

brucethehoon,could you please elaborate
Quote
Offloading the spectrum analysis to the MSGEQ7 would help reduce CPU cycles spent sampling the audio and free them up for the actual fingerprint analysis.


how would MSGEQ7 help? isn't fft enough on its own?
If shit didn't happen..
..you would explode..

brucethehoon

FFT is great.  In this instance it might even be REQUIRED because the MSGEQ7 is only 7 bands, while you can go nuts with FFT.   

The biggest issue I found is that 8bit FFT is just not quite enough for some of the applications where I've ended up using the MSGEQ7.  You can throw a 12bit ADC on it and get genuinely great results.   Add in that the MSGEQ7 can sample at 160kHz+, and it's good for giving minute detail, though obviously, if you're going to use an external ADC, your bottleneck would be in the comms.

Anyhoo- regardless of which ends up being best, and why NOT try FFT first and see if it gives the desired result, this post is increasingly interesting to me.


Go Up