Weighted Sound and LEQ

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.

Edgar’s code nests multiple filters inside each other:

(lp (lp (hp (hp (hp (hp s-in 20.6) 20.6) 107.7) 737.9) 12200) 12200)



(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.

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.

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.

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.

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 )
and
(hp )

So yes the parameters need to match up with either a “hp” command or an “lp” command, but the order in which we cascade does not matter.

(hp
  (lp <sound> <x_Hz>)
  <y_Hz>)

is identical to:

(lp 
  (hp <sound> <y_Hz>)
   <x_Hz>)

Understood.

Thank you,


W.