DSPRelated.com
Forums

wiener filter implementation.

Started by yajn...@gmail.com May 23, 2006
Hi,
I am currently working on a speech enhancement project. I am implementing a noise cancellation system using Wiener filter.
>From what I read in the text books and from the net , I got the transfer function for the filter as

h(f) = {psd(noisySignal) - psd(noiseSignal) }/psd(noisySignal).
I implemented this in matlab ,but the result was a highly distorted signal.
I have given my procedure, pls suggest me the right way of doing it,
Assumption:First few samples are from pure noise segment.

noise = noise.* hamming(FFT_SIZE)';
FN = fft(noise,FFT_SIZE); %FFT
psdN = (FN.*conj(FN)); % psd of noise.

signal = signal.*hamming(FFT_SIZE)';
FS = fft(signal,FFT_SIZE); %/FFT
psdS = (FS.*conj(FS));

numrtr = psdS.-psdN;
denmntr = psdS;
coef = numrtr./denmntr; % filter TF

% filtering
outF = FS.*coef;
out = ifft(outF,FFT_SIZE);
output = real(out);

Thanks in Advance,
Yajna.
I believe your problem lies in that your power
spectrum estimation is not reliable. If i were to do
it, I would average the psd's over a consecutive of
say L sliding windows. Check with standard routines
for doing psd estimation.

--- y...@gmail.comд

> Hi,
> I am currently working on a speech enhancement
> project. I am implementing a noise cancellation
> system using Wiener filter.
> From what I read in the text books and from the net
> , I got the transfer function for the filter as
>
> h(f) = {psd(noisySignal) - psd(noiseSignal)
> }/psd(noisySignal).
> I implemented this in matlab ,but the result was a
> highly distorted signal.
> I have given my procedure, pls suggest me the right
> way of doing it,
> Assumption:First few samples are from pure noise
> segment.
>
> noise = noise.* hamming(FFT_SIZE)';
> FN = fft(noise,FFT_SIZE); %FFT
> psdN = (FN.*conj(FN)); % psd of noise.
>
> signal = signal.*hamming(FFT_SIZE)';
> FS = fft(signal,FFT_SIZE); %/FFT
> psdS = (FS.*conj(FS));
>
> numrtr = psdS.-psdN;
> denmntr = psdS;
> coef = numrtr./denmntr; % filter TF
>
> % filtering
> outF = FS.*coef;
> out = ifft(outF,FFT_SIZE);
> output = real(out);
>
> Thanks in Advance,
> Yajna.