Shop OBEX P1 Docs P2 Docs Learn Events
third order filter ? — Parallax Forums

third order filter ?

ArchiverArchiver Posts: 46,084
edited 2001-05-10 19:54 in General Discussion
Hi,

I am trying to monitor an analog signal
from a sensor that is very noisy.

I had found that there is a way to derive
an average of the inputs and get a useable
value.

it may even be possible to do this in hardware.

Does anybody know where I can get more information
on a method of getting a stable value from
a noisy signal ?

Dave

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-05-09 22:14
    Dave,

    Don Lancaster's Active Filter Cookbook is an excellent resource for quick
    filter designs. Simple R/C networks are effective in many cases, but they
    have limitations that active (Op-Amp) filters can eliminate.

    National Semiconductor, Linear Technology, Burr-Brown (now part of TI),
    Analog Devices, and others, sell filter chips that improve on Op-Amp
    filters in various ways, but they'll cost you more. Design software and
    application notes for these chips are often free at vendor web sites, and
    they do sometimes treat sensor signal conditioning issues. Analog Devices
    published a book titled "Transducer Interfacing Handbook, A Guide to Analog
    Signal Conditioning".

    >I am trying to monitor an analog signal
    >from a sensor that is very noisy.
    >
    >I had found that there is a way to derive
    >an average of the inputs and get a useable
    >value.
    >
    >it may even be possible to do this in hardware.
    >
    >Does anybody know where I can get more information
    >on a method of getting a stable value from
    >a noisy signal ?

    Mike Hardwick, for Decade Engineering -- <http://www.decadenet.com>
    Manufacturer of the famous BOB-II Serial Video Text Display Module!
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-10 16:40
    I know this is a bit delayed - but....

    A while back I had to input an inexpensive pyrometer at about a 10 mS rate
    into an analog input module on a micro PLC. The PLC manufacturer said it
    couldn't be done. The sensor was so noisy that it gave output all over the
    map, and the PLC actually followed it. I was pressed for time, so I made a
    simple filter by increasing the rate so as to allow more samples in the
    prescribed period, then simply discarding a number of the highest and lowest
    samples from the average. I appreciate that there are more professional
    methods, but this one worked quickly, and well. I seem to remember that I
    used the values derived on only the second attempt. One key was being able
    to visualize the data by displaying it in a simple excel graph (the PLC was
    used to store it). Although there was no pattern to the noise, I was able to
    determine what percentage of samples were good ones (close enough to the
    curve to not adversely affect performance with the given PID) do come up
    with simple numbers for averaging and discarding. Now I have the lowest cost
    system in my industry group that works as well as my competitors' at about
    20% of the cost. I recall doing something similar with a Stamp program for a
    temporary test circuit also.

    Chris

    >
    Original Message
    > From: Dave Mucha [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=KJx2cd-fWkBrj9Dxfdp7wJGPAUwV9YisGzc2GxyneA-333E95Pc2QA0Y1e3aIalInAjJH2Vzeg8MR20]davemucha@j...[/url
    > Sent: Wednesday, May 09, 2001 12:41 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] third order filter ?
    >
    >
    > Hi,
    >
    > I am trying to monitor an analog signal
    > from a sensor that is very noisy.
    >
    > I had found that there is a way to derive
    > an average of the inputs and get a useable
    > value.
    >
    > it may even be possible to do this in hardware.
    >
    > Does anybody know where I can get more information
    > on a method of getting a stable value from
    > a noisy signal ?
    >
    > Dave
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-10 16:57
    Thanks Chris,

    Good solutions are always worth listening to.

    Dave





    --- In basicstamps@y..., "Chris Loiacono (E-mail)" <chris01@t...>
    wrote:
    > I know this is a bit delayed - but....
    >
    > A while back I had to input an inexpensive pyrometer at about a 10
    mS rate
    > into an analog input module on a micro PLC. The PLC manufacturer
    said it
    > couldn't be done. The sensor was so noisy that it gave output all
    over the
    > map, and the PLC actually followed it. I was pressed for time, so I
    made a
    > simple filter by increasing the rate so as to allow more samples in
    the
    > prescribed period, then simply discarding a number of the highest
    and lowest
    > samples from the average. I appreciate that there are more
    professional
    > methods, but this one worked quickly, and well. I seem to remember
    that I
    > used the values derived on only the second attempt. One key was
    being able
    > to visualize the data by displaying it in a simple excel graph (the
    PLC was
    > used to store it). Although there was no pattern to the noise, I
    was able to
    > determine what percentage of samples were good ones (close enough
    to the
    > curve to not adversely affect performance with the given PID) do
    come up
    > with simple numbers for averaging and discarding. Now I have the
    lowest cost
    > system in my industry group that works as well as my competitors'
    at about
    > 20% of the cost. I recall doing something similar with a Stamp
    program for a
    > temporary test circuit also.
    >
    > Chris
    >
    > >
    Original Message
    > > From: Dave Mucha [noparse][[/noparse]mailto:davemucha@j...]
    > > Sent: Wednesday, May 09, 2001 12:41 PM
    > > To: basicstamps@y...
    > > Subject: [noparse][[/noparse]basicstamps] third order filter ?
    > >
    > >
    > > Hi,
    > >
    > > I am trying to monitor an analog signal
    > > from a sensor that is very noisy.
    > >
    > > I had found that there is a way to derive
    > > an average of the inputs and get a useable
    > > value.
    > >
    > > it may even be possible to do this in hardware.
    > >
    > > Does anybody know where I can get more information
    > > on a method of getting a stable value from
    > > a noisy signal ?
    > >
    > > Dave
    > >
    > >
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-10 17:39
    At 11:40 AM -0400 5/10/01, Chris Loiacono (E-mail) wrote:
    >... I made a
    >simple filter by increasing the rate so as to allow more samples in the
    >prescribed period, then simply discarding a number of the highest and lowest
    >samples from the average. I appreciate that there are more professional
    >methods, but this one worked quickly, and well. I seem to remember that I
    >used the values derived on only the second attempt. One key was being able
    >to visualize the data by displaying it in a simple excel graph (the PLC was
    >used to store it). Although there was no pattern to the noise, I was able to
    >determine what percentage of samples were good ones (close enough to the
    >curve to not adversely affect performance with the given PID) do come up
    >with simple numbers for averaging and discarding. Now I have the lowest cost
    >system in my industry group that works as well as my competitors' at about
    >20% of the cost. I recall doing something similar with a Stamp program for a
    >temporary test circuit also.

    I concur with Chris about the effectiveness of that kind of filter
    and think the analysis of the statistical distribution of the process
    is a really good way to go about constructing it.

    A "median filter" is one that stores up a certain number of samples
    in a table, adding new ones while discarding the oldest ones. At
    each step, the output of the filter is the median value in the table.
    That kind of filter is very robust against pop noise. It is often
    the first stage of digital filtering. The output of the median
    filter can then feed into an averaging or a lowpass filter, which is
    less resistant to pop noise.

    -- regards,
    Tracy Allen
    electronically monitored ecosystems
    mailto:tracy@e...
    http://www.emesystems.com
  • ArchiverArchiver Posts: 46,084
    edited 2001-05-10 19:54
    Averaging over N points is an effective method of low-pass filtering, known
    in the DSP world as a sliding box car filter. It has another useful
    feature. When you analyze its frequency response, it has a flat region
    extending to DC, but also several side lobes with deep notches at higher
    frequencies, as is usual with most LP filters. The useful part is that if
    you choose the sample rate and N correctly, you can position one of the deep
    notches close to 60 Hz, (or 50 Hz if you live in Europe), and have a very
    effective line frequency notch filter, without any added circuitry or
    software.

    I use this with PICS and Stamps, choosing N to be 16 for easy averaging
    without floating point calculations.

    Dennis O'Leary
    WSR Inc
    Pasadena CA

    Original Message
    From: Chris Loiacono [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=nM943wDmBhd6PAZiKMiVwPWq_X3_ZB8_Saia4qIJHGfQn84rPw9y7Z02tBJSJ_LoXZYFT8FR3AsN1A]chris@m...[/urlOn Behalf Of Chris
    Loiacono (E-mail)
    Sent: Thursday, May 10, 2001 8:40 AM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] third order filter ?


    I know this is a bit delayed - but....

    A while back I had to input an inexpensive pyrometer at about a 10 mS rate
    into an analog input module on a micro PLC. The PLC manufacturer said it
    couldn't be done. The sensor was so noisy that it gave output all over the
    map, and the PLC actually followed it. I was pressed for time, so I made a
    simple filter by increasing the rate so as to allow more samples in the
    prescribed period, then simply discarding a number of the highest and lowest
    samples from the average. I appreciate that there are more professional
    methods, but this one worked quickly, and well. I seem to remember that I
    used the values derived on only the second attempt. One key was being able
    to visualize the data by displaying it in a simple excel graph (the PLC was
    used to store it). Although there was no pattern to the noise, I was able to
    determine what percentage of samples were good ones (close enough to the
    curve to not adversely affect performance with the given PID) do come up
    with simple numbers for averaging and discarding. Now I have the lowest cost
    system in my industry group that works as well as my competitors' at about
    20% of the cost. I recall doing something similar with a Stamp program for a
    temporary test circuit also.

    Chris

    >
    Original Message
    > From: Dave Mucha [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=VluuvOgSKaVjzdyH1CWl2Sv24K06AEMd5E_HsRfxLl272QknOHVEbUTqTdgnqqNKemZLb4YyucU]davemucha@j...[/url
    > Sent: Wednesday, May 09, 2001 12:41 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] third order filter ?
    >
    >
    > Hi,
    >
    > I am trying to monitor an analog signal
    > from a sensor that is very noisy.
    >
    > I had found that there is a way to derive
    > an average of the inputs and get a useable
    > value.
    >
    > it may even be possible to do this in hardware.
    >
    > Does anybody know where I can get more information
    > on a method of getting a stable value from
    > a noisy signal ?
    >
    > Dave
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/





    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Sign In or Register to comment.