Bandpass filter

sherzaad:
couple of things:
you may want to change "#define GAIN 2.733054109e+10" to "const double GAIN 2.733054109e+10"
//double - >8 byte -> 2.3E-308 to 1.7E+308 ->15 decimal places
//define is usually 2 bytes long max value of 65 535 (unsigned)

secondly, I'm assuming that "next input value" will be be likely a analog read.

so ignoring PaulS not so helpful comment, you can implement this code as follows for in arduino sketch:


void setup(){

// initailise you inputs/ serial comms etc
}

void loop(){

//put the content of the for loop here. replace "next input value" with analogRead(1) for example if you a reading from A1 (assuming arduino UNO here)

}

Also may be sensible to put all the decimal constants you are using as const double global variables (just in case the complier does something funny with them)

put the content of the for loop here - This is my problem - how to create it ?