I have the following sourcecode. For all I know, it should be a Bessel LPF at 10Hz. Is there a way to get the sampling frequence out of this?
double LPF(register double value) {
static double buf[4];
register double tmp, fir, iir;
tmp= buf[0]; memmove(buf, buf+1, 3*sizeof(double));
iir= val * 1.865660386328251e-06;
iir -= 0.9048452950692862*tmp; fir= tmp;
iir -= -1.898666438223082*buf[0]; fir += buf[0]+buf[0];
fir += iir;
tmp= buf[1]; buf[1]= iir; val= fir;
iir= val;
iir -= 0.8712702520352774*tmp; fir= tmp;
iir -= -1.866439169696869*buf[2]; fir += buf[2]+buf[2];
fir += iir;
buf[3]= iir; val= fir;
return val;
}
firis calculated from feedback through the filter, which doesn't seem to make sense). Also, you haven't shown whatvalis; the above function wouldn't compile. And, the input argumentvalueisn't referenced anywhere. – Jason R Nov 6 '12 at 13:27