This commit is contained in:
2026-03-20 21:16:58 +08:00
parent 286ff98b8e
commit 90c3d919df
248 changed files with 94554 additions and 0 deletions

21
user/Utility/filter.h Executable file
View File

@@ -0,0 +1,21 @@
#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