Professional Documents
Culture Documents
Assignment Report
Assignment Report
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.
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;
= 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;