Pages: [1]   Go Down
Author Topic: Arduino Based Silence Detector  (Read 1251 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

I need some ideas on howto build an Arduino based Silence Detector for Audio Signals.

The Device should have 2 audio inputs and 1 audio output and if on Input 1 is no Signal detectet for more than X Seconds it should automatically switch Input 2 to the Output. The swichting part via audio relais is not the problem for me. The problem is getting the audio signal into Arudino and detecting that is too low (or completle gone).

Does anyone has any input on how to do that.

thank you very much

greetings
Stephan
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I guess i could use the Analog ADC pins (for example 0) for direct putting an Analog Audio Signal into the Arduino. But i would need some preamplification before that. how can i get this working????

thx
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31548
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But i would need some preamplification before that. how can i get this working????
It depends on how big your audio signal is, do you know?

You should connect it up to the arduino the same way as is shown on the front end of this link:-
http://interface.khm.de/index.php/labor/experimente/arduino-realtime-audio-processing/
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi and thank you for this hint.

the signal i get is standard line level (output of my laptop internally turned up to the max).

I put the 10uF with the 100k resistor to ground. But i Still get very low readings. Not the full 1024.

This makes it hard to detect real silence because even a longer fadeout or something with speech gives me a lot of low numbers.

I wrote an easy function for working against bad readings but because of the low readings my detector isn't working everytime.

Do i need the Poti and Second 100k Resistor to 5Volts to get better (higher) values from the input?


thanks again
greetings Stephan
« Last Edit: March 26, 2012, 04:55:54 pm by DrDude » Logged

Offline Offline
Edison Member
*
Karma: 23
Posts: 1171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We still don't have any idea what signal levels you've got.  If you don't know, where's it coming from?   A microphone might give you 10mV.   A full-volume line-level signal (like the audio output from a VCR or DVD player) should be around 1V.  A volume-controlled line-level signal or a volume-controlled headphone output mifht be somewhere around 100mV   A speaker-level signal will usually be several volts.

Quote
But i Still get very low readings. Not the full 1024.
If your reference is 5V, changing to the internal 1.1V reference will give you counts about 5 times as high.   (FYI - The maximum is 1023... The ADC puts-out 1024 different values, from 0 to 1023.



Quote
Do i need the Poti and Second 100k Resistor to 5Volts to get better (higher) values from the input?
A resistor can add offset to give you bigger readings.  but, it won't give you a bigger signal...    If your signal is 0.1V and you add a 1V offset, silence* is now 1V and your signal is 1.1V.   The numbers are bigger, but it's no easier to detect signal or silence.  It looks like the offset circuit is there to allow you to read the positive & negative half of the audio signal, without going negative and damaging the Arduino.   

*There's always some noise.   You may or may not read noise depending the level and the sensitivity of your ADC.
Logged

Offline Offline
Edison Member
*
Karma: 23
Posts: 1171
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK.   You should be getting around 1V peak.    If you change reference to 1.1V, you shoud be very near full scale if not over.    (Assuming everything's working properly.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Thanks for the good tipps. I set the internal reference to  " analogReference(INTERNAL);". Now i get greater readings but the only values really measurable are between -15db to 0db output level of my audiointerface (with white noise, Inteface is an Mbox). Below that there is not really a difference. Thats way to less detection accuracy. Especially when it comes to something spoken. Or big long Fade's in Music.
 
Plus: I get a lot of zero or very low values in between (or better said: rows of them, like: 75,64, 23, 9, 0, 0, 12, 23, 64, 75).

What am i doing wrong? Should i remove the cap+resistor to ground?

thanks

greetings
Stephan

PS: If someone has a completely different idea of doing this (with a external ADC Chip or whatever) just let me also know! i am open to every idea. i just want to solve the problem and learn something. thx.


and: maybe the offset circuit is needed because Audio Signals are always AC (hope i'm right there) signals (and they go from some - V to some + V) and the ADC expected only postiv signals. As he is getting postive and negative he may cut of the half of the real audio signal (which would explain the very low rows of readings in between). Is there some logic in this thought?
  
« Last Edit: March 27, 2012, 02:52:33 pm by DrDude » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 514
Posts: 31548
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you have wired up the audio like I indicated and you have dropped the internal referance voltage then you should be getting a reading is 1023 al the time. The fact that you have not suggests you have wired it up wrong.
Logged

Dallas, TX
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use the audio monitoring portion of the Macetech Shifty VU shield to do what you want.
http://macetech.com/store/index.php?main_page=product_info&cPath=4&products_id=11

I have used it for the purpose you describe.

I had asked them if a schematic was available for the audio portion of the shield and they referenced me here:
http://www.flickr.com/photos/macetech/3198278926/
Logged

Pages: [1]   Go Up
Jump to: