Re: Filtering bad output from comedi...

Hello,

I think you need to check the hardware first.

If you have an oscilloscope, find out what makes the noise (I guess 50 Hz might 
be the biggest culprit).

If you find a lot of noise in the raw measurement signal, next thing is to see 
whether your equipment is grounded and shielded properly (Web will have a lot of 
info about this topic).

If the noise level remains to be too high (p-p is more than your minimum 
tolerable error), you'll do analog low-pass filtering. See that the output is 
cut very low at half of your sampling rate, so that you don't get any 
significant aliasing.

As you measure temperature, I guess you have a slowly varying signal. You could 
just put a simple RC-filter:

     _____
---|  R  |--o----O A/D -converter      F(3 dB) = 1/(2*pi*R*C),
     -----   |                           drop is about 6 dB per octave.
            === C
             |
	   Gnd

with 3 dB cutoff at say 0.5 Hz and sampling rate say 10 Hz. Then you could 
digitally low-pass filter the signal to be able to get the final data at a lower 
rate.

Active filters are of course more efficient.

If there is a danger of sudden transient-like spikes, it's helpful to do a 
3-point median filtering.


Eric Hudson wrote:

> Hello all,
> 
> I have included a link below to my code with output that accepts constant 10mV
> input. The problem I am having as you shall see from the output is bad values.
> What can I do to fix this problem? I'm trying to make my program as accurate
> as possible.
> 
> http://www.rafb.net/paste/results/S1qqEN74.html
> 
> 
> Thanks,
> 
> Eric
> 
> _______________________________________________
> comedi mailing list
> comedi_at_comedi.org
> https://cvs.comedi.org/cgi-bin/mailman/listinfo/comedi


Regards,

-- Tuomas
--------------------------------------------------------------
Tuomas Räsänen               tuomas.rasanen_at_ssf.fi
Space Systems Finland        +358 9 613 28654
Kappelitie 6, 02200 Espoo    mobile: 050 330 1758

Received on 2005-03-16Z16:50:12