Room

The room acoustics module contains several functions to calculate the reverberation time in spaces.

acoustics.room.c50_from_file(file_name, bands=None)[source]

Clarity for 50 miliseconds \(C_{50}\) from a file.

Parameters:
  • file_name (str) – File name (only WAV is supported).
  • bands (np.ndarray) – Bands of calculation (optional). Only support standard octave and third-octave bands.
acoustics.room.c80_from_file(file_name, bands=None)[source]

Clarity for 80 miliseconds \(C_{80}\) from a file.

Parameters:
  • file_name (str) – File name (only WAV is supported).
  • bands (np.ndarray) – Bands of calculation (optional). Only support standard octave and third-octave bands.
acoustics.room.clarity(time, signal, fs, bands=None)[source]

Clarity \(C_i\) determined from an impulse response.

Parameters:
  • time – Time in miliseconds (e.g.: 50, 80).
  • signal (np.ndarray) – Impulse response.
  • fs – Sample frequency.
  • bands (np.ndarray) – Bands of calculation (optional). Only support standard octave and third-octave bands.
acoustics.room.mean_alpha(alphas, surfaces)[source]

Calculate mean of absorption coefficients.

Parameters:
  • alphas – Absorption coefficients \(\alpha\).
  • surfaces – Surfaces \(S\).
acoustics.room.nrc(alphas)[source]

Calculate Noise Reduction Coefficient (NRC) from four absorption coefficient values (250, 500, 1000 and 2000 Hz).

Parameters:alphas – Absorption coefficients \(\alpha\).
acoustics.room.t60_arau(Sx, Sy, Sz, alpha, volume, c=343.0)[source]

Reverberation time according to Arau. [1]

Parameters:
  • Sx – Total surface perpendicular to x-axis (yz-plane) \(S_{x}\).
  • Sy – Total surface perpendicular to y-axis (xz-plane) \(S_{y}\).
  • Sz – Total surface perpendicular to z-axis (xy-plane) \(S_{z}\).
  • alpha – Absorption coefficients \(\mathbf{\alpha} = \left[ \alpha_x, \alpha_y, \alpha_z \right]\)
  • volume – Volume of the room \(V\).
  • c – Speed of sound \(c\).
Returns:

Reverberation time \(T_{60}\)

[1]For more details, please see http://www.arauacustica.com/files/publicaciones/pdf_esp_7.pdf
acoustics.room.t60_eyring(surfaces, alpha, volume, c=343.0)[source]

Reverberation time according to Eyring.

Parameters:
  • surfaces – Surfaces \(S\).
  • alpha – Mean absorption coefficient \(\alpha\) or by frequency bands
  • volume – Volume of the room \(V\).
  • c – Speed of sound \(c\).
Returns:

Reverberation time \(T_{60}\)

Eyring’s formula for the reverberation time is:

\[T_{60} = \frac{24 \ln{10} V}{c \left( 4 mV - S \ln{\left( 1 - \alpha \right)} \right)}\]
acoustics.room.t60_fitzroy(surfaces, alpha, volume, c=343.0)[source]

Reverberation time according to Fitzroy.

Parameters:
  • surfaces – Surfaces \(S\).
  • alpha – Mean absorption coefficient \(\alpha\) or by frequency bands
  • volume – Volume of the room \(V\).
  • c – Speed of sound \(c\).
Returns:

Reverberation time \(T_{60}\)

acoustics.room.t60_impulse(file_name, bands, rt='t30')[source]

Reverberation time from a WAV impulse response.

Parameters:
  • file_name – name of the WAV file containing the impulse response.
  • bands – Octave or third bands as NumPy array.
  • rt – Reverberation time estimator. It accepts ‘t30’, ‘t20’, ‘t10’ and ‘edt’.
Returns:

Reverberation time \(T_{60}\)

acoustics.room.t60_millington(surfaces, alpha, volume, c=343.0)[source]

Reverberation time according to Millington.

Parameters:
  • surfaces – Surfaces \(S\).
  • alpha – Mean absorption coefficient \(\alpha\) or by frequency bands
  • volume – Volume of the room \(V\).
  • c – Speed of sound \(c\).
Returns:

Reverberation time \(T_{60}\)

acoustics.room.t60_sabine(surfaces, alpha, volume, c=343.0)[source]

Reverberation time according to Sabine.

Parameters:
  • surfaces (np.ndarray) – Surface of the room \(S\). NumPy array that contains different surfaces.
  • alpha (np.ndarray) – Absorption coefficient of the room \(\alpha\). Contains absorption coefficients of surfaces. It could be one value or some values in different bands (1D and 2D array, respectively).
  • volume (float) – Volume of the room \(V\).
  • c (float) – Speed of sound \(c\).
Returns:

Reverberation time \(T_{60}\)

Sabine’s formula for the reverberation time is:

\[T_{60} = \frac{24 \ln(10)}{c} \frac{V}{S\alpha}\]