Hi,
I need to filter some time series data gathered during an experiment. Column A is Time starting at 0 increasing in 0.1s increments. Column B is voltage data. The number of data rows varies.
I found an online program that calculates digital filter coefficients for a selected filter type, cutoff frequency, and filter order.
My input parameters were filter type= Butterworth highpass, cutoff frequency= 0.1Hz, and filter order = 3. The calculator returned a generic output:
Recurrence relation:
Also, is the following C code from the output:
Can anyone in the Forum convert either of these outputs to either Excel formulas or VBA?
Any help is appreciated.
Thanks,
-Art
I need to filter some time series data gathered during an experiment. Column A is Time starting at 0 increasing in 0.1s increments. Column B is voltage data. The number of data rows varies.
I found an online program that calculates digital filter coefficients for a selected filter type, cutoff frequency, and filter order.
My input parameters were filter type= Butterworth highpass, cutoff frequency= 0.1Hz, and filter order = 3. The calculator returned a generic output:
Recurrence relation:
Rich (BB code):
y[n] = ( -1 * x[n- 3])
+ ( 3 * x[n- 2])
+ ( -3 * x[n- 1])
+ ( 1 * x[n- 0])
+ ( 0.9875122361 * y[n- 3])
+ ( -2.9749461327 * y[n- 2])
+ ( 2.9874336501 * y[n- 1])
Also, is the following C code from the output:
Rich (BB code):
/* Digital filter designed by mkfilter/mkshape/gencode A.J. Fisher
Command line: /www/usr/fisher/helpers/mkfilter -Bu -Hp -o 3 -a 1.0000000000e-03 0.0000000000e+00 -l */
#define NZEROS 3
#define NPOLES 3
#define GAIN 1.006302976e+00
static float xv[NZEROS+1], yv[NPOLES+1];
static void filterloop()
{ for (;;)
{ xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3];
xv[3] = next input value / GAIN;
yv[0] = yv[1]; yv[1] = yv[2]; yv[2] = yv[3];
yv[3] = (xv[3] - xv[0]) + 3 * (xv[1] - xv[2])
+ ( 0.9875122361 * yv[0]) + ( -2.9749461327 * yv[1])
+ ( 2.9874336501 * yv[2]);
next output value = yv[3];
Can anyone in the Forum convert either of these outputs to either Excel formulas or VBA?
Any help is appreciated.
Thanks,
-Art