discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] curve fitting data points


From: cswiger
Subject: [Discuss-gnuradio] curve fitting data points
Date: Thu, 22 Dec 2005 21:48:29 -0500 (EST)

This is for the mathematicians out there - what is a simple
working algorithm for creating a function model to fit an
arbitrary number of data points. What I have for a first
approximation, simple linear (y=mx+b) actually works better
than nothing, but there's room for improvement.

I set one frequency input X1=3.9e6 and an arbitrary antenna control
output Y1=1800 and adjust the physical antenna for peak signal.
Then I change the frequency to X2=4e6 and adjust the antenna
output for peak signal, which happens to be Y2=1580. From there
you can get the slope m=(Y2-Y1)/(X2-X1) and the y intercept
b  = Y1 - m * X1.   After that calibration the antenna tune
output is m * freq + b, works fine.   Change the frequency and
the antenna peak tracks ok, especially near the two calibration
points, but going very far out or if the points are too far
apart noticible error creeps in.

What is a method similar to that for 3 points? or n points?
I want to collect (x1, y1), (x2, y2), (x3, y3)  then use
a simple python formula to get a workable y for any given x.

Thanks

--Chuck





reply via email to

[Prev in Thread] Current Thread [Next in Thread]