Implementation on FPGA for Tuned Low Complexity
Modified Curve Fitting Algorithm
Brajesh Gupta
Electronics and communication. L.N.C.T, Bhopal
Monika Kapoor
Electronics and communication.
L.N.C.T, Bhopal
Abstract— An effort is made to minimize the arithmetic intricacy of signal by using the VHDL module on FPGA. A curve fitting algorithm is used for finding the fundamental frequency of a given signal. Modification of algorithm is reducing the arithmetic complex-city become extinct the cubic solution. This is mature a fast approach for the signal processing and reduced the resultant error .This is made a comparison between basic CFA and modified CFA. Result of this to find out a best fit of a curve .A modified curve fitting algorithm is used for finding the optimum signal quality parameter for further application of signal processing.
Keywords—fundamental Frequency, VHDL CFA.
etc.
I. INTRODUCTION
The key goal of this study and work is to implement a system in VHDL module for drawing out frequency of signal. This frequency use to evaluate different signal properties. The CFA is processed for measuring the frequency and short out the variation of a demanding signal of required function, in electrical and electronic environment.
This algorithm estimate a frequency which is widely used to examine closely because of their transervarsal presentation .Different fracas detection algorithms are based on fundamental frequency of a signal[1].
The CFA permits a small number of samples of a signal comparison then other like CFA with STFT, Kalman, Sine fitting. Due to few samples it takes less computational time with a conventional accurateness [1, 2].
CFA allowed extract the quality parameter of signal like harmonic for phase of a fixed length (0, T) window. It is evident the hole system accuracy is link to fundamental frequency evaluation of window(0,T) ,another block are in system use that information to process the sample to evaluate quality parameter [1,2,3].The study and realization of this type of algorithm is basically implemented with FPGA. The superior programmable circuit with enhance quality and higher integration density, is made better choice of implementation on FPGA. Development of custom design, in different level, with
the headwear description language like very high speed integrated circuit language (VHDL), Verilog [4].
FPGA programming was done in VHDL code .to generate .VHDL code use the System Generator of Xilinx ISE 13.1 environment.
II. CURVE FITTING ALGORITHEM
Wherever the curve fitting is specified, to drive mathematical equation of curve is define for data set. This process to select best fit of a curve that approximates a same data set. It show relationship between two variables may exist [5].CFA as regression analysis, to determine the ‘best fit’ curve or line for data sets [3].
Curve fitting find the best fit of a curve to a waveform to get error performance .This is then calculate the samples residual values between the fitted curve and the waveform. The sum of their square values decides the size of residuals. It reduced to calculate least square error, and the phase and amplitude of fitted curve obtain [2].
Curve fitting algorithm is realized for a parametric equation contains shaping parameters to adjust the shape of fitted curve. This flexibility of curve fitting is accepted to produce a curve which is capable of following any set of sampled data points. A modified parametric equation is developed to modify curve allows control over shape of fitted curve by introducing shaping parameter. As a curve fitting method, it can be used on any discrete set of data points to produce a highly accurate shape curve .Curve fitting also used in modeling in complex surface geometry in engineering application. This curve is help in modeling like computer graphics, data structure modeling,
and orthogonal distance fitting, computer aided
geometry[6][7][8].
The effort is made to modified curve fitting algorithm .That is to accurate compare basic algorithm.
III. BASICCURVE-FITTINGALGORITHEM
(CFA)
sample of a given frequency. Define an error function by which is sum of the square of the difference of many samples. The fundamental frequency is found minimize the error function.
As mention in [2] basic CFA algorithm allows find out the difference between
from the ideal signal frequency, following equation:0
3 2
( ) ( ) ( )
3 2 1
a a a a
Where we put the values,
2 2
0
( ) cos
)
(
0( ) sin
)
T T
Num
m t
tdt
m t
tdt
0
( ) cos
) (
0( ) sin
)
T T
Den
m t t
tdt
m t
tdt
-0 0
(
Tm t t
( ) sin
tdt
)
Tm t
( ) cos
tdt
)
The values of “a” (coefficient’s) using Taylor series stopped at the second power are:
0
2
a
Den
Num
1
2
2
Den
Num
a
Den
2 2
2 2 2
1
2
2
Den
Den
Den
a
2 3 2Den
a
Find ∆
we solve a third order equation, and used Girolamo Cadiano method in different case determined by the discriminator (∆) sign [9,10].The discriminator is defined as:2 2
2
2
p
q
Where 23
3
b
a
p
3
2
9
27
27
a
ab
c
q
Case I: for (∆ < 0) we solve:
1 3
1
2
cos
3
3
a
x
r
1 3 24
2
cos
3
3
a
x
r
1 3 32
2
cos
3
3
a
x
r
We get three real roots.
Where real part are magnitude and phase of the complex number.
(
)
2
q
R
i
While case II for (∆ ≥ 0)
3 3
1
2
2
3
q
q
a
x
3 3 3 3
2 1
2 2 2 2 2 3
q q q q a
x i
3 3 3 3
3 1
2 2 2 2 2 3
q q q q a
x i
We suppose that ∆
is reasonably small in magnitude so we take as possible the solution smallest magnitude so take the solution with the smallest magnitude.Compared with the other method for frequency evaluation (as seen in algorithm [1]).modified CFA algorithm gives a reliable precision with smaller evaluation times we see in the next table:
TABLE I. ALGORITHEM COMPEARATION
Actual freq.
Meas. By CFA
Meas. By mod.
CFA Error by CFA
Error by mod. CFA
49 49.22379342 48.998641 -0.223793424 0.001358998
49.1 49.28567097 49.09858625 -0.18567097 0.001413748 49.2 49.35032923 49.1986105 -0.150329229 0.001389502
49.3 49.41798611 49.29870011 -0.117986113 0.001299894 49.4 49.48888354 49.39884145 -0.088883536 0.001158553 49.5 49.56329112 49.4990209 -0.063291119 0.000979101 49.6 49.64151066 49.59922485 -0.04151066 0.000775147 49.7 49.72388159 49.69943972 -0.023881588 0.000560284 49.8 49.81078766 49.79965192 -0.010787664 0.000348083 49.9 49.90266533 49.89984791 -0.002665326 0.000152091 50 50.00001419 50.00001417 -1.41884E-05 -1.41711E-05 50.1 50.10341046 50.10013722 -0.003410461 -0.000137218 50.2 50.21352435 50.2002036 -0.013524346 -0.000203601 50.3 50.33114302 50.30019991 -0.031143024 -0.00019991 50.4 50.45720165 50.40011278 -0.057201646 -0.00011278 50.5 50.59282614 50.4999289 -0.092826143 7.11034E-05 50.6 50.73939405 50.599635 -0.139394054 0.000365005 50.7 50.89862391 50.69921787 -0.198623911 0.000782131 50.8 51.07271204 50.79866437 -0.272712041 0.00133563 50.9 51.26455268 50.89796142 -0.364552681 0.002038585 51 51.47811524 50.99709599 -0.47811524 0.00290401
In table 1.1the comparison was made for CFA and modified CFA without noise. And again the newly compared between two different signals SNR20 and SNR10.
Actual freq.
Meas. By CFA
Meas. By mod.
CFA Error by CFA Error by mod. CFA
49 49.22046 48.99669 -0.22046 0.003314 49.1 49.28301 49.09496 -0.18301 0.005037 49.2 49.26373 49.07147 -0.06373 0.128529 49.3 49.49645 49.39473 -0.19645 -0.09473 49.4 49.57686 49.51468 -0.17686 -0.11468 49.5 49.59851 49.54185 -0.09851 -0.04185 49.6 49.63216 49.58852 -0.03216 0.011481 49.7 49.70713 49.68179 -0.00713 0.018214 49.8 49.83615 49.82769 -0.03615 -0.02769 49.9 49.87547 49.87202 0.024531 0.027983 50 50.00899 50.00898 -0.00899 -0.00898 50.1 50.10916 50.10569 -0.00916 -0.00569 50.2 50.27709 50.25571 -0.07709 -0.05571 50.3 50.34182 50.30899 -0.04182 -0.00899 50.4 50.5036 50.43429 -0.1036 -0.03429 50.5 50.64709 50.54046 -0.14709 -0.04046 50.6 50.59141 50.49236 0.008587 0.107635 50.7 50.82951 50.65228 -0.12951 0.047723 50.8 50.98683 50.74868 -0.18683 0.051316 50.9 51.31151 50.91367 -0.41151 -0.01367 51 51.63235 51.07324 -0.63235 -0.07324
Table1.2 result with 20 SNR
Table1.3 result with SNR10
[image:3.595.316.531.218.331.2]This comparison shows that CFA accuracy is compared with modified CFA and show less computational time and robustness to noise. The signal used test the algorithm 50Hz Sinusoid sampled at 128 kHz.
Figure 1. Basic blocks for algorithm (CFA) development.
Because of enormous workload we evaluate the algorithm to find a means to simplify it we found the real block is solving
complete Cardano method and put allowed the selection of correct processing branch, after that to select the solution. The algorithm test with the Matlab for frequency range from 49Hz to 51Hz and phase, found that DELTA was always negative, and ∆
was always found using ‘x2’expression we beforegave in different cases[1].
IV. MODIFIEDCURVE-FITTINGALGORITHEM
Figure 2. Blocks for modified algorithm (CFA) development.
In modified curve fitting algorithm we have completely disappear the difficult operation like cube roots in different case.
This modification in algorithm for best fit of a curve is made by the fallowing equation:
f(x)= ax
This equation is allowed to fast operation with considerable goodness of fit a curve and reduces error performance for signal for predefined frequency.
V. IMPLEMENTATIONOFTHECFAONFPGA.
The generation of VHDL programming for implementation of CFA on FPGA following flow is shown in figure 4. After design a block diagram in Simulink and the HDL code generator used to generate VHDL code. This code is complete code for all subsystem in cfa design.
This procedures Simulink build the basic algorithm structure and generate HDL code after then Xilinx ISE 13.1 map the code to FPGA resources a balanced area and speed, finely testing on fpga gives feedback for additive tunings [1].
Actual
freq. Meas. By CFA Meas. By mod. CFA Error by CFA
Error by mod. CFA
Figure 3. RTL view for algorithm (CFA) development.
Figure 4. Flow of VHDL code generation for algorithm (CFA) Development
VI. SIMULATION RESULT
Figure 5. output waveforn view for algorithm (CFA) .
VII. CONCLUTION
In this paper, we proposed the simple and powerful curve fitting algorithms by using iterative error minimization .To define the error between the input curve and the synthesized curve, tune for low complexity. The modified curve fitting algorithm give an appreciable result of error minimization .Curve fitting algorithm calculate less number of sample comparison then other algorithm and saving much computational time with acceptable level of accuracy. The first experimental result obtain in a
measure bench confirm the accurateness of the
implementation. The CFA permit to fast development on FPGA and further processing for ASIC technology.
REFERENCES
[1] M. Caciotta, S. Giarnetti, F. Leccese, E. Pedruzzi “Curve Fitting Algorithm FPGA implementation” 978-1-4244-8782-0/11/$26.00 ©2011 IEEE
[2] M Caciotta, F. Lecense ,T Trifirò: “Curve Fitting Algotithm (CFA) AsPower Quality Basic Algorithm”presented to XVIII IMEKO WORLDCONGRESS, Metrology for a Sustainable Development September, 17– 22, 2006, Rio de Janeiro, Brazil, CD-proceedings. [3] F. Leccese, S. Sangiovanni:, “Study and realization of an
instrumentFPGA based to implement Curve-Fitting Algorithm (CFA),”presented toInternational Telecommunications Energy Conference INTELEC 2007,September 30 – October 4 2007, Rome, Italy, Proceedings pp. 909-913,ISBN: 978-1-4244-1628-8, IEEE Catalog Number: CFP07INTC,Library of Congress: 88-656128
[4] J. Viejo, M.J. Bellido, A. Millan, E. Ostua, J. Juan, P. Ruiz-e-Clavijo,D. Guerrero, “Efficient Design and Implementation on FPGA of aMicroBlaze Peripheral for Processing Direct Electrical Networks Measurements”, Industrial Embedded Systems, 2006. IES '06.International Symposium on, Antibes Juan-Les-Pins, France. [5] B V Ramana, “Higher Engineering mathemathics” Tata McGraw Hill
[image:4.595.58.274.87.477.2][6] Mohammad Asif Zaman,Shuvro Chowdhury,“Modified Be´zier Curves with Shape-Preserving Characteristics using Differential Evolution Optimization Algorithm”Manuscript Submitted to Journal: Advances in Numerical Analysis, Date of Submission: 27th October, 2012.
[7] SOO-CHANG PEI, JI-HWEI HORNG, “OPTIMUM APPROXIMATION OF DIGITAL PLANARCURVES USING CIRCULAR ARCS” Pattern Recognition, Vol. 29, No. 3, pp. 383-388, 1996 ,Elsevier Science Ltd. Copyright © 1996 Pattern Recognition Society.Printed in Great Britain. All rights reserved .0031-3203/96 $15.00+.00.
[8] Yang Liu ,Wenping Wang, “A Revisit toLeast Squares Orthogonal Distance Fitting of Parametric Curves and Surfaces,”[F. Chen and B. Juttler (Eds.): GMP 2008, LNCS 4975, pp. 384–397, 2008.© Springer-Verlag Berlin Heidelberg 2008.
..[[[[-[9] Thomas J. Osler,“AN EASY LOOK AT THE CUBIC FORMULA”,Mathematics Department,Rowan University,
Glassboro NJ 08028.
[10] Osler, Thomas J., . Cardan polynomials and the reduction of radicals, MathematicsMagazine, Vol 47, No. 1, (2001), pp. 26-32.
[11] Stephen Brown and Jonathan Rose,“Architecture of FPGAs and CPLDs: A TutorialStephen Brown and Jonathan Rose”
[12] PhilipH.W.Leong,,IvanK.H.Leung , “ A Microcoded Elliptic Curve ProcessorUsing FPGA Technology” IEEE TRANSACTIONS ON VERY LARGE SCALE INTEGRATION (VLSI) SYSTEMS, VOL. 10, NO. 5, OCTOBER 2002
[13] Kuon, R. Tessier and J. Rose “ FPGA Architecture:survey and Challenges”, Foundations and Trends! ®in Electronic Design Automation Vol. 2, No. 2 (2007) 135–253 ©2008
[14] Lanping Deng, Kanwaldeep Sobti, Yuanrui Zhang∗, Chaitali Chakrabarti “ACCURATE AREA, TIME AND POWER MODELS FOR FPGA- BASED IMPLEMENTATIONS†”This paper is an extension of the ICASSP’08 paper “Accurate Models for Estimating Area and Power of FPGA Implementations”.
[15 By the staff of Berkeley Design Technology, Inc.] “An Independent Analysis of Altera’s FPGA Floating-point DSP Design Flow”, © 2011 Berkeley Design Technology, Inc
[16] M. A. Farahat1, M. Talaat1,2,* “ Short-Term Load Forecasting Using Curve Fitting Prediction Optimized by Genetic Algorithms”, International Journal of Energy Engineering 2012, 2(2): 23-28
DOI: 10.5923/j.ijee.20120202.04.
[17] Deming Chen, Jason Cong, Peichen Pan “ FPGA Design Automation: A Survey”. Foundations and Trends® in Electronic Design Automation ©Vol. 1, No 3 (November 2006) 195–330, November 2006 DOI: 10.1561/1000000003