NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
lituslitus
Posts: 16
0 Kudos
Accepted Solution

Sound Detection

Does anyone know if there is a VI to do this

I would like to leave a microphone connected to the computer and if there is a noise in the room make a boolean true.

any help is appreciated

Active Participant
nolsqn
Posts: 246
0 Kudos

Re: Sound Detection

see the attached VI

 

the concept is that first use the convert from dynamic data type to a 1d array of samples points to get the min max values when the mic is silent. now use this values as reference , if there is noise it will be out of these values . and a simple comparision to make the boolean true

 

 

with regards 

Regards
Member
lituslitus
Posts: 16
0 Kudos

Re: Sound Detection

Thanks for the quick response and the example VI

 

when silence, i get values -0.00408936 or -0.0041198

 

and i get -0.003967 or -0.003936 when the noise event happend

 

do you think the mic is working OK

 

thanks

Trusted Enthusiast
DFGray
Posts: 2,563

Re: Sound Detection

That example is only pulling a single value out of essentially a periodic array.  That will give very inconsistent results.  Attached is a VI that may work better for you.  Run it with no sound and a threshold of a couple hundred to get the normal background of your room.  Multiply your background by about 10% or 20% to add a little padding, then set this for the threshold.  Run and it should work.  Since you are looking for an impulse, the analysis is a simple peak-to-peak measurement.  If your background noise lasts very long, you may want to replace this with an RMS measurement to give you more noise immunity.

Using LabVIEW 2009 - 2012 on Windows 7 64-bit
Member
lituslitus
Posts: 16
0 Kudos

Re: Sound Detection

thanks for the response.

I did not have time to try your VI, i will test it tomorrow.

What i am trying to do is to trigger a photo flash when a noise is captured by the mic. i hope your vi works

thank you

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page