Hi,
I have requested the TIDA-00011 source code. In the code, there is a "filter(sample)" function. I want to know the principle about this function .
Can you give me some help? THx
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi Hank,
The filter function is an implementation of a 3rd order bandpass butterworth IIR filter as a "second order section" (sos) implementation. The following loop is a simplification of the same code (with gain removed, and scaling factors removed):
for (i = 0; i < STAGES; i++)
{
wn = input - a[i][0] * dly[i][0] - a[i][1] *dly[i][1];
result = b[i][0]*wn + b[i][1]*dly[i][0] +b[i][2]*dly[i][1];
dly[i][1] = dly[i][0];
dly[i][0] = wn;
input = result;
}
Let me know if this answers your question.