You are on page 1of 6

SPEECH ENHANCEMENT USING WIENER FILTER

Bhaskar C(12EC28), Rachith P(12EC76)

Original Speech Spectrogram

Noise Spectrogram: Ocean Waves

Noisy Speech (SNR = -5dB)

De-noised(-5dB) Speech Spectrogram

Noisy Speech (SNR = 0dB)

De-noised(0dB) Speech Spectrogram

Noisy Speech (SNR = 10dB)

De-noised(10dB) Speech Spectrogram

Short Term Wiener Filter Estimate

Results:
1. As seen in the de-noised(-5dB) spectrogram, wiener filter removes noise in
regions other than the time around 1.5 sec.
2. As seen in the de-noised(0dB) spectrogram, wiener filter removes noise in initial
time frames around 1.5sec but not during initial time frames.
3. As seen in the de-noised(10dB) spectrogram, wiener filter removes noise in both
the time frames( around 1.5 sec and initial frames).
4. As seen in short term Wiener filter estimate plot, the filter removes noise
significantly in regions other than 1.2-1.8sec time frame bins.

SNR Comparison(in dB):


Input SNR
-5
0
10

Output SNR
10.12
4.56
19.56

CODE:
[x, fs] = audioread(['n-5.wav']);
%[x, fs] = audioread(['n0.wav']);
%[x, fs] = audioread(['n10.wav']);
len = floor(20*fs/1000); % To find frame size
if rem(len,2)==1, len=len+1;
end;

len1 = floor(len*0.5); % 50% overlap


len2=len-len1;
window

= hanning(len);

m = len;
k = 1;
img = sqrt(-1);
x_old = zeros(len1,1);
frames = floor(length(x)/len1)-1;
mean_n = zeros(m,1); %mean of noise
xfinal = zeros(frames*len2,1);
j = 1;
for k = 1:25
mean_n = mean_n+abs(fft(window.*x(j:j+len-1),m)).^2;
j = j+len;
end
noise_mu2 = mean_n/25;
k=1;
alpha = 0.85;
for n = 1:frames-1
insign = window.*x(k:k+len-1);
spec = fft(insign,m);
s
= abs(spec);
s2 = s.^2;
theta = angle(spec);
PSD_1=s2-noise_mu2;
PSD(:,n) = PSD_1;
if(n>1)
PSD_1 = alpha * PSD(:,n-1) + (1-alpha) * PSD(:,n);
end
for i=1:length(PSD_1)
if PSD_1(i)<0
PSD_1(i)=0;
end
end
H_temp = PSD_1./(PSD_1+noise_mu2);
H(:,n) = H_temp;
new=H_temp.*s;
new=new.*exp(1i*theta);
xi_w = ifft(new);
xfinal(k:k+len1-1) = x_old(1:len1) + xi_w(1:len1);
x_old = xi_w(len1+1:len);
k = k + len1;
end
%sound(real(xfinal),fs)
%wavwrite(xfinal,fs,16,['Denoised.wav']);
return;

You might also like