pyroomacoustics.simulation.rt module

Internal routines used for simulation using the ray tracing method. In particular, how to transform the histograms obtained from the core simulation engine into impulse responses.

pyroomacoustics.simulation.rt.adjust_length_and_stack(histograms, n_bins)
pyroomacoustics.simulation.rt.binary_sequence(times, fs)
pyroomacoustics.simulation.rt.compute_rt_rir(t0, histograms, directional_responses, hist_bin_size, hist_bin_size_samples, volume_room, fdl, c, fs, octave_bands, air_abs_coeffs=None)
pyroomacoustics.simulation.rt.directional_sequence(t0, times, response, hist, hist_bin_size, fs)

This method construct a sequence of delta, possibly convolved with directional impulse response according to the directional energy distribution given by hist. In addition, the sequence is locally scaled to have unit energy per histogram bin.

Parameters:
  • t0 (float) – Time of the first delta.

  • times ((n_deltas,)) – The time of the deltas in the sequence.

  • response ((n_dirs, n_taps)) – The directional response of the receiver.

  • hist ((n_dirs, n_bins)) – The histograms of direction of arrival probability.

  • hist_bin_size (float) – The length in seconds of a bin of the histogram.

  • fs (float) – The sampling frequency of the sequence.

Returns:

  • A sequence built according to D. Schroeder, “Physically based real-time

  • auralization of interactive virtual environments,” Section 5.3.4, “Binaural

  • Room Impulse Response”.

pyroomacoustics.simulation.rt.interp_hist(hist, N)

interpolate the histogram on N samples

we use the bin centers as anchors since we can’t interpolate outside the anchors, we just repeat the first and last value to fill the array

Parameters:
  • hist (ndarray, (directions, bins)) – The histogram to interpolate.

  • N (int) – The number samples.

pyroomacoustics.simulation.rt.poisson_sequence(volume, duration, c, max_rate=10000, t0=None)
pyroomacoustics.simulation.rt.seq_rolling_power(seq, hbss, filter_length_mult=1)

Smooth local energy of the sequence.