Hi
We found some difficulties to change the following IIR parameters.
For example, we want to change "0.1 ~ 0.5" to "0.15~ 0.4".
Question 1. Are there any reason to use IIR than FIR? for example, any performance issue?
Question 2. how can we build coefficients if we want to change to other bandwidth range such as 0.15~0.5?
reference code from ti >
// 0.1 Hz to 0.5 Hz Bandpass Filter coefficients
float pFilterCoefsBreath[IIR_FILTER_BREATH_NUM_STAGES * IIR_FILTER_COEFS_SECOND_ORDER] = {
1.0000, 0, -1.0000, 1.0000, -1.9632, 0.9644,
1.0000, 0, -1.0000, 1.0000, -1.8501, 0.8681 };
float pScaleValsBreath[IIR_FILTER_BREATH_NUM_STAGES + 1] = {0.0602, 0.0602, 1.0000};
memcpy(obj->pFilterCoefsBreath, pFilterCoefsBreath, sizeof(pFilterCoefsBreath));
memcpy(obj->pScaleValsBreath, pScaleValsBreath, sizeof(pScaleValsBreath));
// Heart Beat Rate 0.8 - 4.0 Hz
float pFilterCoefsHeart_4Hz[IIR_FILTER_HEART_NUM_STAGES * IIR_FILTER_COEFS_SECOND_ORDER] = {
1.0000, 0, -1.0000, 1.0000, -0.5306, 0.5888,
1.0000, 0, -1.0000, 1.0000, -1.8069, 0.8689,
1.0000, 0, -1.0000, 1.0000, -1.4991, 0.5887,
1.0000, 0, -1.0000, 1.0000, -0.6654, 0.2099 };
float pScaleValsHeart_4Hz[IIR_FILTER_HEART_NUM_STAGES + 1] = {0.4188, 0.4188, 0.3611, 0.3611, 1.0000};