Você está na página 1de 4

Proceedings of 2009 ,(((Student Conference on Research and Development (SCOReD 2009),

16-18
 ov. 2009, UPM Serdang, Malaysia

Hardware Implementation of Adaptive Filters


Yaghoub Mollaei
Engineering Department, School of Electrical and Computer systems Engineering, Monash University, Sunway Campus,
Malaysia

Jacob.Mollaei@hotmail.com

Abstract Adaptive filter is one of the most important areas in signal using an A/D converter, the signal is ready to be fed
digital signal processing. This paper seeks to use this area to into digital signal processor which processes the input signal
remove noise from noise corrupted audio signals. An adaptive using computer based programs and software. Any new
FIR filter with normalized LMS algorithm is designed to cancel feature can be achieved only by upgrading the software of
the noise. A SIMULIK model is created and linked to TI DSP, not requiring new hardware.
TMS320C6711 digital signal processor through embedded target All the above stated current applications motivate the
for TI C6000 SIMULIK toolbox and REAL-TIME workshop
author to get more knowledge about DSP, and try to perform
to perform hardware adaptive noise cancellation. The result is a
noise free audio signal in the DSP board output. some of these applications on hardware. It should be noted
that many practical signal processing applications call for an
Keywords Adaptive Filter, Digital Signal Processor, FIR analog or digital filter whose characteristics can be
Filter, LMS Algorithm, SIMULIK, TI TMS320C6711, automatically modified to accommodate incomplete
REAL-TIME Workshop, Code Composer Studio (CCS). knowledge or time variation in the nature of input signals [2].
This type of filter is called adaptive filter which is of great
I. INTRODUCTION interest nowadays in digital signal processing.

The objective is to perform hardware implementation of


adaptive filtering. Since there are many different applications II. ADAPTIVE FILTER
available for adaptive filters, one or two specific applications
should be selected to fulfill the project requirement. Noise Adaptive filter is generally defined as a filter whose
cancellation application which means removing background characteristics can be modified to achieve some objective and
noise from a corrupted signal was selected for this project. is usually assumed to accomplish this adaptation
The signal type that is used in this project is an audio signal automatically, without the need for substantial intervention by
which could be in the form of voice or music. Therefore, in user [5]. Here, an adaptive filter is needed that is capable of
order to accomplish the needs of project a digital filter is to be altering its impulse response as required by the particular
designed. That is, the input audio signal will be correlated application. Figure 1 shows the general structure of an
with self-generated background noise and then the designed adaptive filter.
digital filter should try to eliminate or reduce the noise. Thus
the project requires first to identify a suitable digital filter and Filter input Adaptive Filter Output
Filter
update algorithm and then its implementation.
Digital signal processing is one of the best starting points
for the study of electrical and computer engineering. DSP has
Quality
huge number of applications in todays life, such as audio Filter
Assessment
signal processing i.e. noise cancellation, system identification, Adaptation
Rules
equalization and etc. DSP is widely used in high speed
modems and mobile phones due to availability of low cost
DSP chips that can perform extensive computation in Fig. 1 The general structure of an adaptive filter
real-time. Besides audio signal processing, digital signal
processing is also used in other kind of signal processing Figure 1, composed of three blocks as shown. The first block
applications such as image processing, statistical signal is Adaptive filter block which shows what type of digital
processing and etc. filter is used in the design of the adaptive filter, which is
Digital signal processing (DSP) involves the manipulation discussed in more detail in next paragraphs. The second
of digital signals in order to extract useful information from block depicts filter adaptation rules which show the updating
them [5]. To use DSP a signal needs to be converted from algorithm used for the adaptive filter to update its parameters,
analogue (time domain) form to digital (discrete domain) form and last block as its name shows performs the quality
or in other words the signal needs to be sampled in a number assessment or simply comparison in an adaptive system, the
of samples. After sampling of the signal and digitizing the

 978-1-4244-5187-6/09/$26.00 2009 IEEE


45
output of this block is the error signal which is fed back to Finally, three basic steps should be done to perform least
filter adaptation rules block to find new parameters. mean square algorithm,
In figure 1, the filter could be implemented in analogue or
digital, which here a digital filter is used. Besides, different x Developing an analytical cost function based on
structures such as taped-delay line, pole zero or lattice can be averaging the squared error.
implemented; this paper uses taped-delay line structure since
it is straight forward and has fewer complexities. x Developing a search technique for finding that
value of weight vector that minimizes the cost
III. ADAPTIVE ALGORITHMS function, and

Constructing an adaptive filter system requires particular x Developing an approximation for the required
adaptation rules. The filter coefficient update is done based gradient function that can be computed directly
on the implemented algorithm, in other words adaptation from the data.
algorithm is the main part of adaptation system which take
care of update procedure of the coefficients and also stability B. ormalized LMS (LMS) Algorithm
of the system. There are several adaptive algorithms available
with different complexities and capabilities and for different One of the practical problems often associated with LMS
filter structures. Two of the algorithms will be discussed in algorithm is to find the step size value
P which is a small
detail in the following sections. positive constant that determines the speed of convergence of
the algorithm. Step size should not be too large to impact
A. Least Mean Squares (LMS) Algorithm algorithm stability. Theoretically the largest value of step size
is determined by the largest eigenvalue of R which is the
In LMS algorithm, the gradient of cost function J with input matrix. The value of R usually is not available therefore
respect to the coefficient vector W can be estimated directly a more reasonable approach is to find some bounds for the
from the input signal x(k ) and desired signal d (k ) . e(k ) is the largest eigenvlaues. That is, the average value of the dot
error vector and is computed as, product of the data vector with itself equals the sum of
eigenvlaues of R ,
e( k ) d (k )  y (k ) (8) 

To perform LMS algorithm, the gradient of the squared error


Avrg{ X t ( k ) X (k )} O i
i 1 (14)
is computed [5],
Hence, P can be defined as,
G ( k ) W [e 2 (k )] 2e( k ) W e( k )
D
2e( k )W {d ( k )  W t X ( k )} P
X t ( k ) X (k ) (15)
2e( k )W {W X (k )} 2e( k ) X ( k )
Where D is a positive constant with value between 0 and 2.
t
(9)
G(k ) is Thus, Normalized LMS update formula is defined as,
termed the instantaneous gradient, because it is based
only on value of e and X at time k . Using G(k ) instead of W (k  1) W (k ) 
De( k ) X ( k )
the true gradient, least mean square (LMS) can be stated as J  X t X (k ) (16)
[5],
In this update formula, the term D is the new normalized
adaptation constant, and J is a small positive term included
W (l  1) W (l )  cG(l ) , l!0

W (l )  Pe(l ) X (l ) , l ! 0 to ensure that the update term does not become too large [5].
(10) As a result NLMS algorithm may be viewed as a special
implementation of the LMS algorithm which takes into
The above algorithm is popularized by Widrow [Widrow and
Hoff, 1960]. P is a small positive constant called filter step
account the variation in the signal level at the filter input and
selects a normalized step-size parameter. This way of step-
size. Thus, the main procedures for LMS algorithm are as size selection will result in a stable as well as fast converging
follows [5]: adaptation algorithm [5].
y (k ) W t (k ) X (k ) : filter output (11)

e(k ) d (k )  y (k ) : Error formulation (12)


W (k  1) W (k )  Pe(k ) X (k ) :weight IV. ADAPTIVE NOISE CANCELLATION
vector update (13)

46
Adaptive noise cancellation is performed by subtracting
noise from a received signal, and an operation controlled in
an adaptive manner is done during the adaptation process to
get an improved signal-to-noise ratio. Noise subtraction from
a received signal could generate disastrous results by causing
an increase in the average power of the output noise.
However when filtering and subtraction are controlled by an
adaptive process, it is possible to achieve a superior system
performance compared to direct filtering of the received
signal. Figure 3 below shows adaptive noise canceling Fig. 5 NLMS Filter adapting process
technique.
According to figure 5, dot product of input port and
coefficients output port will result in output signal which then
will be subtracted from the desired signal that is shown by
input 2 in the model to calculate the error which then this
error will be used to update the next coefficient.

B. Converting the SIMULIK model to C code

A program needs to be written in Code Composer Studio


Fig. 3 Adaptive Noise Cancellation Diagram (CCS) software in C code format to be able to be loaded onto
the DSP chip. Therefore, to implement the above SIMULINK
As figure 3 shows, the system composed of two separate model on hardware or DSP board one needs to convert the
inputs, a primary input or the speech signal source which is model to C code first to be compatible with CCS software
shown as s(k ) and a reference input that is the noise input and then load it on DSP chip. Embedded target for C6000
shown as nc(k ) . The primary signal is corrupted by noise n(k ) . SIMULINK toolbox provides the link between model and
n(k ) is highly correlated with noise signal or reference signal CCS in this project. This is the first time that this toolbox is
used at Monash University Malaysia to perform this task.
nc(k ) . Desired signal d (k ) results from addition of primary
This toolbox with the aid of Real-time workshop toolbox has
signal s(k ) and correlated noise signal n(k ) . The reference the ability of converting and transforming the SIMULINK
signal nc(k ) is fed into adaptive filter and its output y(k ) is model into a complete CCS project which then can be
implemented on hardware. As it was shown in figure 6,
subtracted from desired signal d (k ) . Output of the summer
clicking on Build/Reload and Run block in the model will
block is then fed back to adaptive filter to update filter
start linking to CCS and then creating CCS project.
coefficients. This process is run recursively to obtain the
noise free signal which is supposed to be the same or very C. Hardware Experiment Results
similar to speech signal s(k ) .
Three types of tests performed for this project to examine
V. EXPERIMENTAL RESULTS the capability of the designed system. All three tests
considered broadband Gaussian noise but with different noise
A. SIMULIK Model powers to check the system performance in the presence of
different noise powers. These noises which were used as the
The model which is built for this paper is used to generate reference noise fed into the adaptive filter were low power,
C files to be downloaded onto DSP chip. The model is shown medium power and high power noise. In practical
in the figure 4, the adapting process is shown in figure 5. demonstration of system DIP switch 3 of the DSP board was
used to change the unwanted noise between two different
states and thus to observe the system capability to adapt to
new noise statistics and as a result cancel it out. A MATLAB
program was written to calculate the noise power and signal
to noise ratio of signal and noise before and after filtering to
help the reader observe the ability of the system to improve
the SNR of filtered signal. A speech signal or music signal
can be used for testing. Throughout these tests which will be
shown next a music track is used which is corrupted by noise.
The results that obtained for the designed system shows a
Fig. 4 Adaptive noise cancellation model built for hardware implementation
perfect performance of the system and impressive
improvement of signal to noise ratio was achieved. In all
result figures, the first signal is the original noise signal, the
second is noise+ audio signal and the third signal is the
adaptive filter result.

47
VI. CONCLUSION

The main objective of this paper is to implement an


adaptive filter on hardware and to do this an application was
selected. Noise cancellation application was selected to
perform hardware implementation. In the next step a digital
adaptive filter was designed in order to perform the
mentioned task. To design the filter different filter structures
and algorithms was studied. This paper provides background
information on FIR adaptive filter structure and adaptive
algorithms, LMS and NLMS algorithms. Based on these
discussions a transversal FIR adaptive filter with NLMS
updating algorithm designed for this paper. The designed
adaptive system then implemented on Texas Instruments
TMS320C6711 DSP board for hardware implementation.
Three noises with different powers were used to test and
judge about the system performance in software and
hardware. Besides high and low frequency noises were also
Fig. 7 First experiment, Low power broadband Gaussian noise used interchangeably to test the system on hardware during
its running time. The background noises for speech and
music track were eliminated adequately with reasonable rate
for all the tested noises. In low and medium power noises the
system showed SNR improvement up to 13dB and in high
power noise test 11dB of SNR improvement achieved. Based
on these results, the designed system proved to be successful
in performing the selected application that is to eliminate
unwanted noise form a desired signal such as speech signal or
any other type of audio signal.

REFRENCES

[1] Chassaing R. DSP Application using C and the


TMS320C6x DSK. Wiley Inter Science. 2002.
[2] Haykin S. Adaptive filter theory. Prentice Hall. 2002.
[3] Kehtarnavaz N and Kim N. Real-time digital signal
processing based on the TMS320C6000. Elsevier. 2004.
[4] Deependra T, Sathyanarayan SR, Lizy KJ. An
Fig. 8 Second experiment, Medium power broadband Gaussian noise
Evolutionary computation embedded IIR LMS algorithm.
Texas advanced technology program #403. 1999.
[5] Treichler JR, Johnson R, Larimore MG. Theory and
design of adaptive filters. International Edition. Prentice Hall.
2001.
[6] Astrom KJ, Wittenmark B. A survey of Adaptive control
applications. Conference on decision and control. 1995. 649-
654.
[7] Perez H, Tsujii S. A fast parallel form IIR adaptive filter
algorithm. Signal processing IEEE transaction on volume 39.
1991. 2118-2122.
[8] Texas Instruments. TMS320C6000 CPU and instruction
set reference guide. Dallas. TX. 2000.

Fig. 9 Third experiment, High power broadband Gaussian noise

48

Você também pode gostar