32 #define M_PI 3.14159265358979323846
40 #define lo_filter(in, out_1) (bs2b->a0_lo*(in) + bs2b->b1_lo*(out_1))
43 #define hi_filter(in, in_1, out_1) (bs2b->a0_hi*(in) + bs2b->a1_hi*(in_1) + bs2b->b1_hi*(out_1))
52 if ((bs2b->
srate > 192000) || (bs2b->
srate < 2000))
60 G_lo = 0.398107170553497;
61 G_hi = 0.205671765275719;
67 G_lo = 0.459726988530872;
68 G_hi = 0.228208484414988;
74 G_lo = 0.530884444230988;
75 G_hi = 0.250105790667544;
81 G_lo = 0.316227766016838;
82 G_hi = 0.168236228897329;
88 G_lo = 0.354813389233575;
89 G_hi = 0.187169483835901;
97 G_lo = 0.398107170553497;
98 G_hi = 0.205671765275719;
107 x = exp(-2.0 *
M_PI * Fc_lo / bs2b->
srate);
109 bs2b->
a0_lo = G_lo * (1.0 -
x);
111 x = exp(-2.0 *
M_PI * Fc_hi / bs2b->
srate);
113 bs2b->
a0_hi = 1.0 - G_hi * (1.0 -
x);
116 bs2b->
gain = 1.0f / (float)(1.0 - G_hi + G_lo);
125 if(level == bs2b->
level)
138 if (srate == bs2b->
srate)
171 sample[0] *= bs2b->
gain;
172 sample[1] *= bs2b->
gain;
178 if (sample[0] < -1.0)
182 if (sample[1] < -1.0)
#define BS2B_DEFAULT_SRATE
static void init(struct bs2b *bs2b)
#define BS2B_MIDDLE_ECLEVEL
void bs2b_clear(struct bs2b *bs2b)
void bs2b_set_srate(struct bs2b *bs2b, int srate)
int bs2b_get_level(struct bs2b *bs2b)
#define BS2B_HIGH_ECLEVEL
#define hi_filter(in, in_1, out_1)
#define BS2B_MIDDLE_CLEVEL
void bs2b_cross_feed(struct bs2b *bs2b, float *sample)
#define lo_filter(in, out_1)
struct bs2b::t_last_sample last_sample
void bs2b_set_level(struct bs2b *bs2b, int level)
int bs2b_get_srate(struct bs2b *bs2b)