Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pyroomacoustics/bss/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ def projection_back(Y, ref, clip_up=None, clip_down=None):

.. math::

0 & = E[y^*\\, (z^* y - x)]
0 & = E[y^*\, (z^* y - x)]

0 & = z^*\\, E[|y|^2] - E[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]}

z & = \\frac{E[y x^*]}{E[|y|^2]}
z & = \frac{E[y x^*]}{E[|y|^2]}

In practice, the expectations are replaced by the sample
mean.
Expand Down
14 changes: 7 additions & 7 deletions pyroomacoustics/denoise/iterative_wiener.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class IterativeWiener(object):

.. math::

H(\\omega) = \dfrac{P_S(\\omega)}{P_S(\\omega) + \\sigma_d^2},
H(\omega) = \dfrac{P_S(\omega)}{P_S(\omega) + \sigma_d^2},


where :math:`P_S(\omega)` is the speech power spectral density and
Expand Down Expand Up @@ -84,12 +84,12 @@ class IterativeWiener(object):

.. math::

\sigma_d^2[k] = \\alpha \cdot \sigma_d^2[k-1] + (1-\\alpha) \cdot \sigma_y^2,
\sigma_d^2[k] = \alpha \cdot \sigma_d^2[k-1] + (1-\alpha) \cdot \sigma_y^2,

where :math:`\\alpha` is the smoothing parameter and :math:`\sigma_y^2` is
the energy of the input frame. A high value of :math:`\\alpha` will update
where :math:`\alpha` is the smoothing parameter and :math:`\sigma_y^2` is
the energy of the input frame. A high value of :math:`\alpha` will update
the noise level very slowly, while a low value will make it very sensitive
to changes at the input. The value for :math:`\\alpha` can be set with the
to changes at the input. The value for :math:`\alpha` can be set with the
`alpha` parameter.

**When speech is identified in the input frame**, an iterative procedure is
Expand Down Expand Up @@ -257,7 +257,7 @@ def compute_speech_psd(a, g2, nfft):

.. math::

P_S(\\omega) = \dfrac{g^2}{\\left \| 1 - \sum_{k=1}^p a_k \cdot e^{-jk\omega} \\right \|^2},
P_S(\omega) = \dfrac{g^2}{\left \| 1 - \sum_{k=1}^p a_k \cdot e^{-jk\omega} \right \|^2},

where :math:`p` is the LPC order, :math:`a_k` are the LPC coefficients, and
:math:`g` is an estimated gain factor.
Expand Down Expand Up @@ -297,7 +297,7 @@ def compute_squared_gain(a, noise_psd, y):

.. math::

\dfrac{N}{2\pi} \int_{-\pi}^{\pi} \dfrac{g^2}{\\left \| 1 - \sum_{k=1}^p a_k \cdot e^{-jk\omega} \\right \|^2} d\omega = \sum_{n=0}^{N-1} y^2(n) - N\cdot\sigma_d^2,
\dfrac{N}{2\pi} \int_{-\pi}^{\pi} \dfrac{g^2}{\left \| 1 - \sum_{k=1}^p a_k \cdot e^{-jk\omega} \right \|^2} d\omega = \sum_{n=0}^{N-1} y^2(n) - N\cdot\sigma_d^2,


where :math:`N` is the number of noisy samples :math:`y`, :math:`a_k`
Expand Down
4 changes: 2 additions & 2 deletions pyroomacoustics/denoise/spectral_subtraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SpectralSub(object):

.. math::

G[k, n] = \max \\left \{ \\left ( \dfrac{P[k, n]-\\beta P_N[k, n]}{P[k, n]} \\right )^\\alpha, G_{min} \\right \},
G[k, n] = \max \left \{ \left ( \dfrac{P[k, n]-\beta P_N[k, n]}{P[k, n]} \right )^\alpha, G_{min} \right \},

where :math:`G_{min} = 10^{-(db\_reduc/20)}` and :math:`db\_reduc` is the
maximum reduction (in dB) that we are willing to perform for each bin (a
Expand All @@ -64,7 +64,7 @@ class SpectralSub(object):
`Here <https://www.vocal.com/noise-reduction/musical-noise/>`_ is nice
article about noise reduction and musical noise.

Adjusting the constants :math:`\\beta` and :math:`\\alpha` also presents a
Adjusting the constants :math:`\beta` and :math:`\alpha` also presents a
trade-off between suppression and undesirable artefacts, i.e. more
noticeable musical noise.

Expand Down