Determine the minimum required
ADC sampling frequency. This must be at least twice the bandwidth of the input
signal.
Determine the desired rejection
coefficient. The rejection coefficients in a single pole IIR filter governs the
rate of decay of the filter over frequency. The rejection coefficient is
sometimes referred to as the beta (β) value, or the decay value.
There are different tools
for IIR filter coefficient calculation, which is not discussed in this
document.
Convert the filter coefficient to
a fixed point value.
In the example code, a Q8
(eight fractional bits) representation is used. Perform this conversion
using the IQMath library or by multiplying the
coefficients by 2n where n is the desired number of
fractional bits. Verify that the selected data type can hold these
values without overflowing.
The filter coefficients
are constant values and can be contained in flash to save room in SRAM
if desired.