Listing 1
//first_ord.h #ifndef M_PI #define M_PI 3.14159265358979323846 #endif #include <math.h> #define hpf 1.0 #define lpf -1.0 struct fstord { double fc; //corner frequency double fs; //sample rate double alpha; //analog frequency parameter double acoef; //a coefficient double bcoef; //b coefficient double gain; //filter gain double xn_1; //xn-1 double yn_1; //yn-1 double type; //hpf or lpf };