javax.sound and calculating SNR

M

michas

hello,
I have a problem, I need to calculate SNR (Signal-to-Noise Ratio) in
my program. I made 2 programs already, that is: client app, which
records voice and sends it through internet, and server app, which
receives voice from client and plays it. now, I need to calculate SNR
(Signal-to-Noise Ratio), and i can't find any examples of it... I use
javax.sound.sampled in it. any advices?
 
K

Karl Uppiano

michas said:
hello,
I have a problem, I need to calculate SNR (Signal-to-Noise Ratio) in
my program. I made 2 programs already, that is: client app, which
records voice and sends it through internet, and server app, which
receives voice from client and plays it. now, I need to calculate SNR
(Signal-to-Noise Ratio), and i can't find any examples of it... I use
javax.sound.sampled in it. any advices?

I am not aware of any handy audio Java libraries that do this.
Signal-to-noise is the difference (usually expressed in decibels) between
the RMS voltage representing the "standard program level" and the RMS
voltage of the residual noise of the idle channel. This measurement is
fraught with pitfalls, however.

1. Determining the standard program level is not easy, although it is often
chosen to be 15 or 20 dB below full scale. Actual program audio, such as
voice, varies constantly, and peaks may reach full scale, while the average
level hovers around the standard program level. VU meters
(http://en.wikipedia.org/wiki/VU_Meter) having very specific averaging
characteristics were designed to help determine this, but you will note that
they are always bouncing around with real program material.

2. Determining the residual noise on an idle channel is also challenging.
First of all, some digital systems mute idle channels, which result in
"infinite" SNR, which is misleading. If un-muted, you might discover that
you are picking up room noise from an open microphone. That isn't really the
SNR of the system either. For measuring the system SNR, you typically would
need to replace the microphone with a dummy load, and then compare the
remaining noise to the standard program level.

The formula for calculating dB is:

dB = 20*log(v2/v1)

Where log is the common log (base 10), v2 is the standard program level, and
v1 is the noise level.

For sinusoidal signals, RMS is calculated:

Vrms = Vpeak * sqrt(2)

This will be a constant for the standard program level. The noise level will
require RMS weighting, which is an averaging function over some period of
time. I do not have the specifics on hand at the moment, but simply
averaging the absolute value of noise samples over a few milliseconds would
be ok to a first approximation.

Hope this helps.
 
K

Knute Johnson

Karl said:
I am not aware of any handy audio Java libraries that do this.
Signal-to-noise is the difference (usually expressed in decibels) between
the RMS voltage representing the "standard program level" and the RMS
voltage of the residual noise of the idle channel. This measurement is
fraught with pitfalls, however.

1. Determining the standard program level is not easy, although it is often
chosen to be 15 or 20 dB below full scale. Actual program audio, such as
voice, varies constantly, and peaks may reach full scale, while the average
level hovers around the standard program level. VU meters
(http://en.wikipedia.org/wiki/VU_Meter) having very specific averaging
characteristics were designed to help determine this, but you will note that
they are always bouncing around with real program material.

2. Determining the residual noise on an idle channel is also challenging.
First of all, some digital systems mute idle channels, which result in
"infinite" SNR, which is misleading. If un-muted, you might discover that
you are picking up room noise from an open microphone. That isn't really the
SNR of the system either. For measuring the system SNR, you typically would
need to replace the microphone with a dummy load, and then compare the
remaining noise to the standard program level.

The formula for calculating dB is:

dB = 20*log(v2/v1)

Where log is the common log (base 10), v2 is the standard program level, and
v1 is the noise level.

For sinusoidal signals, RMS is calculated:

Vrms = Vpeak * sqrt(2)

This will be a constant for the standard program level. The noise level will
require RMS weighting, which is an averaging function over some period of
time. I do not have the specifics on hand at the moment, but simply
averaging the absolute value of noise samples over a few milliseconds would
be ok to a first approximation.

Hope this helps.

It has been a really long time but isn't RMS = PEAK / sqrt(2)?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top