From PICLIST@MITVMA.MIT.EDU Fri Nov 15 15:17:11 2002 Received: from cherry.ease.lsoft.com [209.119.0.109] by dpmail10.doteasy.com with ESMTP (SMTPD32-7.13) id A0771009006C; Fri, 15 Nov 2002 15:17:11 -0800 Received: from PEAR.EASE.LSOFT.COM (209.119.0.19) by cherry.ease.lsoft.com (LSMTP for Digital Unix v1.1b) with SMTP id <19.007DDECD@cherry.ease.lsoft.com>; Fri, 15 Nov 2002 18:03:02 -0500 Received: from MITVMA.MIT.EDU by MITVMA.MIT.EDU (LISTSERV-TCP/IP release 1.8d) with spool id 0143 for PICLIST@MITVMA.MIT.EDU; Fri, 15 Nov 2002 17:41:27 -0500 Received: from MITVMA (NJE origin SMTP@MITVMA) by MITVMA.MIT.EDU (LMail V1.2d/1.8d) with BSMTP id 2770; Fri, 15 Nov 2002 17:40:45 -0500 Received: from kona.reonbroadband.com [66.51.65.3] by mitvma.mit.edu (IBM VM SMTP Level 320) via TCP with ESMTP ; Fri, 15 Nov 2002 17:40:44 EST X-Comment: mitvma.mit.edu: Mail was sent by kona.reonbroadband.com Received: from mail.embedinc.com (86-66-51-66.reonbroadband.com [66.51.66.86]) by kona.reonbroadband.com (8.9.3/8.8.7) with SMTP id RAA00560 for ; Fri, 15 Nov 2002 17:40:52 -0500 Received: from 192.168.0.3 (main) by mail.embedinc.com ; 2002 NOV 15 17:39:12 EST References: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <001301c28cf8$1cab94a0$0300a8c0@main> Date: Fri, 15 Nov 2002 17:41:17 -0500 Reply-To: pic microcontroller discussion list Sender: pic microcontroller discussion list From: Olin Lathrop Subject: Re: [EE]:Pressure sensor confusion To: PICLIST@MITVMA.MIT.EDU X-RCPT-TO: Status: R X-UIDL: 277600745 X-Evolution-Source: pop://mailinglist%40farcite.net@mail.farcite.net/ X-Evolution: 000007ae-0000 > A typical problem for me is interpolating thermistor data. The thermistor > curve comes in chart form from the manufacturer, in very un-handy > increments. It's quite a complex curve, and I think curve fitting it > would be a long involved task (unless Excel does this automatically > somehow? ) Linear curve fitting would be a cinch. The only way I know > how to curve fit a nonlinear is, guess at the type of equation to use, > plot it next to your data, sum the squares of the differences, then run a > linear regression on the results and use a Tools:GoalSeek on the results > to approach the minimum, then guess again at the type of equation to use > until you like the fit.. It is a time-consuming process, usually. > > Is there a more efficient way? I've seen software tools that take a series of points and automatically compute the coeficients for an Nth order polynomial, where you specify N. Most real world "smooth" functions can be modeled well enough with a 3rd or 4th order polynomial, which are relatively easy to compute. This approach is particularly useful if the sample points contain some noise. The polynomial will do sortof an average fit thru the noise. Alternatively, you can use a lookup table. This is fast, and handy if the data comes that way in the first place and each individual point is known to be accurate (no noise). Depending on the density of the lookup points and the required accuracy, you can pick nearest, linearly interpolate, or cubically interpolate. Other interpolation schemes are of course possible, but I've never needed to go higher than cubic yet. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.