1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: aiRecord conversion |
From: | Eric Norum <[email protected]> |
To: | Bruno Seiva Martins <[email protected]> |
Cc: | "[email protected] Talk" <[email protected]> |
Date: | Tue, 28 Aug 2012 10:08:35 -0700 |
On Aug 28, 2012, at 9:42 AM, Bruno Seiva Martins <[email protected]> wrote:
special_linconv(precord,after) This routine is called whenever any of the fields LINR, EGUF, EGUL or ROFF is modified. To support linear conversion, EOFF and ESLO must be set accordingly. The record support sets EOFF to EGUL before calling this routine, which is the very common case when RAWL is zero below. A useful formula for calculating EOFF and ESLO is this one: EOFF = (RAWF * EGUL - RAWL * EGUF) / (RAWF - RAWL) ESLO = (EGUF - EGUL) / (RAWF - RAWL) Here, RAWL and RAWF are the lowest resp. highest possible raw value. For instance, a 16 bit bipolar ADC might have RAWL=-0x7fff, RAWF=0x7fff. |