Is there a way in Audacity to obtain the value of mean intensity (loudness) of a selection preferably in dB? My task is opposite to the majority of needs of other people - I need to prepare stimuli for my thesis in which I control the signal-to-noise ratio (SNR). I can generate pink noise of certain intensity but first I need to establish the overall intensity of a sentence - so how can I do that?
I know how to cheat.
Play the selections over a very good sound system in a dead quiet room. Measure the acoustic results with one of these:
There are a stunning number of people using that instrument to set up theater and other large sound systems.
Don’t automatically fall in love with the digital one. That one will not tell you rapidly moving values. That’s why the analog one is still being made. I own an analog one.
The “A” curve simulates acoustic loudness.
Then, tap dance your brains out as to why it was scientifically necessarily to do it that way. The experience will set you up for research in commercial industry later.
“OK, here is your lab and here is the list of results you’re going to find.”
Your question isn’t really well posed. Intensity and Loudness are not the same thing.
Loudness is a subjective measurement and depends on the frequency content and duration of the audio and the ears of the listener. You probably don’t want to use it in your thesis.
Intensity (aka Sound Intensity Level), is what you’re asking for, but it’s impossible to get Audacity (or any other piece software) to spit this number out since it relies on the acoustic properties of the room and the speaker system. It has to be measured as Koz has said, but if you use a good meter it isn’t cheating. Koz was wrong about on thing though, do not use any frequency weighting as Intensity does not take into account frequency content.
You will eventually have to take real-world measurements because it will be important to report the Intensity that the listener was subjected to in your final thesis. But it might be possible to do the bulk of the work before making any real-world measurements.
First, a note. Since you’re more interested in SNR, that can be set up entirely in the digital domain, using digital measurements without ever listening to the audio. You can use the RMS values of the audio data to determine what the SNR is of each sample before you do the final real-world measurement. Remember that SNR is dimensionless. Because of that, the SNR value of a signal won’t change when it’s taken from the digital → analog domain unless the frequency response of the speakers is poor. At this point you have two options to proceed:
If you’re worried about the speaker’s frequency response, then you will have to measure every speech file directly and every level of pink noise you intend to add to it (since frequency response will change with volume level of the output, make sure you take multiple measurements of the pink noise and then don’t touch the volume knob, use a digital control in to adjust the level of pink noise that you’re mixing in). Do all this measuring in the real-world listening environment that you’ll use to make the final test. That’s a lot of measuring, but you won’t have to fiddle around with any other pieces of software, Audacity will be able to do everything you need if you take this route.
If you want to avoid most of that measuring, you’ll need software other than Audacity. Audacity shows the RMS value of a signal as a lighter blue than the dark blue of the waveform, unfortunately it won’t spit out a number for you (which is why it’s not appropriate for this step). Sound Forge can, but it might not spit out an accurate enough number for your purpose (it can tell you the average rms value of a signal to .1dB accuracy), it’s also expensive. If there’s freeware out there that can be used to make detailed RMS measurements of audio, I’m not aware of it, but I wouldn’t be too surprised if it existed.
Once you know the RMS value of each digital signal, it’s simple to determine the SNR of each pair of sound files. Just divide the RMS decibel values. So you’ll want to prepare a whole mess of sound files ahead of time, each with a pre-determined SNR made by mixing the two signals together. If you do this, then the only measurement you have to take is during (or immediately before) the listening test.
Two final notes:
- If your subjects will be listening with headphones, you’ll have to make a dummy-head in order to take accurate measurements of what they’re hearing.
- Make sure you measure the base SNR value of the speech files before you add in pink noise. If the base SNR of the original file is higher than what you’ll get when adding the pink noise, then your test will be worthless. You can measure the base SNR by recording a bit of silence before recording the speech. Then compare the RMS value of the “silence” to the RMS value of the speech to find the base SNR.
<<<Koz was wrong about on thing though, do not use any frequency weighting as Intensity does not take into account frequency content.>>>
That would be the “C” switch on these instruments.
Thank you guys for your interesting remarks. For some strange reason, most of the studies I have read measure SNR not as dimensionless (which would be most logical since it is a “ratio”) but in dB as a difference (or distance) between signal and noise. Anyway, the most important message is that Audacity IS unfortunately NOT able to tell me overall intensity of a given sample:-( PRAAT, a free software for doing phonetics on computers, can do that and most curiously, it gives an absolute value (for example, 87.753 dB - not as it is quite common for computers to measure it in negative values beginning with 0). Another unfortunate thing is that Audacity allows me to set the intensity of pink noise NOT in dB but only as a portion of the maximum amplitude. This would be good if I could obtain average overall portion of the maximum amplitude of a sample. To make it as simple as possible: let´s say I generate a pure tone (signal) in one track of 0.8 maximum amplitude and noise in another track of 0.5 maximum amplitude. What will be the resulting SNR? Is it just signal / noise? (0.8 / 0.6 = 1.6) Thanks in advance
For some strange reason, most of the studies I have read measure SNR not as dimensionless (which would be most logical since it is a “ratio”) but in dB as a difference (or distance) between signal and noise.
Decibels by themselves are also dimensionless. They’re also a ratio. You have to append a separate designation to the ‘dB’ in order to get an absolute measurement. This article explains it pretty well:
You are probably looking for dB-SPL. This is what most people mean when they say “dB” without any designation, even though it’s technically incorrect. However, that’s the value you want to use to describe how loud the listening environment was when you took the test. In order to report the SNR of each signal the subjects listened to, you want SNR(dB). The ‘dB’ here is a generic ratio, not an absolute like dB-SPL. So SNR(dB) is dimensionless.
Basically your paper will want to say something like “the listener was subjected to a noise level of 80dB-SPL for each test.” And then further on you’ll need to list the SNR(dB) of each test signal and whether or not the listener was able to hear it correctly. Unless you’re testing at different volume levels in addition to different SNR levels, ‘dB-SPL’ only needs to show up once in the paper.
If that’s confusing, think of it this way. I have a signal that I know has an SNR of 6dB (in other words, a very noisy signal). As I’m listening to this file, I slowly turn the volume up. In this example, only the dB-SPL level has changed as I turned the volume knob. The SNR(dB) has not changed at all, even when the signal was so quiet that I couldn’t hear it.
Anyway, the most important message is that Audacity IS unfortunately NOT able to tell me overall intensity of a given sample:-( PRAAT, a free software for doing phonetics on computers, can do that and most curiously, it gives an absolute value (for example, 87.753 dB - not as it is quite common for computers to measure it in negative values beginning with 0).
You’re correct about Audacity not being able to do what you want, but I’d also be wary of the value you’re getting from PRAAT. What kind of decibel value is it giving you? It certainly isn’t dB-SPL. Without a reference, a dB measurement is meaningless.
Another unfortunate thing is that Audacity allows me to set the intensity of pink noise NOT in dB but only as a portion of the maximum amplitude. This would be good if I could obtain average overall portion of the maximum amplitude of a sample.
You’re right, Audacity won’t let you specify the RMS value of a signal when you try to amplify (or de-amplify) it. Sadly
To make it as simple as possible: let´s say I generate a pure tone (signal) in one track of 0.8 maximum amplitude and noise in another track of 0.5 maximum amplitude. What will be the resulting SNR? Is it just signal / noise? (0.8 / 0.6 = 1.6) Thanks in advance
There are two easy ways for you to measure SNR. First, this is easy to do if you know only the RMS level of each signal. This is yet another example of where you need software that can do better measurements than Audacity (unless you choose to do all the measuring in the real world). Let’s look at the second equation that shows up on this page:
SNR(dB) = 20 * log (A_signal(RMS) / A_noise(RMS))
It is very important to note that this equation expects the RMS amplitude, not the absolute amplitude of the signals. The only way to calculate the RMS value is to average all of the samples in the signal, Audacity can’t do this. Something like Matlab can do it easily (but it’s, of course, expensive). If that PRAAT software can to, then that’s great.
If we were to assume that you had given me the RMS values of two signals (please keep in mind that you didn’t, I’m just using them as an example), the equation is:
SNR(dB) = 20 * log(.8/.5) = +32dB.
Second, if you know the dB rating of each signal, the equation simplifies to this:
SNR(dB) = noise(dB) - signal(dB)
So if you have a signal that’s at -6dB and the noise is at -36dB (you can use any two identical flavors of ‘decibel’ to make this calculation), then SNR will be +30dB.
So once you have software that can give you an accurate RMS measurement (or you do the measurements directly in the real-world), the actual calculations are very easy. But keeping the language straight will take some careful proof-reading. If you need help with the proof-reading, let me know (by sending me a personal message through this board) and I’ll read through your paper as long as it isn’t a billion pages.