Skip to content

[FEATURE] add late lateral sound level L_J to pytta.iso3382 - #86

Open
aguirreSL wants to merge 2 commits into
PyTTaMaster:developmentfrom
aguirreSL:dev-iso3382_lj
Open

aguirreSL wants to merge 2 commits into
PyTTaMaster:developmentfrom
aguirreSL:dev-iso3382_lj

Conversation

@aguirreSL

Copy link
Copy Markdown

Builds on #66, so until #66 is merged this pull request also shows its commit.

Adds the late lateral sound level L_J of ISO 3382-1:2009, A.2.5, to pytta.iso3382, next to JLF, JLFC and IACC from #66:

  1. late_lateral_level(omni, eight, p10, distance=10., nthOct=1, minFreq=125., maxFreq=4000.): Equation (A.16), L_J = 10 lg(∫ from 80 ms to ∞ of p_L² dt / ∫ from 0 to ∞ of p_10² dt), with t = 0 at the start of the direct sound. The direct sound is found on the omnidirectional response, as lateral_fraction does, because the figure of eight has its null in that direction. With distance, the free field reference may be measured at another distance d, as A.4 allows, through L_pE,10 = L_pE,d + 20 lg(d/10).
  2. late_lateral_average(LJ): Equation (A.17), the energy mean over the four octaves from 125 Hz to 1000 Hz, as Table A.1 asks.

The definition and the limits of the integrals were checked against the text of ISO 3382-1:2009.

The tests in tests/test_iso3382_lj.py:

  1. A broadband response built from single reflections gives its analytic value, -2.840 dB (difference 2.8e-7 dB, the single precision of SignalObj).
  2. Adding 10 ms of silence before the direct sound leaves the result unchanged. Counting 80 ms from the first sample would wrongly include a reflection at 70 ms.
  3. A reference measured at 5 m with twice the amplitude gives the same L_J.
  4. In octave bands, a late part equal to half the reference gives -6.0206 dB in every band.
  5. The average of (-10, -10, -10, 0) dB is -4.881 dB, the energy mean. The arithmetic mean would give -7.5 dB.

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

aguirreSL and others added 2 commits October 31, 2026 20:39
pytta.iso3382.lateral_fraction gives the early lateral energy fractions
JLF and JLFC of ISO 3382-1:2009 (A.14, A.15) from the impulse responses
of an omnidirectional and a figure-of-eight microphone, and
pytta.iso3382.iacc the interaural cross correlation coefficient (B.1,
B.2) of a binaural response over any time window. Both work by octave or
fractional octave band, or broadband. The time origin is the start of
the response, the first sample within 20 dB of the maximum.

Tests use responses made of single reflections, so JLF, JLFC and IACC
are exact, and pin the 5 ms and 80 ms limits, the lags below 1 ms, the
early and late windows and the band output.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pytta.iso3382.late_lateral_level(omni, eight, p10) gives the late lateral
sound level LJ of ISO 3382-1:2009, A.2.5, Equation (A.16), by band: the
energy of the figure-of-eight response from 80 ms to the end over the
energy of the free-field response of the same source at 10 m. The time
origin is the direct sound found on the omnidirectional response, as in
lateral_fraction. A free-field response at another distance d can be used
with distance=d, which applies LpE,10 = LpE,d + 20 lg(d/10) of A.4.

pytta.iso3382.late_lateral_average(LJ) gives LJ,avg of Equation (A.17),
the energy mean over the octave bands from 125 Hz to 1000 Hz, which Table
A.1 asks for in place of the arithmetic mean used for the other measures.

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