david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

can I get signal in DB from microphone using usb sound card?

Mon Feb 10, 2020 1:49 pm

Hello ,
I'm using a USB sound card that have 2 connections : input\output
I have connected a microphone to the input , and I want to know what is the noise level while I open the mic.
is there any way to do this?

I only found this https://github.com/mepster/wensn

but how do I do the same think to a generic microphone on a usb sound card?

Thanks ,

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: can I get signal in DB from microphone using usb sound card?

Mon Feb 10, 2020 1:57 pm

david_1234 wrote:
Mon Feb 10, 2020 1:49 pm
Hello ,
I'm using a USB sound card that have 2 connections : input\output
I have connected a microphone to the input , and I want to know what is the noise level while I open the mic.
is there any way to do this?

I only found this https://github.com/mepster/wensn

but how do I do the same think to a generic microphone on a usb sound card?

Thanks ,
Do you need absolute values or will relative ones be sufficient?

And do you want flat or weighted values?

david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

Re: can I get signal in DB from microphone using usb sound card?

Mon Feb 10, 2020 2:06 pm

It could be relative

and what do you need by this:
And do you want flat or weighted values?
I want the resault the be simller to the android app "Sound Meter" - so the code can be "trusted"
if I will ger 54.6 in the PI and 55 in the app - it's ok

Thanks ,

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: can I get signal in DB from microphone using usb sound card?

Mon Feb 10, 2020 4:16 pm

david_1234 wrote:
Mon Feb 10, 2020 2:06 pm
It could be relative

and what do you need by this:
And do you want flat or weighted values?
I want the resault the be simller to the android app "Sound Meter" - so the code can be "trusted"
if I will ger 54.6 in the PI and 55 in the app - it's ok

Thanks ,
You would not even get results that close by installing the same app on two identical Android phones.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8739
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: can I get signal in DB from microphone using usb sound card?

Tue Feb 11, 2020 10:57 am

Decibels are always relative. Whether the thing they are relative to is defined/calibrated is a different question.

A complete product, such as that sound level meter, will be calibrated against the normal 0dB as 20 micropascals (in air). A random microphone and sound card have an arbitrary (potentially adjustable) gain structure, therefore additional calibration would be required for it to be accurate.

And, as drgeoff has commented, the human ear is not linear in frequency response. Sound level meters therefore generally offer an A-weighted response which roughly matches the human ear, or a C-weighted response which has a flat frequency response - https://en.wikipedia.org/wiki/Frequency_weighting.
Either way you are highly dependent on the frequency response of your random microphone as well, which is why you get reference microphones for doing frequency response analysis (eg https://dbxpro.com/en/products/rta-m or https://www.behringer.com/Categories/Be ... 00/p/P0118)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

Re: can I get signal in DB from microphone using usb sound card?

Sun Feb 16, 2020 10:05 am

I think you over think what I want to do ....

I just want to read the signal from the MIC and know how much DB is it

can I do this? or it's to complicated?

Thanks,

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8739
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: can I get signal in DB from microphone using usb sound card?

Sun Feb 16, 2020 3:48 pm

david_1234 wrote:
Sun Feb 16, 2020 10:05 am
I think you over think what I want to do ....

I just want to read the signal from the MIC and know how much DB is it

can I do this? or it's to complicated?
It can be done, but it's not trivial and will require calibration.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
scruss
Posts: 3155
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: can I get signal in DB from microphone using usb sound card?

Sun Feb 16, 2020 8:11 pm

What will you be using it for? There might be ways around having to go into really complex and expensive calibration.

There's one frequent contributor here who does things with sound level meters and might be able to provide guidance. Quality microphones have come down a lot in price since I used to lug expensive lab-grade meters around the UK's hillsides in the 1990s. But most phone mics are optimized for voice range with very heavy signal processing, so using them as references for noise complaints (for example) isn't going to be terribly effective.
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.
Pronouns: he/him

david_1234
Posts: 328
Joined: Mon Jan 01, 2018 2:14 pm

Re: can I get signal in DB from microphone using usb sound card?

Thu Feb 20, 2020 2:28 pm

I need to test the DB when people are talking
they will talk direct to the mic ,
want to see the changes from man\woman\child\dog etc...

I really think it should b e simple to do

I guess the problem is "reading" the analog voice from the USB microphone

If this is to hard to apply , I will search something else that require me to build a circuit that will send the analog to the PI

Thanks ,

drgeoff
Posts: 10676
Joined: Wed Jan 25, 2012 6:39 pm

Re: can I get signal in DB from microphone using usb sound card?

Thu Feb 20, 2020 2:44 pm

You will get better results and a lot less hassle for much less money by buying a cheap sound level meter. For example https://www.banggood.com/UNI-T-UT353-Mi ... rehouse=CN

Return to “Beginners”