Skip to content

Commit c4086c5

Browse files
artur-pasimon.buechner22
authored andcommitted
Adjustment to EDC calculation with np.inf(), adjustment docstring
1 parent 2f28b8f commit c4086c5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pyrato/parameters.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,15 @@ def clarity(energy_decay_curve, early_time_limit=80):
125125
126126
where :math:`t_e` is the early time limit and :math:`p(t)` is the pressure
127127
of a room impulse response. Here, the clarity is efficiently computed
128-
from the EDC :math:`e(t)` directly by:
128+
from the EDC :math:`e(t)` directly via :func:`_energy_ratio` with
129+
``limits = [t_e, np.inf, 0, t_e]``:
129130
130131
.. math::
131132
132-
C_{t_e} = 10 \log_{10} \left( \frac{e(0)}{e(t_e)} - 1 \right).
133+
C_{t_e} = 10 \log_{10} \frac{e(0) - e(t_e)}{e(t_e) - e(\infty)}
134+
= 10 \log_{10} \left( \frac{e(0)}{e(t_e)} - 1 \right),
135+
136+
where :math:`e(\infty) = 0` by definition of the EDC.
133137
134138
Parameters
135139
----------
@@ -174,7 +178,7 @@ def clarity(energy_decay_curve, early_time_limit=80):
174178
early_time_limit_sec = early_time_limit / 1000
175179

176180
limits = np.array([early_time_limit_sec,
177-
energy_decay_curve.times[-1],
181+
np.inf,
178182
0.0,
179183
early_time_limit_sec])
180184

0 commit comments

Comments
 (0)