21 lines
505 B
C
21 lines
505 B
C
#pragma once
|
|
|
|
#ifndef BIQUAD_H
|
|
#define BIQUAD_H
|
|
|
|
typedef struct
|
|
{
|
|
// Коэффициенты фильтра
|
|
float a1, a2;
|
|
float b0, b1, b2;
|
|
|
|
float x1, x2; // Предыдущие входы
|
|
float y1, y2; // Предыдущие выходы
|
|
} BiquadFilter;
|
|
|
|
void lpf2p_init(BiquadFilter *filter, float sample_freq, float cutoff_freq);
|
|
void notch_init(BiquadFilter *filter, float sample_freq, float center_freq, float bandwidth);
|
|
float biquad_apply(BiquadFilter* filter, float input);
|
|
|
|
|
|
#endif |