×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Acoustics related matlab question......

Acoustics related matlab question......

Acoustics related matlab question......

(OP)
Please bear in mind that I am a complete newbie to Matlab...

I need to find the Leq (equivalent continous noise level) of a .wav file using Matlab.  I was wondering if anyone knows if this is a simple function within one of the toolboxes or even if there is actually a way to implement this...

Any help would be much appreciated!!

Thanks

RE: Acoustics related matlab question......

You have two distinct problems

1. Getting the .wav file into the Matlab work space.

2. Calculating the Leq.

The way to approach problem 1 is to study the Matlab documentation on .wav files. The online help is fully searchable so it shouldn't be too much of a problem.

For problem 2, the definition of Leq

http://www.diracdelta.co.uk/science/source/e/q/equivalent%20continuous%20sound%20level/source.html

includes an integration stage. You can again search the Matlab documentation for this but for your application you can simply use the 'sum' function.

The Leq calculation can be done in a single line of code. Something like:

Leq = 10*log10( sum(p.^2)/T/pref.^2 )

where p is measured pressure waveform from the .wav file, pref is the reference acoustic pressure and T is the averaging period.

M

--
Dr Michael F Platten

RE: Acoustics related matlab question......

... And then there is the problem of calibration.

If your .wav file does not have a cal tone in it anywhere (fairly likely), you'll have no idea of the recording level.  .wav files when loaded into Matlab have a range of -1 to 1 - what to multiply it by to get Pa?

RE: Acoustics related matlab question......

(OP)
Thanks for the replys guys, it all seems good apart from obtaining p, the measured pressure.  How can I get that from the .wav file?  Is this just an average pressure for the entire duration of the file?

I guess using the 'wavread' function is going to be the best way get it into matlab, this seems to put it into a 2 column matrix.  Not too sure if this is what i need, i need to mess about with it some more.

With respect to calibration, that doesnt matter because I just want to scale a number of different .wavs so that they all have an leq value of 55dB.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources