Okay I did reduce the problem. Attached is the script!<div><br></div><div>When I run with show_issue = 0 (Line 12) I have everything perfect. With that I try to get the filter coefficients using the commands :</div><div><br>
</div><div>getArray(invert(a))</div><div>getArray(invert(b))</div><div><br></div><div>The coefficient obtained in this way shows stability problem and has completely different response in MATLAB. </div><div>In order to debug this enable show_issue = 1 (line 12), by which I enter coefficient to re-construct the filter and this time it is </div>
<div>completely different and in agreement with MATLAB result!</div><div><br></div><div>Hope I am missing something while I am printing a and b. Can anybody tell me what is the issue with my printing of a and b ?</div><div>
<br></div><div>Regards,<br><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8">-- <br>Sumit Adhikari,<br>Institute of Computer Technology,<br>Faculty of Electrical Engineering,<br>Vienna University of Technology,<br>
Gußhausstraße 27-29,1040 Vienna</div><div><br></div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Tue, Aug 2, 2011 at 10:38 AM, Sumit Adhikari <span dir="ltr"><<a href="mailto:sumit.adhikari@gmail.com">sumit.adhikari@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Dear All,<div><br></div><div>I am designing an IIR filter scilab, in which the quantized filter response is as follows:</div>
<div><br></div><div><font color="#3333ff">###########################################################################</font></div>
<div><div><font color="#3333ff"> FLDN :: Designed Filter := Hiir_q</font></div><div><font color="#3333ff"> </font></div><div><font color="#3333ff">                      2        3        4        5        6        7        8          9        10       11       12       13       14       15      </font></div>

<div><font color="#3333ff">    139 - 208z + 7920z - 25291z + 55974z - 66935z + 46643z + 26354z - 95388z + 136947z - 100619z + 33947z + 39939z - 63176z + 54471z - 24951z        </font></div><div><font color="#3333ff">              16                                                                                                                                     </font></div>

<div><font color="#3333ff">       + 7607z                                                                                                                                       </font></div><div><font color="#3333ff">    -----------------------------------------------------------------------------------------------------------------------------------------------  </font></div>

<div><font color="#3333ff">                                      2            3            4            5            6            7            8             9           10     </font></div><div><font color="#3333ff">    14419729 - 2.352D+08z + 1.827D+09z - 8.997D+09z + 3.148D+10z - 8.305D+10z + 1.710D+11z - 2.806D+11z + 3.709D+11z - 3.965D+11z + 3.420D+11z       </font></div>

<div><font color="#3333ff">                   11           12           13           14           15           16                                                               </font></div><div><font color="#3333ff">       - 2.358D+11z + 1.275D+11z - 5.233D+10z + 1.541D+10z - 2.917D+09z + 2.684D+08z                                                                 </font></div>

<div><font color="#3333ff"><br></font></div><div><font color="#3333ff"> ###########################################################################</font></div><div> </div>
<div><br></div><div>Hiir_q is stable and I tested this filter with quantized input for 16-bits. So, when I was satisfied I got the filter coefficients like as follows :</div><div><br></div><div><font color="#3333ff"><br>

</font></div><div><div><font color="#3333ff">-->getArray(invert(a))</font></div><div><font color="#3333ff"> B(01) = 268435456</font></div><div><font color="#3333ff"> B(02) = 1377518686</font></div>
<div><font color="#3333ff"> B(03) = -1768307133</font></div><div><font color="#3333ff"> B(04) = -786674615</font></div><div><font color="#3333ff"> B(05) = -1379482255</font></div>
<div><font color="#3333ff"> B(06) = 441572766</font></div><div><font color="#3333ff"> B(07) = -1550825035</font></div><div><font color="#3333ff"> B(08) = -1373807840</font></div>
<div><font color="#3333ff"> B(09) = 1486413132</font></div><div><font color="#3333ff"> B(10) = -1394174588</font></div><div><font color="#3333ff"> B(11) = -787299224</font></div>
<div><font color="#3333ff"> B(12) = -1440621730</font></div><div><font color="#3333ff"> B(13) = 1413056441</font></div><div><font color="#3333ff"> B(14) = -406911246</font></div>
<div><font color="#3333ff"> B(15) = 1826903011</font></div><div><font color="#3333ff"> B(16) = -235150099</font></div><div><font color="#3333ff"> B(17) = 14419729</font></div>
<div><font color="#3333ff"> </font></div><div><font color="#3333ff">-->getArray(invert(b))</font></div><div><font color="#3333ff"> B(01) = 7607</font></div>
<div><font color="#3333ff"> B(02) = -24951</font></div><div><font color="#3333ff"> B(03) = 54471</font></div><div><font color="#3333ff"> B(04) = -63176</font></div>
<div><font color="#3333ff"> B(05) = 39939</font></div><div><font color="#3333ff"> B(06) = 33947</font></div><div><font color="#3333ff"> B(07) = -100619</font></div>
<div><font color="#3333ff"> B(08) = 136947</font></div><div><font color="#3333ff"> B(09) = -95388</font></div><div><font color="#3333ff"> B(10) = 26354</font></div>
<div><font color="#3333ff"> B(11) = 46643</font></div><div><font color="#3333ff"> B(12) = -66935</font></div><div><font color="#3333ff"> B(13) = 55974</font></div>
<div><font color="#3333ff"> B(14) = -25291</font></div><div><font color="#3333ff"> B(15) = 7920</font></div><div><font color="#3333ff"> B(16) = -208</font></div>
<div><font color="#3333ff"> B(17) = 139</font></div><div><font color="#3333ff"> </font></div><div><font color="#3333ff">--></font></div></div><div>
<br></div><div>and then tried to implement it using a double precision C++/SystemC model. I found that the filter output is unstable. While I was debugging,</div><div>as a check I copied and pasted these coefficients in MATLAB so that I can be sure what is going wrong. With my surprise I found that</div>

<div>the MATLAB is showing completely different response and a completely unstable filter. </div><div><br></div><div>I think I am doing some mistake. Can anybody please point out where ?</div><div><br></div><div>Regards,</div>

<div><br></div><div><br></div>-- <br>Sumit Adhikari,<br>Institute of Computer Technology,<br>Faculty of Electrical Engineering,<br>Vienna University of Technology,<br>Gußhausstraße 27-29,1040 Vienna<br>
</div>
</blockquote></div><br><br clear="all"><br><br>
</div>