Weighted Sound and LEQ

Using Nyquist scripts in Audacity.
Post and download new plug-ins.

If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like

Weighted Sound and LEQ

Permanent link to this post Posted by waverlye » Fri Oct 06, 2017 10:14 pm

In the Nyquist plugins to perform A-Weighted measurements I've seen this code.

; A-weighted version of sound - by Edgar (thanks!)
(setq sa (lp (lp (hp (hp (hp (hp s-in 20.6) 20.6) 107.7) 737.9) 12200) 12200))

1) Is this the order in which the data will pass, which makes sense but I just want to be sure.
2) 20.6 and 1200 are used twice in a row. Should I take this to mean this is the equivalent of a 2nd order filter and all other reference are 1st order?
3) What would be the simplest, not the most elegant way to calculate LEQ?

hp 20.6
hp 20.6
hp 107.7
hp 737.9
lp 1200
lp 1200

Thank you,


W.
waverlye
 
Posts: 12
Joined: Fri Jul 31, 2015 7:33 pm
Operating System: Please select

Re: Weighted Sound and LEQ

Permanent link to this post Posted by steve » Sat Oct 07, 2017 11:19 am

waverlye wrote:1) Is this the order in which the data will pass

Edgar's code nests multiple filters inside each other:
Code: Select all
(lp (lp (hp (hp (hp (hp s-in 20.6) 20.6) 107.7) 737.9) 12200) 12200)

Code: Select all
(lp
  (lp
    (hp
      (hp
        (hp (hp s-in 20.6)
            20.6)
        107.7)
      737.9)
    12200)
  12200)

which means that the two low pass and 4 high pass stages are cascaded - the order is unimportant.

waverlye wrote: 20.6 and 1200 are used twice in a row. Should I take this to mean this is the equivalent of a 2nd order filter and all other reference are 1st order?

Yes.
The second order filters could be written as (lowpass2 sound frequency), but due to implementation details, the first order filters cascade better than using the 2nd order versions.

waverlye wrote:3) What would be the simplest, not the most elegant way to calculate LEQ?

Not at all simple with Audacity because LEQ is about sound pressure levels, and Audacity only knows about signal level. For sound pressure measurements you need a calibrated system, which means that you need a sound level meter of some kind - in which case, the simplest method is to use a sound level meter that supports LEQ measurement.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45392
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Weighted Sound and LEQ

Permanent link to this post Posted by waverlye » Mon Oct 09, 2017 6:06 pm

>>which means that the two low pass and 4 high pass stages are cascaded - the order is unimportant.
Hmm. I would have thought the order was important because if I started with passing 737.9, would I implicitly attenuate lower frequencies?

>>The second order filters could be written as (lowpass2 sound frequency), but due to implementation details...
Wonderful, I was hoping I understood that correctly.

>>Not at all simple with Audacity because LEQ is about sound pressure levels, ...
Ah, I've run into that issue again. The sound pressure level seems to be at the bottom of a number of my issues.

Thank you for indulging me on this issue.
It was very much appreciated.


W.
waverlye
 
Posts: 12
Joined: Fri Jul 31, 2015 7:33 pm
Operating System: Please select

Re: Weighted Sound and LEQ

Permanent link to this post Posted by steve » Mon Oct 09, 2017 6:41 pm

waverlye wrote:>>which means that the two low pass and 4 high pass stages are cascaded - the order is unimportant.
Hmm. I would have thought the order was important because if I started with passing 737.9, would I implicitly attenuate lower frequencies?

Perhaps I can explain that more clearly...

We are using two types of filter, 1st order low pass and 1st order high pass. The function names are "lp" and "hp" respectively.
Each filter takes two arguments (two parameters), the first is the sound that the filter is applied to, and the second is the corner frequency of the filter.
So the two functions are:
(lp <sound> <frequency>)
and
(hp <sound> <frequency>)

So yes the <frequency> parameters need to match up with either a "hp" command or an "lp" command, but the order in which we cascade does not matter.
Code: Select all
(hp
  (lp <sound> <x_Hz>)
  <y_Hz>)

is identical to:
Code: Select all
(lp
  (hp <sound> <y_Hz>)
   <x_Hz>)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
steve
Site Admin
 
Posts: 45392
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Weighted Sound and LEQ

Permanent link to this post Posted by waverlye » Thu Oct 12, 2017 1:19 pm

Understood.

Thank you,


W.
waverlye
 
Posts: 12
Joined: Fri Jul 31, 2015 7:33 pm
Operating System: Please select


Return to Nyquist



Who is online

Users browsing this forum: No registered users and 2 guests