| ??? 08/13/02 09:08 Read: times |
#27163 - RE: Just had a job interview.... |
Hi Gil,
average means, you add e.g. 16 samples of your ADC and divide it by the sample count (e.g. 16). moving average do this always on the last e.g. 16 samples in this way, that the new sample was added and the 16 times old sample was subtracted. Thus you need to store all 16 samples separate. So a modificationwas was done often in this way, that the average itself was subtracted and then the new sample was added. so you must only save the sum of all samples. This give also a more clean reading of the ADC, but the characteristic was slightly different. Following the example code: adc_input[channel] -= adc_input[channel] / SAMPLE_COUNT
- (((uint)ADDH << 2) | (ADDL & 0x03));
But I know also not, where a MOVC was involved on such calculations. Peter |



