Skip to content
33 changes: 33 additions & 0 deletions pyrato/parametric.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,39 @@
"""
import numpy as np

def schroeder_frequency(V, T):
r"""
function which calculates the Schroeder frequency. The cut-off

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, change the sentence to: Calculate the Schroeder cut-off frequency of a room

frequency for modes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the source - the citation is broken

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice hint, but we don´t know how ... seems as broken as for energy_decay_curve_analytic function below.

Approved by Monty Python Flying Circus.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We appreciate Your sense of humour, although this should be a serious scientific documentation.


.. math::

f_s = 2000 * \sqrt(\frac{T}{V})

Parameters
----------
V : float, np.ndarray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the variable naming convention adopted in the project, i.e.:
volume (double) – Room volume
reverberation_time (double) - Reverberation Time of a room

room volume in m^3
T : float, np.ndarray
reverberation time in s

Returns
-------
schroeder_freq : float, np.ndarray

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation return statement does not match the actual return variable name. Please repair and change to schroeder_frequency according to convention

schroeder frequency in Hz

References
----------
.. [#] H. Kuttruff, Room acoustics, 4th Ed. Taylor & Francis, 2009.

"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can do a validation check of the input parameters. For example, the volume needs to be greater than zero. 🔢

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we could raise error, if the input parameters of the function are not valid. See the Guidelines

f_s = 2000*np.sqrt(T / V)

return f_s

def energy_decay_curve_analytic(
surfaces, alphas, volume, times, source=None,
receiver=None, method='eyring', c=343.4, frequency=None,
Expand Down