Skip to content

[FEATURE] add the sound power level by the direct and comparison methods to pytta.iso3741 - #85

Open
aguirreSL wants to merge 1 commit into
PyTTaMaster:developmentfrom
aguirreSL:dev-iso3741
Open

aguirreSL wants to merge 1 commit into
PyTTaMaster:developmentfrom
aguirreSL:dev-iso3741

Conversation

@aguirreSL

Copy link
Copy Markdown

Adds the sound power level of ISO 3741:1999 to pytta.iso3741, which until now has only Lp_ST:

  1. sound_power(Lp, T, V, S, f, temperature, pressure): the direct method of 8.4.1, Equations (11) and (12). The equivalent absorption area comes from T by Sabine, A = 55.26 V / (c T), with c = 20.05 sqrt(273 + θ). The level then gets the air absorption term 4.34 A/S, the Waterhouse correction 10 lg(1 + S c / (8 V f)), the term -25 lg[427/400 sqrt(273/(273 + θ)) B/B0] that refers the result to ρc = 400 N s/m³, and -6 dB.
  2. sound_power_comparison(Lp, Lp_ref, LW_ref): the comparison method with a reference sound source, Equation (13).

The equations were checked against the text of ISO 3741:1999 and its corrigendum of 2001. In the copy used, the square root of the impedance term is lost in Equation (11). It was restored, since only with it does the term give the ρc of air, about 412 N s/m³ at 20 °C. The 2010 edition replaces that term with C1 and C2. It was not available, so it is not implemented.

The tests in tests/test_iso3741.py:

  1. A room of 200 m³ worked by hand term by term, at 100 Hz and 1 kHz, agrees within 1.8e-5 dB, which is the rounding of the hand values.
  2. Halving the atmospheric pressure raises the level by 25 lg 2 = 7.526 dB.
  3. The comparison method gives the level of the direct method when the reference source is rated in the same room (difference 1e-14 dB).

The existing Lp_ST was left as it is. When called, it raises a NameError on the undefined firstChNum. It also averages the levels arithmetically, while Equations (9) and (10) average the energy, and it has no correction for background noise. That calls for a separate fix.

Checked with Python 3.12, numpy 1.26 and scipy 1.17. The 7 failures of development (3 in test_h5io.py, 4 in test_pyttasave.py) are the same with and without this change.

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

…ods to pytta.iso3741

pytta.iso3741.sound_power(Lp, T, V, S, f, temperature, pressure) gives the
sound power level by band from the average sound pressure level in the
reverberation room, by the direct method of ISO 3741:1999, 8.4.1,
Equations (11) and (12): the equivalent absorption area from T by Sabine,
the air absorption term 4.34 A/S, the Waterhouse correction and the term
that normalizes the result to rho c = 400 N s/m3 from the temperature and
the atmospheric pressure.

pytta.iso3741.sound_power_comparison(Lp, Lp_ref, LW_ref) gives the level by
the comparison method with a reference sound source, Equation (13).

The equations were checked against the text of ISO 3741:1999 and its
corrigendum of 2001. The 2010 edition, which replaces the impedance term
with C1 and C2, was not available, so it is not implemented.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant