You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
psyn/filter.h

32 lines
760 B

struct filter_t
{
double k;
double r;
double v_l;
double v_r;
double last_in_l;
double last_in_r;
double last_out_l;
double last_out_r;
};
struct bw_filter_t
{
double a1;
double a2;
double a3;
double b1;
double b2;
double in1_l, in2_l, out1_l, out2_l;
double in1_r, in2_r, out1_r, out2_r;
};
void filter_init_rc(struct filter_t *filter, double R, double C);
void filter_init_freq(struct filter_t *filter, double freq);
void filter_run_lp(struct filter_t *filter, double left, double right);
void filter_run_hp(struct filter_t *filter, double left, double right);
void bw_filter_init_lp(struct bw_filter_t *f, double freq, double resonance);
void bw_filter_run(struct bw_filter_t *f, double in_l, double in_r, double *out_l, double *out_r);