# Wiener Filtering

In speech recognition, noise such as the microphone related noise and the electrical noise can be a key factor to deteriorate the quality of recognition. Thus, filtering method should be introduced to deal with noise. Wiener filtering, a filtering method, adapts the coefficients of the wiener filter with respect to the statistics of the speech signal to generate a desired output signal.

# 1. Introduction

To solve the linear optimum filtering problem [1], wiener filter, a type of adaptive filter, is developed based on wiener theory issued by Norbert Wiener in 1940. The basic principle of wiener filter is to optimize its coefficient to minimize the average squared distance between a desired signal and the filter output. The typical applications of wiener filter is additive noise reduction, linear prediction, signal restoration and system identification [2]. This article mainly focuses on the additive noise reduction using the FIR wiener filter.

# 2. Motivation

As in the figure above, given a time series x(0), x(1), x(2), …,x(n) which is the input signal of filter, a linear discrete-time filter with the output y(n) that generates the best estimation of the desired signal d(n), is to be designed. We confine the filter to be used to FIR filter because a large amount of computation is needed for the combination of adaptivity and feedback when an IIR filter needs to be designed. The criterion of the statistical optimization is a minimized mean square distance between y(n) and d(n) which is dependent on the unknown coefficient of the filter [2]. In this situation, how to get optimal filter coefficient becomes the main issue.

# 3. Basic Algorithm of FIR Wiener Filter

With the filter coefficient $w(n)$, we can get the output $y(n)$ and the error of estimation $e(n)$:

$y(n)=w(n)*x(n)=\sum_{l=0}^{N-1}w(l)x(n-l)$                                                                                                     (1)

$e(n)=d(n)-y(n)=d(n)-\sum_{l=0}^{N-1}w(l)x(n-l)$                                                                                       (2)

The coefficient of wiener filter $w(n)$ is optimal if it minimizes the mean square error:

$J(w)_{MSE}=E\left&space;\{&space;\left&space;|&space;e(n)&space;\right&space;|^{2}&space;\right&space;\}=E\left&space;\{&space;\left&space;|&space;d(n)-y(n)&space;\right&space;|^{2}&space;\right&space;\}$                                                                                       (3)

Getting the derivative of $J(w)_{MSE}$ with respect to $w^{*}(k)$ and force it to zero derive the orthogonality principle:

$E\left&space;\{&space;e(n)&space;x^{*}(n-k)\right&space;\}=0,&space;k=0,&space;1&space;......,&space;N-1$                                                                                              (4)

Through the rearrangement of the equation (4) we get equation (5) (where $r_{dx}=E\left&space;\{&space;d(n)x^{*}(n-k)&space;\right&space;\}$ and $r_{x}(k-l)=E\left&space;\{&space;x(n-l)x^{*}(n-k)&space;\right&space;\}$) and its matrix form equation (6) with $r_{x}(k)=r_{x}^{*}(-k)$:

$\sum_{l=0}^{N-1}w(l)r_{x}(k-l)=r_{dx},&space;k=0,1,&space;......,&space;N-1$                                                                                           (5)

$\begin{bmatrix}&space;r_{x}(0)&&space;r_{x}^{*}&space;(1)&space;&&space;...&space;&&space;r_{x}^{*}(N-1)\\&space;r_{x}(1)&&space;r_{x}(0)&space;&&space;...&space;&&space;r_{x}^{*}(N-2)&space;\\&space;r_{x}(2)&space;&&space;r_{x}(1)&&space;...&space;&&space;r_{x}^{*}(N-3)\\&space;.&space;&.&space;&&.&space;\\&space;.&space;&.&space;&&&space;.\\&space;.&space;&&space;.&space;&&.&space;\\&space;r_{x}(N-1)&space;&&space;r_{x}(N-1)&space;&...&space;&&space;r_{x}^{*}(0)&space;\end{bmatrix}\begin{bmatrix}&space;w(0)\\&space;w(1)\\&space;w(2)\\&space;.\\&space;.\\&space;.\\&space;w(N-1)&space;\end{bmatrix}=\begin{bmatrix}&space;r_{dx}(0)\\&space;r_{dx}(1)\\&space;r_{dx}(2)\\&space;.\\&space;.\\&space;.\\&space;r_{dx}(N-1)&space;\end{bmatrix}$                                         (6)

The equation is actually the Wiener-Hopf equation. By solving it, the optimal filter coefficients $w(n)$ is obtained:

$R_{x}w=r_{dx}$                                                                                                                                                                                                                (7)

From the equation (2), (3) and (4), the minimum mean square error is [3]:

$J_{MMSE}(w)=E\left&space;\{&space;e(n)d^{*}(n)&space;\right&space;\}=r_{d}(0)-\sum_{l=0}^{N-1}w(l)r_{dx}^{*}(l)$                                                                          (8)

# 4. Example of  its application

In this section, a simple example of the Application of wiener filtering for choosing an input word signal to approach a desired output signal is introduced.

We now have two recorded reference signals x1(n) and x2(n) for the same word and a desired signal d(n). Now we need to decided which of the two signals generates a output y(n) that has a smaller minimum mean square error with respect to a desired signal, d(n).

According to the algorithm of wiener filtering, with x1(n) and d(n) we calculate rdx1, Rx1, rd(0) and then get the optimal filter coefficients w1(n) by the equation (7), the way to get w2(n) is the same. Then we get the minimum mean square error with respect to w1(n) and w2(n). According to the principle that the smaller the MMSE, the better estimation, the system will choose the signals with a smaller MMSE from the two reference signals to be recorded at a third time [3].

With wiener filtering, an input word signal that is more likely to generate the desired output signal despite the noise is chosen from the reference signals. Furthermore, We can introduce more reference signals to make the MMSE between the optimal output signal and the desired one even smaller.

# 5. References

[1]  A rapid introduction to adaptive filtering, Chapter 2, Wiener filtering, Hernan Rey, Leonardo Rey Vega, Springer, 2012

[2] Introduction of wiener filter, Darcy Tsai, Graduate Institute of Electronics Engineering Nation Taiwan University, Taipei, Taiwan, ROC

[3] The algorithms of speech recognition, programming and simulating in MATLAB, Tingxiao Yang