SlideShare a Scribd company logo
Noise canceling in audio signal with adaptive filter
John Christakis
Logothetis Antonis
Mpalolakis Antonis
Boulgaris Konstantinos
Gogornas Ioannis
Theodore P. Chinis
Electronic Engineering
Technological Educational Institute of Athens
Agiou Spyridonos
12210
Egaleo
GREECE
Abstract: - In this paper, an adaptive noise canceller will be presented and some useful
observations will be done with the canceling process over the audio signal
1 Introduction
All the physical systems when they operate, they produce physical noise, which is a mixing of
an infinitive number of sinusoidal harmonics with different frequencies. So, the initial signal
information is corrupted with this noise. This complex signal, may be very noisy, so much that
the human ear or other system which may follow it, cannot receive correct the initial signal.
So, an algorithm has to be invented which must be able to separate the physical noise from the
information signal and to output the information signal without noise. This is not possible, as
there is not a perfect system. So, this algorithm should have the ability to reduce the noise level
as much as it can.
A good noise-canceling algorithm is the algorithm, which is presented in this paper. This
algorithm is based on the Least Mean Square algorithm. This system, operates like an automatic
control system with feedback where the feedback performs an adaptation to the filter
coefficients, otherwise it adjust the filtering of the noise in each sample.
2 Problem formulation
A simple audio signal is represented by the following mathematical equation
( ) )*/**2sin()(1 nfsfopinx =
Where 0f is the frequency of the audio signal, fs is the sampling frequency and n
is the discrete time base.
Fig.1 The simple audio signal without noise
When white noise is added to this signal then it becomes
( ) ( ) ( ) ( )nnoisenfsfopinc += */**2sin2
So, the problem is to extract the useful signal from this complex signal.
Fig.2 The audio signal with noise
A simple adaptive filter noise canceller is presented in the following diagram.
Audio signal with noise c(n)- uk Output - yk
Noise(n) - d(n)
error(n)- ek
Fig.3 Adaptive filter noise canceller
2
Adaptive Filter
Wk+1
+
2.1 Brief adaptive filter theory
One of the most successful adaptive algorithms is the LMS algorithm developed by Widrow and
his coworkers. Instead of computing optW which is the optimal solution of the wiener filter, the
LMS coefficients are adjusted from sample to sample in such a way as to minimize the MSE
(mean square error).
The LMS is based on the steepest descent algorithm where the weight vector is updated from
sample to sample as in the next equation.
( ) kkk WW ∇−=+ µ13
Where Wk and k∇ are the weight or the impulse response w (n) of the filter and the true gradient
vectors respectively, at the thk sampling instant. µ Controls the stability and rate of
convergence.
The steepest descent algorithm in the previous equation still requires knowledge of R and P ,
since k∇ is obtained by the next equation.
( ) 0224 =+−==∇ RWP
dW
dJ
k
The LMS algorithm is a practical method of obtaining estimations of the filter weights Wk in real
time without the matrix inversion of the next equation PRWopt
1−
= or the direct computation
of the autocorrelation and cross correlation. The Widrow – Hopf LMS algorithm for updating the
weights from sample to sample is given by
( ) kkkk XeWW µ25 1 +=+
Where: k
T
kkk XWye −=
Clearly, the LMS algorithm above does not require prior knowledge of the signal statistics (that is
the correlations R and P ), but instead uses their instantaneous estimations. The weights
obtained by the LMS algorithm are only estimations, but these estimations improve gradually
with time as the weights are adjusted and the filter learns the characteristics of the signal.
Eventually, the weights converge. The condition of convergence is:
( )
max
106
λ
µ ><
Where maxλ is the maximum eigenvalue of the input data covariance matrix In practice, kW
never reaches the theoretical optimum (the Wiener solution), as the algorithm iteration step can
never be zero but it has a discrete value.
Furthermore, the LMS algorithm can be summarized in the next equation for the implementation
of the filter.
( ) ( ) ( ) ( )∑
+
=
−=
1
0
*7
N
i
i ikukwky
( ) )()()()1(8 κκµκκ euhh +=+
In which: ( )kyde −= )()( κκ
In the above equation, T denotes the transpose of the vector invh . The desired response )(κd
can be found from the adaptive filter scheme to be
3
( ) )()()(9 gwhd T
x −= κκκ
The notation )(κu denotes a vector of samples arranged as
( ) [ ]T
Nuuuku )1(...............)1()()(10 +−−= κκκ
Where N is the order of the filter.
3 Problem solution
The problem solution may be based on standard adaptive techniques and especially on the
adaptive filter noise canceller.
This filter gets the physical noise and filters it in such a way that the algebraic addition with the
complex signal produces a new signal with a very low level of noise. The schematic diagram of
the adaptive filter noise canceller was given above and it is presented again in the following
diagram.
Audio signal with noise x(n) Output – y(n)
Noise d(n)
error(n)
Fig.4 The used adaptive noise canceller
As it can be observed, the adaptive filter noise canceller is a system with feedback as a system
with automatic control. For this reason, there is stability problem. The problem arises when the
error signal’s amplitude increases in accordance with time or when no convergence is obtained.
The mathematical algorithm, which is used by the adaptive filter for the filter’s coefficients
update, is called LMS (Least mean square) algorithm. This algorithm tries to minimize the
square of the error signal so; the audio signal has been reconstructed quite well.
The system output is the error signal. The error signal is the algebraic subtraction between the
audio signal with noise and the noise. When the LMS algorithm performs a good convergence
then the only error signal is the audio signal. So, the error signal must be the noise canceller
output.
The LMS algorithm has also an initial step variable μ, which is the step of the convergence in
each iteration. In the matlab code where the adaptive filter noise canceller is built, the NLMS
algorithm used. The only difference is that the step variable μ, changes in each iteration with the
next equation:
( )
( ) 2
)(11
ku+
=
α
β
κµ
where β is a positive constant, usually less than 2 , and α is a small positive constant. The
symbol
2
)(κu is the energy of the signal in a predefined buffer.
4
Adaptive Filter
Wk+1
+
3.1 Implementation of the adaptive filter noise canceller in matlab and waveforms
The adaptive noise canceller was implemented in matlab as it offers the opportunity for a quick
and very professional way to study the whole operation of the system.
The matlab code, which was written, is presented now.
function [x] = noice_canceller
clear all;
%**********************
%**** Time Base *******
%**********************
N = 2000;
n = 1:1:N;
%***********************
%**** System Vars
%***********************
fo = 500;
Fs = 44100;
db = 5;
%***********************
%***** Signal Generation
%***********************
audio = sin(2*pi*fo/Fs*n); %+ 0.7*sin(2*pi*5*fo/Fs*n));
%**********************
%**** Noise Generation
%*********************
%noise_plus_audio = awgn(audio,db);
noise = wgn(1,N,db)/2;
%noise = 0.1*randn(1,N);
for i=1:1:N
noise_plus_audio(i) = (audio(i) + noise(i)/2);
end
%**************************************
%**** Initialization of Noise Canceller
%**************************************
w0 = zeros(1,32); % Initial filter coefficients
%wi = zeros(1,255);
mu = 0.4; % LMS step size
S = initnlms(w0,mu,[],1);
%***************************************
%***** Apply Noise Canceller over signal
%***************************************
for i=1:1:N
[y,canceller_output(i),S] = adaptnlms(noise(i),noise_plus_audio(i),S);
%***************************************
%***** Calculate FFT of Signals
%***************************************
ff_mix = abs(fft(noise_plus_audio,1024));
ff_output = abs(fft(canceller_output,1024));
%***************************************
%***** Calculate Error
%***************************************
error(i) = audio(i) - canceller_output(i);
%***********************
%*** Plots *************
%***********************
subplot(6,1,1);
plot(noise_plus_audio,'r');
axis([0 N -2 2]);
title('Signal and Noise');
subplot(6,1,2);
plot(audio,'g');
5
axis([0 N -2 2]);
title('Audio Signal');
subplot(6,1,3);
plot(canceller_output,'b');
title('Canceller Output');
axis([0 N -2 2]);
subplot(6,1,4);
plot(ff_mix,'r');
title('FFT of Mixed Signal');
subplot(6,1,5);
plot(ff_output,'r');
title(' FFT of Output');
subplot(6,1,6);
plot(error,'g');
axis([0 N -2 2]);
title('Error of FFT');
drawnow;
end
The output waveforms of the system are plotted in the next figure.
Fig.5 Noise canceller output waveforms
4 Conclusion
To sum up, the adaptive noise canceller is a very efficient and useful system in many
applications with sound, video etc. The only disadvantage is that it needs digital signal processor
DSP for its operation.
References:
1. Simon Haykin, Adaptive Filter Theory, Prentice Hall 2002
6
axis([0 N -2 2]);
title('Audio Signal');
subplot(6,1,3);
plot(canceller_output,'b');
title('Canceller Output');
axis([0 N -2 2]);
subplot(6,1,4);
plot(ff_mix,'r');
title('FFT of Mixed Signal');
subplot(6,1,5);
plot(ff_output,'r');
title(' FFT of Output');
subplot(6,1,6);
plot(error,'g');
axis([0 N -2 2]);
title('Error of FFT');
drawnow;
end
The output waveforms of the system are plotted in the next figure.
Fig.5 Noise canceller output waveforms
4 Conclusion
To sum up, the adaptive noise canceller is a very efficient and useful system in many
applications with sound, video etc. The only disadvantage is that it needs digital signal processor
DSP for its operation.
References:
1. Simon Haykin, Adaptive Filter Theory, Prentice Hall 2002
6

More Related Content

PPTX
Adaptive Noise Cancellation
PPT
Acoustic echo cancellation using nlms adaptive algorithm ranbeer
DOCX
Lab Report pub
PDF
PDF
A New Method for a Nonlinear Acoustic Echo Cancellation System
PDF
Analysis the results_of_acoustic_echo_cancellation_for_speech_processing_usin...
PPTX
Detection of Power Line Disturbances using DSP Techniques
PDF
Echo Cancellation Algorithms using Adaptive Filters: A Comparative Study
Adaptive Noise Cancellation
Acoustic echo cancellation using nlms adaptive algorithm ranbeer
Lab Report pub
A New Method for a Nonlinear Acoustic Echo Cancellation System
Analysis the results_of_acoustic_echo_cancellation_for_speech_processing_usin...
Detection of Power Line Disturbances using DSP Techniques
Echo Cancellation Algorithms using Adaptive Filters: A Comparative Study

What's hot (19)

PDF
Report AdvOpticalComm - Pietro Santoro -
PDF
Filtering Electrocardiographic Signals using filtered- X LMS algorithm
PPTX
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 10-15)
PPTX
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...
PPTX
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 31-39)
PDF
PERFORMANCE ANALYIS OF LMS ADAPTIVE FIR FILTER AND RLS ADAPTIVE FIR FILTER FO...
PPTX
Introduction to equalization
PDF
Comparison of different Sub-Band Adaptive Noise Canceller with LMS and RLS
PPTX
Introduction to Adaptive filters
PDF
Ensemble Empirical Mode Decomposition: An adaptive method for noise reduction
PDF
Blind deconvolution in Wireless Communication
PPTX
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 1-3)
PDF
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
PPTX
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 4-9)
PPT
Wiener filters
PPTX
Impulse Response ppt
PPTX
parametric method of power spectrum Estimation
PPT
Equalization
PPTX
Low power vlsi implementation adaptive noise cancellor based on least means s...
Report AdvOpticalComm - Pietro Santoro -
Filtering Electrocardiographic Signals using filtered- X LMS algorithm
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 10-15)
Noice canclellation using adaptive filters with adpative algorithms(LMS,NLMS,...
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 31-39)
PERFORMANCE ANALYIS OF LMS ADAPTIVE FIR FILTER AND RLS ADAPTIVE FIR FILTER FO...
Introduction to equalization
Comparison of different Sub-Band Adaptive Noise Canceller with LMS and RLS
Introduction to Adaptive filters
Ensemble Empirical Mode Decomposition: An adaptive method for noise reduction
Blind deconvolution in Wireless Communication
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 1-3)
IJCER (www.ijceronline.com) International Journal of computational Engineerin...
Communication Systems_B.P. Lathi and Zhi Ding (Lecture No 4-9)
Wiener filters
Impulse Response ppt
parametric method of power spectrum Estimation
Equalization
Low power vlsi implementation adaptive noise cancellor based on least means s...
Ad

Viewers also liked (20)

PDF
Niezawodne Wi-Fi dla Twojej firmy
PPTX
Ραψ Α
PDF
Programma-Elettorale
PPT
Χριστούγεννα 2016
PPTX
Ρατσισμός
PDF
EXPOSING ANGELO JOHN GAGE OF NATIONAL YOUTH FRONT - anglin shill agent expose...
PDF
μάθημα3 2/11
PPTX
2ο γυμνασιο πευκης παρουσίαση Δ.Ρ.Α.Σ.Ε.
PDF
μάθημα12 11/1
PDF
Non Profit Marketing Webinar
DOCX
PDF
First Amendment Darren Chaker
PPTX
Image Segmentation
PDF
Γλώσσα Δ΄ . 5. 3. ΄΄ Ένα αλλιώτικο πάρκο!΄΄
PPTX
Καθαρισμός του νερού
PPTX
Demokraatia põhimõtted
PDF
Γλώσσα Δ΄. 2. 3. ΄΄Το νερό στη θρησκεία, στους μύθους και στις παραδόσεις΄΄
PDF
Ιστορία Δ΄ 3 . 18 . ΄΄Η ναυμαχία της Σαλαμίνας΄΄
PDF
Γλώσσα Δ΄. 2.2. ΄΄ Το ποτάμι τρέχει να συναντήσει τη θάλασσα΄΄
PPSX
Το νερό ταξιδεύει (Υδραγωγεία) - 2η Ενότητα - Άσκηση 4
Niezawodne Wi-Fi dla Twojej firmy
Ραψ Α
Programma-Elettorale
Χριστούγεννα 2016
Ρατσισμός
EXPOSING ANGELO JOHN GAGE OF NATIONAL YOUTH FRONT - anglin shill agent expose...
μάθημα3 2/11
2ο γυμνασιο πευκης παρουσίαση Δ.Ρ.Α.Σ.Ε.
μάθημα12 11/1
Non Profit Marketing Webinar
First Amendment Darren Chaker
Image Segmentation
Γλώσσα Δ΄ . 5. 3. ΄΄ Ένα αλλιώτικο πάρκο!΄΄
Καθαρισμός του νερού
Demokraatia põhimõtted
Γλώσσα Δ΄. 2. 3. ΄΄Το νερό στη θρησκεία, στους μύθους και στις παραδόσεις΄΄
Ιστορία Δ΄ 3 . 18 . ΄΄Η ναυμαχία της Σαλαμίνας΄΄
Γλώσσα Δ΄. 2.2. ΄΄ Το ποτάμι τρέχει να συναντήσει τη θάλασσα΄΄
Το νερό ταξιδεύει (Υδραγωγεία) - 2η Ενότητα - Άσκηση 4
Ad

Similar to 476 293 (20)

PPTX
Adaptive filter
PDF
LMS .pdf
PDF
Hardware Implementation of Adaptive Noise Cancellation over DSP Kit TMS320C6713
PDF
LMS Adaptive Filters for Noise Cancellation: A Review
PDF
Performance Variation of LMS And Its Different Variants
PDF
A_Noise_Reduction_Method_Based_on_LMS_Adaptive_Fil.pdf
PPT
Introduction to adaptive filtering and its applications.ppt
PDF
Noise Cancellation in ECG Signals using Computationally
PDF
PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdf
PDF
FPGA IMPLEMENTATION OF NOISE CANCELLATION USING ADAPTIVE ALGORITHMS
PPSX
Performance analysis of adaptive noise canceller for an ecg signal
PDF
P ERFORMANCE A NALYSIS O F A DAPTIVE N OISE C ANCELLER E MPLOYING N LMS A LG...
PDF
Audio Equalization Using LMS Adaptive Filtering
PDF
Simulation of Adaptive Noise Canceller for an ECG signal Analysis
PDF
Design and Implementation of Polyphase based Subband Adaptive Structure for N...
PPT
Adaptive Filtering.ppt
PDF
A Decisive Filtering Selection Approach For Improved Performance Active Noise...
PPTX
ADAPTIVE NOISE CANCELLATION
PDF
journal paper publication
PDF
Oo2423882391
Adaptive filter
LMS .pdf
Hardware Implementation of Adaptive Noise Cancellation over DSP Kit TMS320C6713
LMS Adaptive Filters for Noise Cancellation: A Review
Performance Variation of LMS And Its Different Variants
A_Noise_Reduction_Method_Based_on_LMS_Adaptive_Fil.pdf
Introduction to adaptive filtering and its applications.ppt
Noise Cancellation in ECG Signals using Computationally
PONDICHERRY UNIVERSITY DEPARTMENT OF ELECTRONICS ENGINEERING.pdf
FPGA IMPLEMENTATION OF NOISE CANCELLATION USING ADAPTIVE ALGORITHMS
Performance analysis of adaptive noise canceller for an ecg signal
P ERFORMANCE A NALYSIS O F A DAPTIVE N OISE C ANCELLER E MPLOYING N LMS A LG...
Audio Equalization Using LMS Adaptive Filtering
Simulation of Adaptive Noise Canceller for an ECG signal Analysis
Design and Implementation of Polyphase based Subband Adaptive Structure for N...
Adaptive Filtering.ppt
A Decisive Filtering Selection Approach For Improved Performance Active Noise...
ADAPTIVE NOISE CANCELLATION
journal paper publication
Oo2423882391

Recently uploaded (20)

PDF
Visual Aids for Exploratory Data Analysis.pdf
PDF
737-MAX_SRG.pdf student reference guides
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPTX
introduction to high performance computing
PDF
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
PPT
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Nature of X-rays, X- Ray Equipment, Fluoroscopy
PDF
86236642-Electric-Loco-Shed.pdf jfkduklg
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPT
Occupational Health and Safety Management System
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Visual Aids for Exploratory Data Analysis.pdf
737-MAX_SRG.pdf student reference guides
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
introduction to high performance computing
Integrating Fractal Dimension and Time Series Analysis for Optimized Hyperspe...
A5_DistSysCh1.ppt_INTRODUCTION TO DISTRIBUTED SYSTEMS
R24 SURVEYING LAB MANUAL for civil enggi
BIO-INSPIRED ARCHITECTURE FOR PARSIMONIOUS CONVERSATIONAL INTELLIGENCE : THE ...
III.4.1.2_The_Space_Environment.p pdffdf
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
Automation-in-Manufacturing-Chapter-Introduction.pdf
Nature of X-rays, X- Ray Equipment, Fluoroscopy
86236642-Electric-Loco-Shed.pdf jfkduklg
Categorization of Factors Affecting Classification Algorithms Selection
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
Occupational Health and Safety Management System
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf

476 293

  • 1. Noise canceling in audio signal with adaptive filter John Christakis Logothetis Antonis Mpalolakis Antonis Boulgaris Konstantinos Gogornas Ioannis Theodore P. Chinis Electronic Engineering Technological Educational Institute of Athens Agiou Spyridonos 12210 Egaleo GREECE Abstract: - In this paper, an adaptive noise canceller will be presented and some useful observations will be done with the canceling process over the audio signal 1 Introduction All the physical systems when they operate, they produce physical noise, which is a mixing of an infinitive number of sinusoidal harmonics with different frequencies. So, the initial signal information is corrupted with this noise. This complex signal, may be very noisy, so much that the human ear or other system which may follow it, cannot receive correct the initial signal. So, an algorithm has to be invented which must be able to separate the physical noise from the information signal and to output the information signal without noise. This is not possible, as there is not a perfect system. So, this algorithm should have the ability to reduce the noise level as much as it can. A good noise-canceling algorithm is the algorithm, which is presented in this paper. This algorithm is based on the Least Mean Square algorithm. This system, operates like an automatic control system with feedback where the feedback performs an adaptation to the filter coefficients, otherwise it adjust the filtering of the noise in each sample. 2 Problem formulation A simple audio signal is represented by the following mathematical equation ( ) )*/**2sin()(1 nfsfopinx = Where 0f is the frequency of the audio signal, fs is the sampling frequency and n is the discrete time base.
  • 2. Fig.1 The simple audio signal without noise When white noise is added to this signal then it becomes ( ) ( ) ( ) ( )nnoisenfsfopinc += */**2sin2 So, the problem is to extract the useful signal from this complex signal. Fig.2 The audio signal with noise A simple adaptive filter noise canceller is presented in the following diagram. Audio signal with noise c(n)- uk Output - yk Noise(n) - d(n) error(n)- ek Fig.3 Adaptive filter noise canceller 2 Adaptive Filter Wk+1 +
  • 3. 2.1 Brief adaptive filter theory One of the most successful adaptive algorithms is the LMS algorithm developed by Widrow and his coworkers. Instead of computing optW which is the optimal solution of the wiener filter, the LMS coefficients are adjusted from sample to sample in such a way as to minimize the MSE (mean square error). The LMS is based on the steepest descent algorithm where the weight vector is updated from sample to sample as in the next equation. ( ) kkk WW ∇−=+ µ13 Where Wk and k∇ are the weight or the impulse response w (n) of the filter and the true gradient vectors respectively, at the thk sampling instant. µ Controls the stability and rate of convergence. The steepest descent algorithm in the previous equation still requires knowledge of R and P , since k∇ is obtained by the next equation. ( ) 0224 =+−==∇ RWP dW dJ k The LMS algorithm is a practical method of obtaining estimations of the filter weights Wk in real time without the matrix inversion of the next equation PRWopt 1− = or the direct computation of the autocorrelation and cross correlation. The Widrow – Hopf LMS algorithm for updating the weights from sample to sample is given by ( ) kkkk XeWW µ25 1 +=+ Where: k T kkk XWye −= Clearly, the LMS algorithm above does not require prior knowledge of the signal statistics (that is the correlations R and P ), but instead uses their instantaneous estimations. The weights obtained by the LMS algorithm are only estimations, but these estimations improve gradually with time as the weights are adjusted and the filter learns the characteristics of the signal. Eventually, the weights converge. The condition of convergence is: ( ) max 106 λ µ >< Where maxλ is the maximum eigenvalue of the input data covariance matrix In practice, kW never reaches the theoretical optimum (the Wiener solution), as the algorithm iteration step can never be zero but it has a discrete value. Furthermore, the LMS algorithm can be summarized in the next equation for the implementation of the filter. ( ) ( ) ( ) ( )∑ + = −= 1 0 *7 N i i ikukwky ( ) )()()()1(8 κκµκκ euhh +=+ In which: ( )kyde −= )()( κκ In the above equation, T denotes the transpose of the vector invh . The desired response )(κd can be found from the adaptive filter scheme to be 3
  • 4. ( ) )()()(9 gwhd T x −= κκκ The notation )(κu denotes a vector of samples arranged as ( ) [ ]T Nuuuku )1(...............)1()()(10 +−−= κκκ Where N is the order of the filter. 3 Problem solution The problem solution may be based on standard adaptive techniques and especially on the adaptive filter noise canceller. This filter gets the physical noise and filters it in such a way that the algebraic addition with the complex signal produces a new signal with a very low level of noise. The schematic diagram of the adaptive filter noise canceller was given above and it is presented again in the following diagram. Audio signal with noise x(n) Output – y(n) Noise d(n) error(n) Fig.4 The used adaptive noise canceller As it can be observed, the adaptive filter noise canceller is a system with feedback as a system with automatic control. For this reason, there is stability problem. The problem arises when the error signal’s amplitude increases in accordance with time or when no convergence is obtained. The mathematical algorithm, which is used by the adaptive filter for the filter’s coefficients update, is called LMS (Least mean square) algorithm. This algorithm tries to minimize the square of the error signal so; the audio signal has been reconstructed quite well. The system output is the error signal. The error signal is the algebraic subtraction between the audio signal with noise and the noise. When the LMS algorithm performs a good convergence then the only error signal is the audio signal. So, the error signal must be the noise canceller output. The LMS algorithm has also an initial step variable μ, which is the step of the convergence in each iteration. In the matlab code where the adaptive filter noise canceller is built, the NLMS algorithm used. The only difference is that the step variable μ, changes in each iteration with the next equation: ( ) ( ) 2 )(11 ku+ = α β κµ where β is a positive constant, usually less than 2 , and α is a small positive constant. The symbol 2 )(κu is the energy of the signal in a predefined buffer. 4 Adaptive Filter Wk+1 +
  • 5. 3.1 Implementation of the adaptive filter noise canceller in matlab and waveforms The adaptive noise canceller was implemented in matlab as it offers the opportunity for a quick and very professional way to study the whole operation of the system. The matlab code, which was written, is presented now. function [x] = noice_canceller clear all; %********************** %**** Time Base ******* %********************** N = 2000; n = 1:1:N; %*********************** %**** System Vars %*********************** fo = 500; Fs = 44100; db = 5; %*********************** %***** Signal Generation %*********************** audio = sin(2*pi*fo/Fs*n); %+ 0.7*sin(2*pi*5*fo/Fs*n)); %********************** %**** Noise Generation %********************* %noise_plus_audio = awgn(audio,db); noise = wgn(1,N,db)/2; %noise = 0.1*randn(1,N); for i=1:1:N noise_plus_audio(i) = (audio(i) + noise(i)/2); end %************************************** %**** Initialization of Noise Canceller %************************************** w0 = zeros(1,32); % Initial filter coefficients %wi = zeros(1,255); mu = 0.4; % LMS step size S = initnlms(w0,mu,[],1); %*************************************** %***** Apply Noise Canceller over signal %*************************************** for i=1:1:N [y,canceller_output(i),S] = adaptnlms(noise(i),noise_plus_audio(i),S); %*************************************** %***** Calculate FFT of Signals %*************************************** ff_mix = abs(fft(noise_plus_audio,1024)); ff_output = abs(fft(canceller_output,1024)); %*************************************** %***** Calculate Error %*************************************** error(i) = audio(i) - canceller_output(i); %*********************** %*** Plots ************* %*********************** subplot(6,1,1); plot(noise_plus_audio,'r'); axis([0 N -2 2]); title('Signal and Noise'); subplot(6,1,2); plot(audio,'g'); 5
  • 6. axis([0 N -2 2]); title('Audio Signal'); subplot(6,1,3); plot(canceller_output,'b'); title('Canceller Output'); axis([0 N -2 2]); subplot(6,1,4); plot(ff_mix,'r'); title('FFT of Mixed Signal'); subplot(6,1,5); plot(ff_output,'r'); title(' FFT of Output'); subplot(6,1,6); plot(error,'g'); axis([0 N -2 2]); title('Error of FFT'); drawnow; end The output waveforms of the system are plotted in the next figure. Fig.5 Noise canceller output waveforms 4 Conclusion To sum up, the adaptive noise canceller is a very efficient and useful system in many applications with sound, video etc. The only disadvantage is that it needs digital signal processor DSP for its operation. References: 1. Simon Haykin, Adaptive Filter Theory, Prentice Hall 2002 6
  • 7. axis([0 N -2 2]); title('Audio Signal'); subplot(6,1,3); plot(canceller_output,'b'); title('Canceller Output'); axis([0 N -2 2]); subplot(6,1,4); plot(ff_mix,'r'); title('FFT of Mixed Signal'); subplot(6,1,5); plot(ff_output,'r'); title(' FFT of Output'); subplot(6,1,6); plot(error,'g'); axis([0 N -2 2]); title('Error of FFT'); drawnow; end The output waveforms of the system are plotted in the next figure. Fig.5 Noise canceller output waveforms 4 Conclusion To sum up, the adaptive noise canceller is a very efficient and useful system in many applications with sound, video etc. The only disadvantage is that it needs digital signal processor DSP for its operation. References: 1. Simon Haykin, Adaptive Filter Theory, Prentice Hall 2002 6