??? 10/22/07 17:07 Read: times |
#146013 - The nitty gritty stuff Responding to: ???'s previous message |
Christoph Franck said:
So the difference equation that approximates the differential equation is: y(n+1) = (1 - a) * y(n) + a * x(n) What is 'a' or in Steve's case 'k'?, clearly if a=1 then your first term vanishes, if a =0 then your last term vanishes?? How would I adjust sample time and integration time?, using your equation? I assume 'x' is your input raw value? 'y(n)' is previous pass modified sample? 'y(n+1) is current pass modified sample? Christoph Franck said:
which is basically the equation you'll find in Steve's or my earlier posts. But this still won't help you if you want to stabilize the last digit after just one measurement, since this filter, like any other, has a certain settling time. I have a continious stream of samples which need to pass through a CR low pass filter, as I've already said the transformation from analogue to digital is one of differentiation, the MCU works in differential states, i.e., zero and one or 0V and 5V which is why the ADC's output LSB's flutter. DAC's on the otherhand are integrators which is why they have stable outputs, as far as signal is concerned. Okay, my first order cr equation looks like this: E=Vc+cr.dVc/dt....charging E=Vc-cr.dVc/dt....discharging Vc is the voltage across the capacitor, the output E is the input voltage, typically raw ADC value cr is the cr integration time. I'll leave it there for now. Cheers Jason |