Post Go back to editing

IIR block and "Manual" IIR

Hi everybody. I was working on an IIR filter implementation using blocks avaible in the IDE. I disegned a second order IIR (5 coefficients). I tried to compare performance between IIR filter I designed with IDE blocks (patch pic attached) and the block "Second Order General IIR filter", with "IIR Coefficient" approach, They have frequency responses completely different and I don't know really why.

Did I make some mistakes?


Manual IIR FR

General IIR (IDE embedded) FR

Thanks very much,

  •      Hi leonxp,

         My tests show there's several issues conspiring to confuse the results:

    • Both filters oscillate when run on the hardware.  I suspect the cause is the greater-than unity gains for feedback coefficients a1 and a2.
    • The General Filter block flips the signs of the a1 and a2 coefficients you type in before sending them to the DSP.  Thus you need to invert their signs yourself compared to the polarity of the feedback gains you place in the wired version of the filter.
    • You need only one feedback block in the feedback hierarchy board for your wired  filter.  The second delay should be a standard one.  I don't know why this matters, since the feedback block does implement a unit delay -- but I have found that things work best when using only enough feedback blocks to avoid "illegal feedback" errors.
    • The "stimulus / probe" blocks are not a true simulation but rather perform a calculated frequency plot of the filter(s) placed between them.  Thus they only work properly with the standard filter blocks and their combinations.  This is really handy, for example, to check the response of a 12-pole filter made of six bi-quads in series.  However the stimulus / probe blocks do not function with hand-assembled filters.  Most often they give no plot at all, but in your case, the stimulus / probe blocks gave a misleading partial result --  ignoring the feedback portion of your wired filter.


         To verify these observations yourself, you could reduce a1 and a2 to sub-unity values, and flip their signs in the General Filter's  entries.  In your feedback hierarchy board, replace the second feedback block with a unit delay.  After I did this, the two filters produced similar responses on the hardware.  With the stimulus / probe blocks you'll only see identical results when you set the a1 and a2 (feedback) coefficients of the General filter to zero, because the stimulus / probe cannot follow the feedback portion of the wired filter.

         Best regards,


  •      Hello leonxp,

         Here's some clarifying data:

         To rough out the frequency responses without external test gear I use a swept VCO and peak detector as shown below:

         The Real-Time Display gives the peak magnitude response from 1KHz to 20KHz.  Both scales are linear, so the results format differently than with the stimulus / probe display.

         This is the feedback portion of your wired filter with one feedback block and one straight delay, and the original coefficients:

         With these feedback coefficients the filter's magnitude output hits the rail (16.0), as shown below.  The General Filter block yields the same result:

         Reducing the manual filter's feedback coefficients by an arbitrary factor of 10 results in this response:

    The General Filter block, with the same coefficients except for a1 and a2 signs reversed, provides the same results:

    I attached the circuit with the swept VCO that made these plots.  I hope you find all this helpful.

    Best regards,


  • This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin