Common Tools

Common Functions used in BSS algorithms

2018 (c) Robin Scheibler, MIT License

pyroomacoustics.bss.common.projection_back(Y, ref, clip_up=None, clip_down=None)

This function computes the frequency-domain filter that minimizes the squared error to a reference signal. This is commonly used to solve the scale ambiguity in BSS.

The optimal filter z minimizes the squared error.

\[\min E[|z^* y - x|^2]\]

It should thus satsify the orthogonality condition and can be derived as follows

\[ \begin{align}\begin{aligned}0 & = E[y^*\, (z^* y - x)]\\0 & = z^*\, E[|y|^2] - E[y^* x]\\z^* & = \frac{E[y^* x]}{E[|y|^2]}\\z & = \frac{E[y x^*]}{E[|y|^2]}\end{aligned}\end{align} \]

In practice, the expectations are replaced by the sample mean.

Parameters:
  • Y (array_like (n_frames, n_bins, n_channels)) – The STFT data to project back on the reference signal
  • ref (array_like (n_frames, n_bins)) – The reference signal
  • clip_up (float, optional) – Limits the maximum value of the gain (default no limit)
  • clip_down (float, optional) – Limits the minimum value of the gain (default no limit)