/*
 * filter.h
 *
 *  Created on: May 15, 2025
 *      Author: 911BL
 */

#ifndef SRC_MIDDLEWARE_FILTER_H_
#define SRC_MIDDLEWARE_FILTER_H_


#include <stdint.h>

//#define FILTER_SIZE 1 	// No filtering
#define FILTER_SIZE 20

typedef struct
{
	int16_t buffer[FILTER_SIZE];
	uint8_t index;

} filter_info;

void init_filter(filter_info* f);

int16_t filter_apply(filter_info* f, int16_t new_sample);

#endif /* SRC_MIDDLEWARE_FILTER_H_ */
