Source code for Wiener Filter

Started by August 27, 2003
```I need to do a quick test on standard Wiener Filter for speech
enhancement, to see how is the result of noise reduction, some paper
say it may contain music tones. I probaly will do some modification it
base on it.
The structure of Wiener Filter is simply as

s(n) -> FFT -> Wiener Filter -> IFFT -> S(n)

I think Wiener filter is popularly used for one channel noise
suppression, but just cannot find any respective code to run a test.
Could anybody here give me a clue?

Thanks,
Saraah
```
```
Saraah wrote:

> I need to do a quick test on standard Wiener Filter for speech
> enhancement, to see how is the result of noise reduction, some paper
> say it may contain music tones. I probaly will do some modification it
> base on it.
> The structure of Wiener Filter is simply as
>
>             s(n) -> FFT -> Wiener Filter -> IFFT -> S(n)
>
> I think Wiener filter is popularly used for one channel noise
> suppression, but just cannot find any respective code to run a test.
> Could anybody here give me a clue?
>
> Thanks,
> Saraah

A Wiener filter has a transfer function H(z) where

H(z) = { phizs(z)/phizz+(z) }+ /phizz+(z)

where the signal + noise  is z=s+v

s is the signal and v is the noise.

phizs(z) is the cross-spectral density of the signal+ noise with the
signal.

phizz(z) is the spectral density of the signal + noise

phizz+(z) is the spectral factor of phizz(z)

ie phizz(z) = phizz+(z)+ times phizz-(z)

{.}+  denotes the causal realisation ie terms whose inverse z-tranform are
in positive time only.

Its quite complicated really. Many people just show the physically
unrealisable version. You need to look at Wieners book 'Extrapolation,
interpolation and smoothing of stationary times series with engineering
applications' or
for discrete time the work of Kolmogorov who independantly obtained
similar results.

Tom

```
```I already finished the implementation by myself, the code is hardly to
find. Anyway, Thank you, Tom!!

In fact, I implemented spectral subtraction algorithm which is devided
from Wiener filtering. It produces pretty good results in sometimes as
long as the noise estimation closes to the real background noise. The
musical noise companying when such estimation is not good. Is anybody
here has any idea to produce reliable result with musical noise
suppressed in speech enhancement.

Thanks,
Saraah

Tom <somebody@nOpam.com> wrote in message news:<3F616C39.FAC17412@nOpam.com>...
> Saraah wrote:
>
> > I need to do a quick test on standard Wiener Filter for speech
> > enhancement, to see how is the result of noise reduction, some paper
> > say it may contain music tones. I probaly will do some modification it
> > base on it.
> > The structure of Wiener Filter is simply as
> >
> >             s(n) -> FFT -> Wiener Filter -> IFFT -> S(n)
> >
> > I think Wiener filter is popularly used for one channel noise
> > suppression, but just cannot find any respective code to run a test.
> > Could anybody here give me a clue?
> >
> > Thanks,
> > Saraah
>
> A Wiener filter has a transfer function H(z) where
>
> H(z) = { phizs(z)/phizz+(z) }+ /phizz+(z)
>
> where the signal + noise  is z=s+v
>
> s is the signal and v is the noise.
>
> phizs(z) is the cross-spectral density of the signal+ noise with the
> signal.
>
> phizz(z) is the spectral density of the signal + noise
>
> phizz+(z) is the spectral factor of phizz(z)
>
> ie phizz(z) = phizz+(z)+ times phizz-(z)
>
> {.}+  denotes the causal realisation ie terms whose inverse z-tranform are
> in positive time only.
>
> Its quite complicated really. Many people just show the physically
> unrealisable version. You need to look at Wieners book 'Extrapolation,
> interpolation and smoothing of stationary times series with engineering
> applications' or
> for discrete time the work of Kolmogorov who independantly obtained
> similar results.
>
> Tom
```
```waterie@msn.com (Saraah) wrote in message news:<be280b4e.0309161604.55406394@posting.google.com>...
> I already finished the implementation by myself, the code is hardly to
> find. Anyway, Thank you, Tom!!
>
> In fact, I implemented spectral subtraction algorithm which is devided
> from Wiener filtering. It produces pretty good results in sometimes as
> long as the noise estimation closes to the real background noise. The
> musical noise companying when such estimation is not good. Is anybody
> here has any idea to produce reliable result with musical noise
> suppressed in speech enhancement.

What do you mean by "musical noise"?

With a "mildly nonstationary" bacground noise I would try to use some
adaptive update of the noise covariance. If you, for instance, use some
sort of "squelch" to detect whether the microphone/input hears only noise,
or hears noise and useful signal, you could have the noise covariance matrix
updated in those pauses in the useful signal.

Rune
```
```waterie@msn.com (Saraah) wrote in message news:<be280b4e.0309161604.55406394@posting.google.com>...
> I already finished the implementation by myself, the code is hardly to
> find. Anyway, Thank you, Tom!!
>
> In fact, I implemented spectral subtraction algorithm which is devided
> from Wiener filtering. It produces pretty good results in sometimes as
> long as the noise estimation closes to the real background noise. The
> musical noise companying when such estimation is not good. Is anybody
> here has any idea to produce reliable result with musical noise
> suppressed in speech enhancement.
>
> Thanks,
> Saraah
>
>
>
> Tom <somebody@nOpam.com> wrote in message news:<3F616C39.FAC17412@nOpam.com>...
> > Saraah wrote:
> >
> > > I need to do a quick test on standard Wiener Filter for speech
> > > enhancement, to see how is the result of noise reduction, some paper
> > > say it may contain music tones. I probaly will do some modification it
> > > base on it.
> > > The structure of Wiener Filter is simply as
> > >
> > >             s(n) -> FFT -> Wiener Filter -> IFFT -> S(n)
> > >
> > > I think Wiener filter is popularly used for one channel noise
> > > suppression, but just cannot find any respective code to run a test.
> > > Could anybody here give me a clue?
> > >
> > > Thanks,
> > > Saraah
> >
> > A Wiener filter has a transfer function H(z) where
> >
> > H(z) = { phizs(z)/phizz+(z) }+ /phizz+(z)
> >
> > where the signal + noise  is z=s+v
> >
> > s is the signal and v is the noise.
> >
> > phizs(z) is the cross-spectral density of the signal+ noise with the
> > signal.
> >
> > phizz(z) is the spectral density of the signal + noise
> >
> > phizz+(z) is the spectral factor of phizz(z)
> >
> > ie phizz(z) = phizz+(z)+ times phizz-(z)
> >
> > {.}+  denotes the causal realisation ie terms whose inverse z-tranform are
> > in positive time only.
> >
> > Its quite complicated really. Many people just show the physically
> > unrealisable version. You need to look at Wieners book 'Extrapolation,
> > interpolation and smoothing of stationary times series with engineering
> > applications' or
> > for discrete time the work of Kolmogorov who independantly obtained
> > similar results.
> >
> > Tom

Hi Saraah

I had done a project on speech enhancement using spectral
spectraction. A standard way of decreasing the "musical noise" is to
pass the enhanced speech obtained by spectral subtraction through a
low pass filter. You may notice that the "musical noise" apeears as
high frequency blobs when viewed on a spectrogram.

Also, you may subtract a fraction of estimated noise power from the
noisy signal in a windowed speech segment, based on SNR.

i.e.

P(f)enhanced= P(f)noisy speech - alpha * P(f) estimated noise

P(f)= PSD
alpha is a fraction based on the SNR of the noisy speech signal.

There are some interpolation methods available which aid in decreasing
the "musical noise".

Hope this helps
Regards
Nithin
```