Wiener Filter
The Wiener filter is a Estimator#Minimum Mean Square Error (MMSE) estimator. Applied to a noisy signal, it gives the MMSE optimal estimate for the clean signal, separating signal from noise. It can be derived that the MMSE is the mean of the posterior probability of the signal given observation.
The Wiener Filter is a function of the signal PSD \(\Phi_{SS}\) and noise PSD \(\Phi_{VV}\):
where \(\sigma_S^2\) is the variance of the true signal. Since we don't know the true signal, we have to estimate the true PSD by subtracting the noise PSD from the observed PSD:
^50b851
Idea¶

The Wiener filter applies gain where the sample is likely to stem from the true signal and attenuates the signal when its likely just noise. The left graph shows the a single frame of observed speech signal and the noise from the environment. On the right, the Wiener filter was applied.
As can be seen, the peaks from the spectral harmonics of the speech are basically unchanged. For them, the variance observed signal is much larger than that of the noise, so the gain remains close to 1. For the values between the harmonics however, the observed variance is very similar to that of the noise, maybe even smaller. The gain factor then goes down to 0.5 or lower, attenuating the part of the signal that contains a lot of energy from the noise signal.
Basically, the Wiener filter attenuates parts of the signal with low SNR and emphasizes parts with a high SNR. It does so by comparing the variances of noise and true signal. Since we don't know the variance of the true signal, we have to estimate the true signal by taking our observations and subtracting the noise.
Background¶
Given a signal \(Y=S+N\), where the true signal \(S\) and the noise \(N\) are uncorrelated. We now want to solve for the MMSE estimator \(\hat{S}=\mathbb{E}_{S}(S|Y=y)\):
$$ \begin{align} \hat{S} &= \mathbb{E}{S}(S|Y=y) \ &= \int\limits(s|y)ds \ &= \frac{\int\limits_{-\infty}^{\infty}s{\space}p_{Y|S=s}(y|s){\space}p_{S}(s){\space}ds}{p_{Y}(y)}}^{\infty}s{\space}p_{S|Y=y
\end{align} $$
We now need to find models:
$$ \begin{align}
p_{S}(s) &= \frac{1}{\sqrt{2\pi \sigma_S2}}\exp\left(-\frac{S\right)\}}{2\sigma_{S}^{2}
p_{Y|S}(Y|S) &= \frac{1}{\sqrt{2\pi \sigma_{N}{2}}}\exp\left(-\frac{(Y-S)\right)\}}{2\sigma_{N}^{2}
p_{Y}(Y) &= \frac{1}{\sqrt{2\pi (\sigma_{S}{2}+\sigma_{N}\exp\left(-\frac{(Y-S)})}{2}}{2(\sigma_{S}\right)\} +\sigma_{N}^{2})
\end{align} $$
and can plug them in. After a lengthy derivation, this gives us the Wiener Filter:
This shows us that the estimator is a weighting of the observed samples:
- If the variance of the true signal is large compared to the noise, the factor on the right will be close to one.
- If the variance of the noise is comparatively large, the factor will be close to zero.
Therefore, the Wiener filter can be seen as a gain function and is the optimal estimation that minimizes the MMSE to the true signal.
Derive Wiener Filter¶
To derive the Wiener filter, we need to find the filter coefficients \(g\) that minimize the MSE:
1. Define MSE¶
We can use the definition of the estimator as a convolutional filter and plug it into the definition of a MMSE estimator:
2. Find Minimum of MSE¶
We will now find the coefficients by finding the minimum of the MSE:
3. Transform Cross-correlation into PSDs¶
We got the filter now, but the definition involves the power spectrum of the cross-correlation of the observation and the true signal. Assuming that noise and signal are uncorrelated, we can define the filter through the signal PSD \(\Phi_{SS}\) and the noise PSD \(\Phi_{VV}\):
We no have derived the Wiener Filter as a function of the signal PSD \(\Phi_{SS}\) and \(\Phi_{VV}\)
Derive Wiener Filter in STFT Domain¶
We define the Wiener Filter in the STFT domain as
where \(k\) are the frequency bins and \(l\) are the frames.
1. Define MSE¶
We try to optimize the MSE independent of frame or frequency bin, so we can drop the indices:
2. Optimize Phase¶
We optimize the phase by maximizing the only term in the sum that is dependent on the phase of our filter \(G\):
3. Optimize Magnitude¶
We can now plug in the optimal phase into the the MSE. We now find the optimal magnitude by finding the extreme point of the derivative of the MSE:
4. Combine Optimal Results¶
We can now combine our results for optimal phase and magnitude. Assuming an uncorrelated signal \(S\) and noise \(V\), we can again simplify the expression to derive the Wiener Filter as a function over the PSDs:
The last definition also gives us another interpretation:
giving us the definition of the Wiener Filter as the MMSE estimator shown in #Background.,