12#define CLAMP(x,mi,ma) ( (x < mi) ? mi : ( (x>ma) ? ma : x))
14#define MIN(a, b) ((a)<(b)?(a):(b))
17#define MAX(a, b) ((a)>(b)?(a):(b))
20#define ALLOC(type) (type *)calloc(1, sizeof(type))
21#define ALLOCN(n, type) (n == 0 ? NULL : (type *)calloc((n), sizeof(type)))
24#define IIR_STAGE_LOWPASS 0
25#define IIR_STAGE_HIGHPASS 1
26#define IIR_STAGE_BANDPASS 2
27#define IIR_STAGE_BANDPASS_A 3
101 float c, a1, a2, a3, b1, b2;
106 c = 1.0f / tan(
M_PI *
f / sample_rate ) ;
108 a1 = 1.0f / ( 1.0f +
r *
c +
c *
c);
111 b1 = -2.0f * ( 1.0f -
c*
c) * a1;
112 b2 = -( 1.0f -
r *
c +
c *
c) * a1;
115 c = tan(
M_PI *
f / sample_rate );
117 a1 = 1.0f / ( 1.0f +
r *
c +
c *
c);
120 b1 = -2.0f * (
c*
c - 1.0f) * a1;
121 b2 = -( 1.0f -
r *
c +
c *
c) * a1;
127 gt->
coeff[0][0] = a1;
128 gt->
coeff[0][1] = a2;
129 gt->
coeff[0][2] = a3;
130 gt->
coeff[0][3] = b1;
131 gt->
coeff[0][4] = b2;
137 int i,nb,nt,
j,
z,ipos,opos;
142 memcpy(outdata, indata, numSampsToProcess*
sizeof(
float));
153 for(pos=0; pos<numSampsToProcess; pos++) {
161 for(
j=0;
j<gt->
na;
j++){
168 for(
j=gt->
na;
j<nt;
j++){
186 for(pos=0; pos<numSampsToProcess; pos++) {
194 for(
j=0;
j<gt->
na;
j++){
201 for(
j=gt->
na;
j<nt;
j++){
225 float *outdata,
const long numSampsToProcess,
int add) {
229 for(pos=0; pos<numSampsToProcess; pos++) {
242 outdata[pos]=(float)
iirf[0].oring[2];
245 for(pos=0; pos<numSampsToProcess; pos++) {
267 for(pos=0; pos<numSampsToProcess; pos++) {
302 for(pos=0; pos<numSampsToProcess; pos++) {
#define M_PI
Definition compat.h:149
unsigned z
Definition inflate.c:1589
register unsigned j
Definition inflate.c:1576
register unsigned i
Definition inflate.c:1575
unsigned f
Definition inflate.c:1572
struct iirf iirf_t
Definition iir.h:9
struct iir_stage iir_stage_t
Definition iir.h:8
static void reset_iirf_t(iirf_t *iirf, iir_stage_t *gt, int n)
Definition iir.h:73
static void free_iirf_t(iirf_t *iirf, iir_stage_t *gt)
Definition iir.h:64
static void iir_process_buffer_ns_5(iirf_t *iirf, iir_stage_t *gt, const float *indata, float *outdata, const long numSampsToProcess, int add)
Definition iir.h:262
void combine_iir_stages(int mode, iir_stage_t *gt, iir_stage_t *first, iir_stage_t *second, int upf, int ups)
Definition iir.c:63
void free_iir_stage(iir_stage_t *gt)
Definition iir.c:86
iir_stage_t * init_iir_stage(int mode, int nstages, int na, int nb)
Definition iir.c:45
void calc_2polebandpass(iirf_t *iirf, iir_stage_t *gt, float fc, float bw, long sample_rate)
Definition iir.c:98
static void iir_process_buffer_1s_5(iirf_t *iirf, iir_stage_t *gt, const float *indata, float *outdata, const long numSampsToProcess, int add)
Definition iir.h:224
int chebyshev(iirf_t *iirf, iir_stage_t *gt, int n, int mode, float fc, float pr)
Definition iir.c:211
#define gliirt
Definition iir.h:11
static void iir_process_buffer(iirf_t *iirf, iir_stage_t *gt, const float *indata, float *outdata, const long numSampsToProcess, int add)
Definition iir.h:135
static iirf_t * init_iirf_t(iir_stage_t *gt)
Definition iir.h:50
#define ALLOCN(n, type)
Definition iir.h:21
static void butterworth_stage(iir_stage_t *gt, int mode, float f, float r, long sample_rate)
Definition iir.h:99
static float flush_to_zero(float f)
Definition ladspa-util.h:66
png_structrp int mode
Definition png.h:1139
gliirt spr
Definition iir.h:39
int na
Definition iir.h:34
gliirt fc
Definition iir.h:36
int mode
Definition iir.h:31
gliirt ppr
Definition iir.h:38
int nstages
Definition iir.h:33
gliirt ** coeff
Definition iir.h:40
int availst
Definition iir.h:32
gliirt bw
Definition iir.h:37
int nb
Definition iir.h:35
int np
Definition iir.h:30
gliirt * iring
Definition iir.h:44
int ipos
Definition iir.h:46
gliirt * oring
Definition iir.h:45
int opos
Definition iir.h:47
int n
Definition crypt.c:458
return c
Definition crypt.c:175
memcpy(hh, h, RAND_HEAD_LEN)
int r
Definition crypt.c:458