Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

javax.sound and calculating SNR

Thread view: 
michas - 03 Jun 2007 22:26 GMT
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?
Karl Uppiano - 03 Jun 2007 23:02 GMT
> hello,
> I have a problem, I need to calculate SNR (Signal-to-Noise Ratio) in
[quoted text clipped - 3 lines]
> (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.
Knute Johnson - 04 Jun 2007 01:24 GMT
>> hello,
>> I have a problem, I need to calculate SNR (Signal-to-Noise Ratio) in
[quoted text clipped - 44 lines]
>
> Hope this helps.

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

Signature

Knute Johnson
email s/nospam/knute/

Lew - 04 Jun 2007 02:11 GMT
Karl Uppiano wrote:
>> For sinusoidal signals, RMS is calculated:
>>
>>     Vrms = Vpeak * sqrt(2)

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

Correct, also calculable as

Vrms = Vpeak * sqrt(2.0) / 2.0

Signature

Lew

Karl Uppiano - 04 Jun 2007 04:38 GMT
> Karl Uppiano wrote:
>>> For sinusoidal signals, RMS is calculated:
[quoted text clipped - 6 lines]
>
> Vrms = Vpeak * sqrt(2.0) / 2.0

Yeah sorry, I left off the / 2.0.
Karl Uppiano - 04 Jun 2007 04:36 GMT
>>> hello,
>>> I have a problem, I need to calculate SNR (Signal-to-Noise Ratio) in
[quoted text clipped - 46 lines]
>
> It has been a really long time but isn't RMS = PEAK / sqrt(2)?

Yup. Sorry about that.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.