Files
CHJ/user/Utility/filter.h

22 lines
681 B
C
Raw Permalink Normal View History

2026-03-20 21:16:58 +08:00
#ifndef __filter_h__
#define __filter_h__
// filter specifications: removing largest and smallest samples
#define FILTER_SIZE 2 // size of digital filter
#define FILTER_SHIFT 1
#define FILTER_END (FILTER_SIZE+1)
#define FILTER_ANX (FILTER_SIZE+2)
// DELTA filter
#define DELTA_FILTER_SIZE 4 // size of digital filter
#define DELTA_FILTER_SHIFT 2
#define DELTA_FILTER_END (DELTA_FILTER_SIZE-1)
#define DELTA_TIME_ANX (DELTA_FILTER_SIZE+1)
extern u16 SAMPLES[][FILTER_ANX];
u16 ReadDataFromMovingAverage(u16 channel);
u16 MovingAverage(u16 voltageBuffer, u16 updateScale, u16 channel);
#endif