07-02-2021 12:55 PM
I am trying to use a usb microphone (Blue Yeti) to record the audio volume while this program is running. I have figured out that LabView will recognize the device if I restart my computer with it plugged in. But I can't figure out what it is measuring it in (volts?) and what to make of the values (their magnitude and their signs- can't speak at a negative volume). Can anyone tell me how to interpret this data and how to get it into decibels? Thanks!
07-02-2021 01:56 PM
It sounds (sorry for the pun) as if you need to understand two things prior to answering your question.
07-02-2021 03:14 PM
1. Your block diagram is messy. When asking for help, it's not polite to present a mess.
2. A decibel is a tenth of a bel.
3. To get bels, take the common logarithm of power.
4. Your mic is probably outputting voltage that is proportional to sound pressure.
5. Power will be proportional to the square of the voltage.
6. You want to use RMS, not Mean on your waveform.
07-03-2021 10:31 AM
In addition decibel doesn’t really have a unit in itself since it is simply the logarithm of a measurement to a specific reference. What type of reference that is is usually indicated by an additional letter appended to dB such as dBa or dBV. It’s in itself a unit less logarithm of a measurement in a certain unit divided by a reference of the same unit.
07-06-2021 01:20 PM - edited 07-06-2021 01:21 PM
Hi everyone,
Sorry for the delayed response, I have been trying to analyze all of your suggestions and comments (thank you all for your help).
First, I would like to mention that I am nearly brand new to LabView, coding in general, and audio so please excuse any dumb errors, messiness, etc. I am trying my best.
Second, I have adjusted my original code to basically try to incorporate my new understanding of recording audio and working with Pa/V/dB. The below steps are based on the common equation I have seen: dB (or Lp) =20*log(p/p0)
So that's where I am now. It seems at least like my mic is responding appropriately (the reading is increasing when I talk/make noise into it) but I'm getting numbers in the 100s, which isn't right for decibels (at least I don't think- every website says 60 dB for normal conversational voice but they don't tell me what value was used to scale). Is this reasonable? Am I missing something, conceptually or mathematically? Is my code okay for this portion?
I know this is becoming more and more of an audio question than a coding question, but I will post it here anyways in case I get lucky and there happens to be an audio expert present.
Thank you in advance!
07-06-2021 01:49 PM - edited 07-06-2021 01:51 PM
What they don't tell you is how far away from you that person is talking. If they are right across the table from your mic, sure, 60 dB is reasonable. But if they are talking right into the mic, it will be much louder. Imagine someone talking in a normal voice right in your ear. Now maybe we are getting into the 100 dB range.
By "hundreds", do you mean literally, like 200 or more, or do you just mean greater than 100?
07-06-2021 02:01 PM - edited 07-06-2021 02:07 PM
Bill,
Ahhh, I didn't consider that, thank you.
Sorry, I should have been clearer. I mean in the mid 100s. With minimal audio (some typing and sniffles- typical office noises but no talking) it reads at about 110. With snapping, tapping, and talking right next to the mic, the values increase to 120-130. The fact that the background noise reading is so high is what is really confusing me.
Attached is a screenshot of the data I'm reading, plus a graph, for reference.
I also forgot to attach the updated VI, will attach here.
Thanks!
07-06-2021 02:32 PM
@mnchem wrote:
Bill,
Ahhh, I didn't consider that, thank you.
Sorry, I should have been clearer. I mean in the mid 100s. With minimal audio (some typing and sniffles- typical office noises but no talking) it reads at about 110. With snapping, tapping, and talking right next to the mic, the values increase to 120-130. The fact that the background noise reading is so high is what is really confusing me.
Attached is a screenshot of the data I'm reading, plus a graph, for reference.
I also forgot to attach the updated VI, will attach here.
Thanks!
Is this going through a sound card?
07-06-2021 02:55 PM
I'm not and expert here, but it looks like sometimes the formula multiplies by 10 and other times it multiplies by 20. The difference appears to be whether the values you're taking the log of are squared or not.
If you were to divide your results by 2, you'd be getting much more reasonable values (i.e. conversational levels instead of jet engine levels).
I know a lot of Analog to Digital conversions aren't actually straight linear conversions. Is there a chance maybe you have squared values and didn't know it?
07-06-2021 03:43 PM
Not sure if it is going through a sound card, how would I check that? It is a USB connected microphone, so I don't think so...
And I am not sure if the values are being squared already or not. I wouldn't think so, I think the mic is taking in straight volts (which I converted to pascals). Halving the values would make them more reasonable, but I would still be measuring background noise (hardly anything at all) at 60 dB, which is not reasonable, so I am not sure if that's the problem...
Here is a graph of a test I just ran. The mic was sitting on top of a noisy instrument, recording me talking/making other noises into the instrument. The good thing is I can at least see it picking up audio appropriately, but again the actual numbers are just off (I think).