1. Member
Join Date
Jun 2013
Location
Philippines
Posts
15
Rep Power
0

## Decibel Loudness

The loudness of a sound is measured in units of decibels and is calculated as shown: 10LOG (SL/RL)

SL is the intensity of the sound being measured.
RL is a reference sound intensity level.

Using this formula, calculate and display the decibel loudness of a busy street having a sound intensity of 10,000,000 RL.

2. ## Re: Decibel Loudness

Would you like fries with that?

3. Member
Join Date
Jun 2013
Location
Philippines
Posts
15
Rep Power
0

## Re: Decibel Loudness

Haha. what shall I do? Am I going to enter a value for SL or not?
This is what I already started.

import java.util.*;
import java.math.*;

public class Assignment3 {

public static void main(String[] args){

double decibelLoudness, log=10, sL, rL=10000000;
Scanner input = new Scanner(System.in);
System.out.println("Intensity Sound: ");
sL = input.nextDouble();
decibelLoudness = (Math.log(log) * (sL / rL));
System.out.println("Decibel Loudness " +decibelLoudness);
}
}

I'm not sure about the output eh.

4. ## Re: Decibel Loudness

Check out the Math class; it has a log10( ... ) method.

kind regards,

Jos

5. Member
Join Date
Jun 2013
Location
Philippines
Posts
15
Rep Power
0

## Re: Decibel Loudness

what do you mean?

6. Just a guy
Join Date
Jun 2013
Location
Netherlands
Posts
5,114
Rep Power
13

## Re: Decibel Loudness

What do you mean, "what do you mean"? Check out the log10 method of the Math class.

Math (Java Platform SE 7 )

7. ## Re: Decibel Loudness

Originally Posted by DPdieciocho
what do you mean?
Erm, my hoovercraft is full of eels ...

Jos

8. Member
Join Date
Jun 2013
Location
Philippines
Posts
15
Rep Power
0

## Re: Decibel Loudness

may I know what will be its formula if RL = 10,000,000?
The decibel sound should be 70 if RL = 10,000,000.

9. ## Re: Decibel Loudness

Your representation of a dB formula is inaccurate; it should be dB= 10*log(sl/rl) where log( ... ) is the base 10 logarithm; if sl == 10000000*rl the outcome of the formula is indeed equal to 70. See this link: https://en.wikipedia.org/wiki/Decibel

kind regards,

Jos
Last edited by JosAH; 07-03-2013 at 02:15 PM. Reason: forgot to post the link

10. Member
Join Date
Jun 2013
Location
Philippines
Posts
15
Rep Power
0

## Re: Decibel Loudness

What's wrong with this?

import java.math.*;

public class Assignment3 {

public static void main(String[] args){

double decibelLoudness;
decibelLoudness = (10 * Math.log(10000000));
System.out.println("Decibel Loudness " +decibelLoudness);

}
}

The output should be 70, but why is it 161.18095650.....
Is there something wrong with formula or else something like that?

11. ## Re: Decibel Loudness

You should use the log10( ... ) method; also see one of my other replies and read the API documentation for the Math class. The log( ... ) method uses e as the base for its logarithm, not 10.

kind regards,

Jos

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•