Você está na página 1de 4

Noise Cancellation From Audio Signal By Using Adapter

Filter

Project Explanation
What is Noise?
In signal processing, noise is a general term for unwanted modifications that a signal may suffer
during capture, storage, transmission, processing, or conversion. Sometimes the word is also
used to mean signals that are random and carry no useful information; even if they are not
interfering with other signals or may have been introduced intentionally, as in comfort noise.
Noise is any disturbance that interferes with data transmission and corrupts the quality of
the signal.

What is Adaptive Filter?


A filter which self adjusts its transfer function is called adaptive filter. Most adaptive filters are
Digital Filters. Mostly the adaptive filters are used for reducing the noise content from the sound
and it is based on frequency content of sound which is our input data and the noise must be in
background. The error signal are used as feedback in the form of signals in adaptive filters which
is used to refine the transfer-function to-match changing-parameters.

Steps for Noise Cancellation:


 Record noise signal
 Record audio signal
 Add signals
 Filter Signals
 Plot signal
 Plot noise
 Plot mixed signal
 Plot filtered signal
 Plot noise canceller
 Play signal
 Play noise
 Play mixed signal
 Play filtered signal

Matlab Codes for Above Steps


Record noise signal
function pushbutton1_Callback(hObject, eventdata, handles)
fs=11025;
n=20000;
handles.signal1= wavrecord(n,fs,'double');
msgbox('Recorded','Status');
guidata(hObject, handles);

Record audio signal


function pushbutton2_Callback(hObject, eventdata, handles)
fs1=11025;
n=20000;
handles.noise1= wavrecord(n,fs1,'double');
msgbox('Recorded','Status');
guidata(hObject, handles);

Add signals
function pushbutton3_Callback(hObject, eventdata, handles)
nfilt=fir1(11,0.4); % Eleventh order lowpass filter
fnoise=filter(nfilt,1,handles.noise1); % Correlated noise data
handles.d=handles.signal1+fnoise;
guidata(hObject, handles);

Filter Signals
function pushbutton4_Callback(hObject, eventdata, handles)
mu = 0.0001; % Set the step size for algorithm updating.
ha = adaptfilt.sd(42,mu);
[handles.y,handles.e] = filter(ha,handles.signal1,handles.d);
guidata(hObject, handles);

Plot signal
function pushbutton5_Callback(hObject, eventdata, handles)
figure
plot(handles.signal1);
title('Signal')

Plot noise
function pushbutton6_Callback(hObject, eventdata, handles)
figure
plot(handles.noise1);
title('Noise')
Plot mixed signal
function pushbutton7_Callback(hObject, eventdata, handles)
figure
plot(handles.d);
title('Mixed Signal')

Plot filtered signal


function pushbutton8_Callback(hObject, eventdata, handles)
figure
plot(handles.y);
title('Filtered Signal')

Plot noise canceller


function pushbutton9_Callback(hObject, eventdata, handles)
figure
subplot(2,2,1)
plot(handles.signal1);
title('Signal')
subplot(2,2,2)
plot(handles.noise1);
title('Noise')
subplot(2,2,3)
plot(handles.d);
title('Mixed Signal')
subplot(2,2,4)
plot(2.5.*handles.y);
title('Filtered Signal')

Play signal
function pushbutton10_Callback(hObject, eventdata, handles)
wavplay(handles.signal1);
guidata(hObject, handles);

Play noise
function pushbutton11_Callback(hObject, eventdata, handles)
wavplay(handles.noise1);
guidata(hObject, handles);

Play mixed signal


function pushbutton12_Callback(hObject, eventdata, handles)
wavplay(handles.d)
Play filtered signal
function pushbutton13_Callback(hObject, eventdata, handles)
wavplay(10.*handles.y)

Você também pode gostar