Product Overview

Table Of Contents
FlexStat (General) 11 Application Guide, Rev S
Infinite Impulse Response (IIR) Filter
The second stage in ltering calculates how quickly to respond to tem-
perature changes. This stage is technically a rst-order IIR, which is used
as a low-pass lter. It calculates the new value based on the old input
value plus the current input value, with the old value and the current
value each being multiplied by a dierent weight factor.
Unlike the median lter, the IIR lter does not have a “window.” Rather,
a weighted factor determines how much the current input will aect the
lter’s output. For the FlexStat, this factor is selectable between eight dif-
ferent values, ranging from 0.78 to 100.0%:
Filter Weight
Selected Value Factor (a) Percentage
0 1 100
1 1/2 50
2 1/4 25
3 1/8 12
4 1/16 6.25
5 1/32 3.125
6 (Default) 1/64 1.5625
7 1/128 0.78125
The Filter Weight factor uses the equation:
y
n
= (1–a)y
n–1
+ ax
n
Where:
x
n
is the current sample from the median lter, which is the
input to the IIR lter
y
n
is the current output of the IIR lter
y
n-1
is the previous output of the IIR lter
a is the Filter Weight factor from the table (the Filter Weight’s
default selected value is 6, or a factor of 1/64, or
1.5625%)
In this example, the ve-sample buer already has ve samples. The
ADC sees a 2.17 V signal, and converts this to a digital value of 47403
(due to the 16-bit A/D conversion and the 3.0 VDC reference in the Flex-
Stat). The oldest of the ve samples (47040) is dropped out the boom,
and the new sample is placed on top of the buer. After a low-to-high
sort, the value 47241 is found in the middle, and the median lter output
is then 47241. (This value of 47241 happened to be the oldest of the ve
current samples in this case.)
Then a new sample is read and digitized by the ADC (47342, for exam-
ple). Since 47241 was the oldest value, it drops out and 47342 is placed
on the top. When the sort is done again, a new median value is selected
(which happens to be 47342 in this case).
The median lter uses a “sliding window in time.” The FlexStat’s ve-
sample window represents 1250 milliseconds in time. One end of the
window is always the current time, and the window “slides” to keep
up with the current time. A sample that is older than 1250 milliseconds,
slides outside of the window and is forgoen.
ADCInput Pin
2.17 V
47403
47023
47403
47549
47137
47241
47023
47137
47241
47403
47549
47023
47549
47137
47241
47040
Get Sample
Newest
Oldest
Sort
Pick
Median
47241
Value to IIR
Median Filter Process