Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pyrato/parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def air_attenuation_coefficient(

return air_abs_coeff


def critical_distance(
volume,
reverberation_time):
Expand Down Expand Up @@ -252,8 +252,9 @@ def mean_free_path(

def reverberation_time_eyring(volume,surface,mean_alpha):
r"""
function which calculates reverberation time in rooms as
defined by Carl F. Eyring.
Calculate reverberation time using Eyring's equation.

The Eyring reverberation time is defined as [#]_

.. math::
T_{60} = -0.161 \frac{\text{volume}}{\text{surface} \cdot
Expand All @@ -276,8 +277,7 @@ def reverberation_time_eyring(volume,surface,mean_alpha):
References
----------
.. [#] Eyring, C.F., 1930. Reverberation time in “dead” rooms. The Journal
of the Acoustical Society of America, 1(2A_Supplement), pp.168-168.

of the Acoustical Society of America, 1(2A_Supplement), pp.168-168.
"""

if volume <= 0:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_parametric_eyring.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tests for Eyring's equation"""
"""Tests for Eyring's equation."""
import numpy.testing as npt
import pytest
from pyrato.parametric import reverberation_time_eyring
Expand All @@ -10,7 +10,7 @@ def test_analytic_Eyring():
reverb_test = reverberation_time_eyring(volume,surface,mean_alpha)
npt.assert_allclose(reverb_test, 0.481, rtol=1e-3)

@pytest.mark.parametrize("volume, surface", [(0, -2), (-1, 0)])
@pytest.mark.parametrize(("volume", "surface"), [(0, -2), (-1, 0)])
def test_input_geometry_Eyring(volume, surface):
mean_alpha = 0.2
with pytest.raises(ValueError, match="should be larger than 0"):
Expand All @@ -21,6 +21,6 @@ def test_input_alpha_Eyring(mean_alpha):
volume = 64
surface = 96
with pytest.raises(
ValueError, match="mean_alpha should be between 0 and 1"
ValueError, match="mean_alpha should be between 0 and 1",
):
reverberation_time_eyring(volume,surface,mean_alpha)