Implementing digital filter for removing noise

Discussion in 'Embedded Systems and Microcontrollers' started by embedded.world, Feb 27, 2014.

  1. embedded.world

    Thread Starter Member

    Feb 27, 2014
    36
    0
    I am sampling analog channel which measure voltage across resistance by passing constant dc current across it.

    Now I have 250 samples at one time.

    Now I want to apply filter to remove/minimize noise as much as I can.

    Now I am taking average for all the sample which makes a simple low pass filter.

    How to make use of filter so that I can remove most of noise or 50Hz noise in it as circuit is powered from main.

    I want to learn which filter will be best here FIR/IIR.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    Taking 250 samples is one thing. You also need to specify your sampling rate or the sampling period or the total sampling duration.

    Take as many samples as you wish at whatever rate but make sure that the total sampling time is a multiple of 20ms.

    Then take the average.
     
  3. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    One thing is sample-rate. But another thing is how often you need to update your measurement results. It would help if you told us more about your measurement setup. How many bits, sample-rate, which AD converter and so on.
     
  4. embedded.world

    Thread Starter Member

    Feb 27, 2014
    36
    0
    I am using Ads1248 for it. Data rate settings in ads1248 2ksps.
    I have 7 channels used. in 1.5 sec I take 250 samples of each channel.
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    Your sampling rate is 2ksps. Sampling period is 0.5ms.
    Total sampling time is 250 x 0.5ms = 125ms

    x7 channels = 875 ms

    How did you get 1.5s?

    At sampling period of 0.5ms you want 40 samples per channel or multiples of 40 samples per channel.
     
  6. embedded.world

    Thread Starter Member

    Feb 27, 2014
    36
    0
    1,5 sec takes as as I do some other activities also in mean time.
     
Loading...