Add FIR filter code

This commit is contained in:
2021-08-19 21:44:50 +02:00
parent ffb544e21d
commit e3670434ca
2 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
/* Reflow Oven Controller
*
* Copyright (C) 2021 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of the Reflow Oven Controller Project.
*
* The reflow oven controller is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* The Reflow Oven Control Firmware is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the reflow oven controller project.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __FIR_FILTER_H__
#define __FIR_FILTER_H__
#include <stdint.h>
struct fir_filter_fixed {
uint32_t tap_count;
const int32_t *coefficients;
int32_t *data;
uint32_t put_idx;
};
void fir_filter_init_null(struct fir_filter_fixed *filter);
int32_t fir_filter_process_sample(struct fir_filter_fixed *filter, int32_t sample);
#endif /* __FIR_FILTER_H__ */