Design and Implementation of FPGA Based
Design and Implementation of FPGA Based
Abstract— Filtering data in real-time requires dedicated the input data are known to change with time. The “adaptive
hardware to meet demanding time requirements. If the statistics filter” can be defined as a system which is trying to adjust its
of the signals are not known, then adaptive filtering algorithms parameters so as to respond to some criteria with the aim of
can be implemented to estimate the signals statistics iteratively. meeting some well-defined goal or target which depends upon
Modern field programmable gate arrays (FPGAs) include the the state of the system as well as its surroundings. Adaptive
resources needed to design efficient filtering structures. The filter play an important role according to the following
present work deals with the design and implementation of FPGA properties: first, it can work effectively in unknown
based adaptive filter for echo cancellation. Here LMS algorithm, environment; second, it is used to track the input signal of
which is one of the most popular algorithms to adjust the filter time-varying characteristics.
coefficient of an adaptive filter, is used. A model based design
approach for the adaptive filter scheme is developed by using
MATLAB, SIMULINK and SYSTEM GENERATOR which
provides a virtual FPGA platform. The Filter is implemented The paper is organized as follows; in section –II
using ALTERA Cyclone II FPGA KIT and the complete design Background Theory is covered. Design approach using model
cycle of Verilog Modeling, Coding, Simulation, Synthesis, based design and simulation is described in section-III. System
Implementation; Testing on FPGA Target system is studied and Level Description is covered in section –IV. Section-V covers
practiced through the ADAPTIVE filter implementation. implementation of hardware and firmware, concluding remark
Simulation results of the conventional approach and model based and extending the scope of paper is given in section-VI
design approach are compared for verification purpose. followed by acknowledgement and references.
978-1-4799-3759-2/14/$31.00©2014 IEEE 1
International Conference on Convergence of Technology - 2014
or system parameters are slowly changing and the filter is to Where, w(n) are the present filter coefficients,
be adjusted to compensate for this change. Adaptive filters are w(n+1) are the future adaptive filter coefficients ,
widely used in digital communications, control, channel x(n) are the input values ,
equalisation, noise cancellation, echo cancellation, System e(n) is the error value,
identification, medical instrumentation, speech processing. µ is the step size.
The most commonly used algorithm to adapt the coefficients
is the LMS algorithm.
D. STABILITY OF LMS ALGORITHM
• The LMS algorithm is convergent in the mean square
if and only if the step-size parameter satisfy
2
0 < µ <
λ max
• Here λmax is the largest eigen value of the correlation
matrix of the input data.
• More practical test for stability is
2
0 < µ <
input signal power
]= ∑
M −1
Filter Output: y [n x [n − k ]w *
k [n ] …(1)
k = 0
978-1-4799-3759-2/14/$31.00©2014 IEEE 2
International Conference on Convergence of Technology - 2014
The top level block diagram shown in “fig. 3,” comprises Fig. 5. Observation of SIMULINK Model of Echo cancellation
of a sound source module that is any audio data (external
input) and the echo generation module is any environment In the above observation “fig. 5,” the first signal is the
where echo is generated e.g. can be a vacant room. Here the original audio signal, second one is the echoed signal, third
adaptive FIR filter output Y(K) is compared with the desired one is the adapted signal and the last one is the minimized
signal D(K) to yield an error signal E(K), which is fed back to error signal viewed on the scope of the Simulink model.
the adaptive LMS filter. The error signal is input to the
adaptive algorithm which generates the filter coefficients in a
manner which minimizes the error signal. These adaptive B. Model Based Designing Using System Generator
coefficients (Ca) are again used by the adaptive FIR filter to
minimize the echoed signal.
System Generator is a system-level modeling tool that
facilitates FPGA hardware design. It extends Simulink in
many ways to provide a modeling environment that is well
suited to hardware design. The tool provides high-level
abstractions that are automatically compiled into an FPGA at
the push of a button. The tool also provides access to
underlying FPGA resources through low-level abstractions,
allowing the construction of highly efficient FPGA designs. It
also provides code generation facility.
“Fig. 6” is the system generator model of adaptive echo
cancellation design. There are two main stages of this model,
they are echo generation module and echo cancellation. Here
the mux1 is used to generate the echo by adding the sine
signal and the sine half signal. Single order LMS algorithm
module is attached to the echo generation module where mux2
Fig. 4. SIMULINK Model for Adaptive Echo Cancellation is used to cancel out the echoed signal and display the desired
978-1-4799-3759-2/14/$31.00©2014 IEEE 3
International Conference on Convergence of Technology - 2014
signal. The step size of the LMS algorithm is variable and can In the system generator observation “fig. 7,” the x(k) is
be adjusted to minimize the error e(k) and to get more accurate the unknown signal, the d(k) is the desired signal. Expected
output y(k). The System Generator WaveScope block used in y(k) signal will be the desired signal d(k) and expected e(k) is
the model provides a powerful and easy-to-use waveform the minimized error signal viewed on the scope. The overlay1
viewer for analyzing and debugging System Generator shows both input x(k) & output y(K) in a single scope.The
designs. Here it allows observing the time-changing values of WaveScope block allows to observe the time-changing
single order LMS after the conclusion of the simulation. The coefficient value in analog format.
signals are viewed in analog format.
.
Fig. 8. The Test Setup on FPGA
978-1-4799-3759-2/14/$31.00©2014 IEEE 4
International Conference on Convergence of Technology - 2014
V. HARDWARE IMPLEMENTATION
978-1-4799-3759-2/14/$31.00©2014 IEEE 5
International Conference on Convergence of Technology - 2014
REFERENCES
TABLE I. FPGA HARDWARE RESOURCES UTILIZED
[1] Prof. Sashank Shekhar Pujari,Prangya Paramita Muduli,Amruta
RESOURCE USED AVAILABLE PERCENTAGE Panda,Rashmita Badhai,Sofia Nayak and Yougajyoty Sahoo;
Logic elements 888 33216 3% “Design & implementation of fir filters using on-board adc-dac &
fpga” ;ICICES, 2014; in press.
Combinational 816 33216 2% [2] Dr. Raaed Faleh Hassan,AliSubhiAbbood;“Design and
Functions implementation of fpga based adaptive filter”;IJES ,Volume2,
Dedicated Logic 404 33216 1% Issue 6 ,Pages74-80, 2013.
Registers [3] Diggikar, A.B. ; Ardhapurkar, S.S “Design and implementation of
adaptive filtering algorithm for noise cancellation in speech signal
Total Registers 404 on fpga”; ICCEET, 2012.
Total Pins 312 475 66% [4] Rafid Ahmed Khalil; “Adaptive Filter Application in Echo
Embedded 14 17 20% Cancellation System and Implementation using FPGA”; Al-
Multiplier 9-bit Rafidain Engineering ,Vol.16 No.5 Dec. 2008.
elements [5] S. S. Godbole1, P. M. Palsodkar2 and V.P. Raut; “FPGA
Implementation of Adaptive LMS Filter”; Proceedings of SPIT-
Total PLLs 1 4 25% IEEE Colloquium and International Conference, Mumbai, India;
Vol. 2,2 2 6.
[6] C. Stanciu, C. Anghel, C. Paleologu, J. Benesty, F. Albu, and
VII. CONCLUSION AND FUTURE SCOPE S.Ciochina, “FPGA implementation of an efficient proportionate
affine projection algorithm for echo cancellation”, in Proc. 19th
The project is developed with the help of different tools Eur. Signal Process. Conf. (EUSIPCO), Barcelona, Spain, Aug.
and software such as MATLAB, SIMULINK, SYSTEM 29–Sep. 2, 2011,pp. 1284–1288.
GENERATOR and ALTERA QUARTUS-II. The adaptive [7] Bahoura,M; Dept. of Eng., Univ. of Quebec at Rimouski,
echo cancellation system is successfully developed with the Rimouski, QC, Canada ; Ezzaidi, H; “FPGA-implementation of a
LMS algorithm and the system is capable of cancelling echo. sequential adaptive noise canceller using Xilinx System Generator
“; 19-22 Dec. 2009.
The model based design approach is successful for canceling
[8] Juan J. Rodriguez-Andina, Senior Member, IEEE, Maria J. Moure,
the echo of any external audio signal. And finally the single Member, IEEE, and Maria D. Valdes, Member, IEEE; Features,
order adaptive filter Echo Cancellation system is successfully “Design Tools, and Application Domains of FPGAs”; ieee
implemented on ATERA Cyclone II and the experimental transactions on industrial electronics, vol. 54, no. 4, august 2007.
result satisfied the objective of the project. [9] U. Maser, L. Banbse, "Digital Signal Processing with Field
Programmable Gate Arrays",International Signal Processing
Conference, March 28, 2006, Dallas Texas
A method to expand the project would be to use an actual [10] A. H. Sayed, Fundamentals of Adaptive Filtering. Hoboken,
system with real echoes. A microphone and speaker with a NJ,USA: Wiley, 2003.
box in between them could be used to create the echoes. The [11] S. L. Gay and J. Benesty, “Acoustic Signal Processing for
scope of the project can further be extended by increasing the Telecommunication.” Boston, MA, USA: Kluwer Academic, 2000.
order of the filter for better result; also the system can be [12] morris, lu,"adaptive echo cancellation", ieee signal processing
implemented on XILINX platform with different algorithms. magazine,march 1999.
[13] Simon Haykin, Adaptive Filter Theory, Prentice-Hall, Inc.,1996
[14] Windrow, B., and Stearns, S. D., Adaptive Signal Processing,
ACKNOWLEDGMENT Prentice Hall, 1985.
[15] Math Work Help Documentation.
Authors wish to thank Multidisciplinary Research Cell
[16] DE2 User manual.
S‘O’A university for providing advance lab facility. Without
[17] Audio Codec W8731 datasheet.
proper guidance at this lab this project could not have been
completed. Authors indebted to SUIIT, Sambalpur University
for the support in providing development tools and kits.
978-1-4799-3759-2/14/$31.00©2014 IEEE 6