MATLAB code for voice signal with AWGN
%Code for audio with AWGN Noise
load handel.mat;
d= 'IsThat.mp3';
samples = [1,28*Fs];
clear d Fs
[d,Fs] = audioread('IsThat.mp3',samples);
sound(d,Fs)
pause(13)
x=awgn(d,20);
sound(x,Fs)
pause(3)
mu=0.013
ha=adaptfilt.lms(256,mu);
[y,e]=filter(ha,x(:,1),d(:,1));
sound(y,Fs)
subplot(4,1,1)
plot(d)
grid on
xlabel('iterations')
ylabel('amplitude')
title('original voice signal')
subplot(4,1,2)
plot(x)
grid on
xlabel('iterations')
ylabel('amplitude')
title('signal with AWGN')
subplot(4,1,3)
plot(y)
grid on
title('filtered output')
xlabel('iterations')
ylabel('amplitude')
subplot(4,1,4)
plot(e)
grid on
title('error signal')
xlabel('iterations')
ylabel('amplitude')
MATLAB code for voice signal with traffic noise
% Code for audio with traffic noise
load handel.mat;
d = 'IsThat.mp3';
samples = [1,50*Fs];
clear d Fs
[d,Fs] = audioread('IsThat.mp3',samples);
sound(d,Fs)
pause(12)
[n,Fs]= audioread('traffic-10.mp3',samples);
x=d+n;
sound(x,Fs)
pause(8)
mu=0.0130
ha=adaptfilt.lms(256,mu);
[y,e]=filter(ha,x(:,1),d(:,1));
sound(y,Fs)
subplot(4,1,1)
plot(d)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Original Signal')
subplot(4,1,2)
plot(x)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Signal with traffic noise')
subplot(4,1,3)
plot(y)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Filtered signal')
subplot(4,1,4)
plot(e)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Error signal')
MATLAB code for voice signal with airplane noise
% Code for audio with airplane noise
load handel.mat;
d = 'IsThat.mp3';
samples = [1,50*Fs];
clear d Fs
[d,Fs] = audioread('IsThat.mp3',samples);
sound(d,Fs)
pause(12)
[n,Fs]= audioread('hJetEng.mp3',samples);
x=d+n;
sound(x,Fs)
pause(8)
mu=0.0130
ha=adaptfilt.lms(256,mu);
[y,e]=filter(ha,x(:,1),d(:,1));
sound(y,Fs)
subplot(4,1,1)
plot(d)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Original Signal')
subplot(4,1,2)
plot(x)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Signal with airplane noise')
subplot(4,1,3)
plot(y)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Filtered signal')
subplot(4,1,4)
plot(e)
grid on
xlabel('Iterations')
ylabel('Amplitude')
title('Error signal')
load handel.mat;
d = 'IsThat.mp3';
samples = [1,50*Fs];
clear d Fs
[d,Fs] = audioread('IsThat.mp3',samples);
sound(d,Fs)
pause(12)
[n,Fs]= audioread('hJetEng.mp3',samples);
x=d+n;
sound(x,Fs)
pause(8)
mu=0.0130
load handel.mat;
d = 'IsThat.mp3';
samples = [1,50*Fs];
clear d Fs
[d,Fs] = audioread('IsThat.mp3',samples);
sound(d,Fs)
pause(12)
[n,Fs]= audioread('hJetEng.mp3',samples);
x=d+n;
sound(x,Fs)
pause(8)
mu=0.0130