Results 1 to 11 of 11
Like Tree2Likes
  • 2 Post By JosAH

Thread: Decibel Loudness

  1. #1
    DPdieciocho is offline Member
    Join Date
    Jun 2013
    Location
    Philippines
    Posts
    15
    Rep Power
    0

    Question 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. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Decibel Loudness

    Would you like fries with that?
    Post your code and ask specific questions, nobody will do your homework for you.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    DPdieciocho is offline Member
    Join Date
    Jun 2013
    Location
    Philippines
    Posts
    15
    Rep Power
    0

    Default 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. #4
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default Re: Decibel Loudness

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

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    DPdieciocho is offline Member
    Join Date
    Jun 2013
    Location
    Philippines
    Posts
    15
    Rep Power
    0

    Default Re: Decibel Loudness

    what do you mean?

  6. #6
    gimbal2 is online now Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,089
    Rep Power
    4

    Default 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. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default Re: Decibel Loudness

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

    Jos
    jim829 and MR bruto like this.
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    DPdieciocho is offline Member
    Join Date
    Jun 2013
    Location
    Philippines
    Posts
    15
    Rep Power
    0

    Default 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. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default 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
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    DPdieciocho is offline Member
    Join Date
    Jun 2013
    Location
    Philippines
    Posts
    15
    Rep Power
    0

    Default 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. #11
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,015
    Blog Entries
    7
    Rep Power
    20

    Default 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
    cenosillicaphobia: the fear for an empty beer glass

Posting Permissions

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