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.

IWR1443: About the demo of Water_ground_lab

Part Number: IWR1443

Hello!

In the demo Water_ground_lab, I have some question about an function. The function is follow code.

float  filter_IIR_BiquadCascade(float DataIn, float *pFilterCoefs, float *pScaleVals, float *pDelay, uint16_t numStages)
{
    float a1,a2;
    float b0,b1,b2;
    float y, input, output;
    float scaleVal;
    uint16_t indexStage;
    uint16_t numCoefsStage;
    uint16_t indexTemp;

    numCoefsStage = 6;

    input = DataIn;
    for (indexStage = 0; indexStage < numStages; indexStage++)
    {
        indexTemp = numCoefsStage*indexStage;
        b0 = pFilterCoefs[ indexTemp ];
        b1 = pFilterCoefs[ indexTemp + 1];
        b2 = pFilterCoefs[ indexTemp + 2];
        a1 = pFilterCoefs[ indexTemp + 4];
        a2 = pFilterCoefs[ indexTemp + 5];
        scaleVal = pScaleVals[indexStage];

        pDelay[indexTemp ] = scaleVal*input - a1*pDelay[indexTemp + 1] - a2*pDelay[indexTemp + 2];
        y =  b0*pDelay[indexTemp ] + b1*pDelay[indexTemp + 1] + b2*pDelay[indexTemp + 2];

        pDelay[indexTemp + 2] = pDelay[indexTemp + 1];
        pDelay[indexTemp + 1] = pDelay[indexTemp ];

        input = y;
    }
    output = y;

    return output;

}

In the main.c, the function is used in this line:

 outputFilterPhase  = filter_IIR_BiquadCascade(phaseUsedComputation,  obj->pFilterCoefs,  obj->pScaleVals, pDelay, IIR_FILTER_NUM_STAGES);

I cannot understand the this line. I want to know the function of 

filter_IIR_BiquadCascade(). 



Can you help me?