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.

Question for IIR example in Controlsuite

Other Parts Discussed in Thread: CONTROLSUITE

I am trying this IIR32 example in Controlsuite on 28335. My question is where can I find the details of the following functions?

IIR5BIQ16_calc

IIR5BIQ32_calc

IIR5BIQ16_init

IIR5BIQ32_init

I can't find them from iir.h and iir32d.c, or I don't know how to find them.

Thank you for your help

  • I tried the IIR32 example in sprc082, but it shows fatal error: file    "C:\\tidcs\\c28\\dsp_tbox\\filter\\cstb\\iir32\\build\\Debug\\iir32d.obj"    has a Tag_Memory_Model attribute value of "2" that is different than one    previously seen ("1"); combining incompatible files

    is there anything I missed?

    BTW: I am using CCS 3.3

  • Hi,

    If this is the fixedpoint library in controlSUITE, there should be an accompanying user guide in the doc folder. Pages 36-45 describe how the biquad is implemented and should contain the information you are looking for.

  • Thank you, Vishal,

    Actually, for some reasons I am using CCS 3.3, but the downloaded controlsuite is not compatible with CCS 3.3, so I have to install a CCS 5.2 to open the project.

    My question is that is that right to add the IQmath_fpu32.lib and C28x_FixedPoint_Lib_fpu32.lib into the library in order to use the IIR32 project of sprc082 in 28335 under CCS 3.3?

    Another question is could you please tell me why the coeffs from TI MATLAB code are different from that got from lowpass filter in SIMULINK of MATLAB with same DESIGN SCRIPT (Butterworth, Low pass, Sampling frequency, Pass band Ripples in dB, stop band Rippled in dB, pass band corner frequency, stop band corner frequency, Direct II Form cascade Second Order Sections).

  •                       

  • Yang Wang3 said:
    My question is that is that right to add the IQmath_fpu32.lib and C28x_FixedPoint_Lib_fpu32.lib into the library in order to use the IIR32 project of sprc082 in 28335 under CCS 3.3?

    If you plan to use the -fpu32 support option in your project build settings you will need to include the _fpu32 variants of these libraries or you will get an error about the ISA's (Instruction set architecture) being different

    As far as the matlab script is concerned the coefficients are scaled to be in Q15(or Q31) format  but both matlab and simulink should, to my knowledge, use the same underlying functions to generate the filter coefficients.

  • Thanks a lot, Vishal,

    for the matlab script problem, I just notice that in the Low pass filter IIR16 example, the coefficients in simulink of matlab are 24 but in the TI codes there are 20 coefficients. where can I get the transformation functions?

    I just tested the IIR32 project and found out some questions:

    1) the Q format value of iir32.output is the global Q value or the Q value from the iir filter?

    2) is there any offset between the input and output? because I tried the IIR32 low pass filter in example, the input is a constant value, but when I used _IQtoF function to check the result, the output only half of the input.

    Regards,

    Yang

     

  • Hi Yang,

    Yang Wang3 said:
    but when I used _IQtoF function to check the result, the output only half of the input.

    I ran the eziir code for butterworth : fs = 250e3, fpass = 40e3, fstop = 65e3 Rpass = 3dB, Rstop = 60dB and the output in matlab gives you the Q format for the coefficients and how much the input is scaled, e.g. 

    Q format of the IIR filter coefficients:
        13

    Input Scaling value:
        0.5683

    Number of Biquads:
         4

    so you will have to compensate for the scaling at the output....in my case its 0.56 which is probably why you were seeing the reduction in the output by half. You can use the _IQ13toF function (in my case atleast) to convert your coefficients to float.

  • Thank you very much, Vishal. Very appreciate your help.