Schroeder integration with prior subtraction of average noise power.
Chu [1] proposed to subtract the average power of the additive measurement
noise from the energy impulse response prior to applying the Schroeder
integral. The noise power $N_{est}$ is estimated from the last 10 percent
of the room impulse response if not given by the user.
noise_level (ndarray, float or string) – If set to ‘auto’, the noise power is calculated based on the last 10
percent of the RIR. Otherwise it needs to be given for each individual
channel of the input. The default is ‘auto’.
is_energy (boolean) – If True the input data is proportional to energy density; if False
the input data is proportional to sound pressure.
time_shift (bool) – If True, the delay of the RIR is removed.
channel_independent (boolean) – Defines, if the time shift and normalization is done
channel-independently or not.
normalize (bool) – If True, the energy decay curve is normalized.
threshold (float, None) – Defines a peak-signal-to-noise ratio based threshold in dB for final
truncation of the EDC. Values below the sum of the threshold level and
the peak-signal-to-noise ratio in dB are discarded. The default is
10 dB. If None, the decay curve will not be truncated further.
plot (Boolean) – Specifies, whether the results should be visualized or not.
The average power $N_{set}$ of the additive measurement noise is subtracted
from the energy impulse response prior to applying the Schroeder integral.
The Schroeder integration is truncated at the intersection with the noise
floor and the truncation error compensated based on the assumption of a
single exponential late decay process.
For a more detailed description of the method, see [2].
The EDC contains np.nan values if the intersection time could not
be computed due to a low signal-to-noise ration. In this case a warning
is raised as well.
freq (integer OR string) – The frequency band. If set to ‘broadband’,
the time window of the Lundeby-algorithm will not be set in dependence
of frequency.
noise_level (ndarray, double OR string) – If not specified, the noise level is calculated based on the last 10
percent of the RIR. Otherwise specify manually for each channel
as array.
is_energy (boolean) – If True the input data is proportional to energy density; if False
the input data is proportional to sound pressure.
time_shift (boolean) – Defines, if the silence at beginning of the RIR should be removed.
channel_independent (boolean) – Defines, if the time shift and normalization is done
channel-independently or not.
normalize (boolean) – Defines, if the energy decay curve should be normalized in the end
or not.
plot (Boolean) – Specifies, whether the results should be visualized or not.
Truncated Schroeder integration with additive truncation compensation.
Lundeby et al. [3] proposed a correction term to for the truncation
error. The missing signal energy, caused by limiting the integration time,
is estimated under the assumption of a single exponential late decay
process.
The EDC contains np.nan values if the intersection time could not
be computed due to a low signal-to-noise ration. In this case a warning
is raised as well.
freq (integer OR string) – The frequency band. If set to ‘broadband’,
the time window of the Lundeby-algorithm will not be set in dependence
of frequency.
noise_level (ndarray, double OR string) – If not specified, the noise level is calculated based on the last 10
percent of the RIR. Otherwise specify manually for each channel
as array.
is_energy (boolean) – If True the input data is proportional to energy density; if False
the input data is proportional to sound pressure.
time_shift (bool) – If True, the delay of the RIR is removed.
channel_independent (boolean) – Defines, if the time shift and normalizsation is done
channel-independently or not.
normalize (boolean) – Defines, if the energy decay curve should be normalized in the end
or not.
plot (Boolean) – Specifies, whether the results should be visualized or not.
The integration is truncated at the intersection with measurement noise,
which is estimated from the room impulse response using Lundeby’s
algorithm. An initial estimation of the noise power is performed on the
last 10 percent of the impulse response, if no value is passed. Using the
default parameters, the function is compliant with ISO 3382-1:2009 [4].
\[E_(t) = \int_t^{t_{i}} h^2(\tau) d\tau\]
Note
The EDC contains np.nan values if the intersection time could not
be computed due to a low signal-to-noise ration. In this case a warning
is raised as well.
freq (integer OR string) – The frequency band. If set to ‘broadband’,
the time window of the Lundeby-algorithm will not be set in dependence
of frequency.
noise_level (ndarray, double OR string) – If not specified, the noise level is calculated based on the last 10
percent of the RIR. Otherwise specify manually for each channel
as array.
is_energy (boolean) – If True the input data is proportional to energy density; if False
the input data is proportional to sound pressure.
time_shift (boolean) – Defines, if the silence at beginning of the RIR should be removed.
channel_independent (boolean) – Defines, if the time shift and normalization is done
channel-independently or not.
normalize (boolean) – Defines, if the energy decay curve should be normalized in the end
or not.
threshold (float) – Defines a peak-signal-to-noise ratio based threshold in dB for final
truncation of the EDC. Values below the sum of the threshold level and
the peak-signal-to-noise ratio in dB are discarded. The default is
15 dB, which is in correspondence with ISO 3382-1:2009.
plot (Boolean) – Specifies, whether the results should be visualized or not.
freq (integer OR string) – The frequency band. If set to ‘broadband’,
the time window of the Lundeby-algorithm will not be set in dependence
of frequency.
initial_noise_power (ndarray, double OR string) – If 'auto', the noise level is calculated based on the last 10
percent of the RIR. Otherwise specify manually for each channel
as array.
is_energy (boolean) – If True the input data is proportional to energy density; if False
the input data is proportional to sound pressure.
time_shift (boolean) – Defines, if the silence at beginning of the RIR should be removed.
channel_independent (boolean) – Defines, if the time shift and normalization is done
channel-independently or not.
plot (Boolean) – Specifies, whether the results should be visualized or not.
failure_policy (string, optional) –
Specifies how failures in detecting the Lundby parameters (see return
values below) are handled.
'error': raises an error and the computation is terminated.
'warning': raises a warning and returns NaN values. This is
useful when computing parameters for multi-channel input, e.g., in
octave bands.
The default is 'error'.
Returns:
intersection_time (ndarray, float) – Returns the Lundeby intersection time for each channel.
reverberation_time (ndarray, float) – Returns the Lundeby reverberation time for each channel.
noise_level (ndarray, float) – Returns the noise level estimation for each channel.
References
Examples
Estimate the intersection time \(T_i\) and plot the RIR and the
estimated noise power.
is_energy (boolean, optional) – Whether the input represents energy data or sound pressure values.
By default, this is set to False. If set to True,
the variable \(h(\tau)\) is assumed to represent energy and
the power two is omitted from the given equation.
No preprocessing of the impulse response is performed. In particular,
this function does not:
detect or align the direct sound (impulse response start),
compensate for measurement noise,
truncate the impulse response at the noise floor.
The full length of the input signal is squared and integrated.
For measurements in accordance with ISO 3382 [7], appropriate
preprocessing (pyrato.edc.energy_decay_curve_truncation) of the
impulse response
(time alignment, band-pass filtering, and noise handling) must be
performed before calling this
function.
Example
Calculate the Schroeder integral of a simulated RIR and plot.
Subtract the noise power from a squared room impulse response.
Parameters:
data (pyfar.TimeData) – The squared room impulse response.
noise_level (str or numpy.ndarray, float, optional) – The noise power for each channel. The default is ‘auto’, which will
try to estimate the noise power from the room impulse response.
Returns:
The squared room impulse response after noise power subtraction.