<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
  Following is the way you can get poles and zeros<br>
<br>
b = coeff(numer(hz));<br>
a = coeff(denom(hz));<br>
<br>
BR,<br>
Sumit<br>
<br>
Celso Co wrote:
<blockquote cite="mid:OGEOIPHFCBFLDECNAAMDCEJNCCAA.celso.co@gmail.com"
 type="cite">
  <pre wrap="">You may want to consider some means of manipulating poles and zeros in the
attached file.  Celso

-----Original Message-----
From: Adelson Santos de Oliveira [<a class="moz-txt-link-freetext" href="mailto:adelson.oliveira@gmail.com">mailto:adelson.oliveira@gmail.com</a>]
Sent: Saturday, July 25, 2009 10:03 AM
To: <a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
Subject: Re: [scilab-Users] Cascaded IIR filter design


Sorry,
I would like to help but I can make only general comments. I would not
go into the subject of your work.
If hz were a Scilab polynomial, getting poles and zeroes would be
straightforward from numerator and denominator ...

I can only suggest you find a way to decompose hz into scilab objects
(polys, ....),

Good luck,

Adelson

Markus Svilans escreveu:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi Adelson,

Thanks for your response.
I think hz must be a Scilab rational polynomial. Here are its contents:

-->hz
hz  =

                                      2            3
4            5            6  - 0.0513754 + 0.0469923z - 0.0057700z +
2.282D-17z + 0.0057700z - 0.0469923z + 0.0513754z
--------------------------------------------------------------------------
    </pre>
  </blockquote>
  <pre wrap=""><!---->-------------
  </pre>
  <blockquote type="cite">
    <pre wrap="">                                          2            3
4            5   6             0.5046613 - 1.0416559z + 2.4270369z -
2.6222075z + 2.9969513z - 1.6458787z + z

>From what I have been able to research so far, I am starting to feel
that it's not possible to get Scilab to directly return the a,b
cascaded IIR coefficients.

Perhaps, could you lend your expertise on these related questions:
1. How to get the poles of hz?
2. How to get the zeroes of hz?

Knowing the poles and zeroes, I can hope to derive the IIR
coefficients by hand.

Thanks very much,
Markus.



Adelson Santos de Oliveira wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Sorry,

I did not analyse your program. I supposed that hz is a polinomial
according to SCILAB definition. See the following example and check
if you can adapt it to your needs,


Polz=poly([1,2,3],'Z','coefs')       <= this define a polynomial in
variable Z, maybe your hz is not a polynomial for SCILAB

coefz=coeff(Polz)                        <= this will return the
coefficients 1, 2, and 3


Markus Svilans escreveu:
      </pre>
      <blockquote type="cite">
        <pre wrap="">Adelson,

Thanks for your response.

It doesn't seem to work. The error message I get is:

--
Function not defined for given argument type(s),

 check arguments or define function %r_coeff for overloading.
--

I'm looking for a way to get the b0, b1, a1, b2, a2, ...
coefficients required for a cascaded IIR. From what I understand,
there is an algorithm by which they are computed from the z-domain
coefficients hz.

Regards,
Markus.


Adelson Santos de Oliveira wrote:
        </pre>
        <blockquote type="cite">
          <pre wrap="">Do you mean,

coef_hz=coeff(hz) ?

coef_hz is a vector with the coefficients of hz.

coefhz=coeff
Markus Svilans escreveu:
          </pre>
          <blockquote type="cite">
            <pre wrap="">Hello,

I would like to use Scilab to design a cascaded IIR filter.

I'm able to design a filter using iir(), as in the following example
code:

ystr=[ 'type (lp, hp, bp, sb) ';
   'order (integer)';
   'design (butt, cheb1, cheb2 , ellip)' ;
   'cut-off frequencies (2-vector in [0, 0.5])';
   'error values  0 delta(1),delta(2) 1 '];
w = x_mdialog('Choose filter type and parameters',...
   ystr,['bp';'3';'ellip';'0.15 0.25';'0.08 0.035'])

if w<>[] then
 hz=iir(evstr(w(2)),w(1),w(3),evstr(w(4)),evstr(w(5)));
 [hzm,fr]=frmag(hz,256);
 xselect();
 plot2d(fr',hzm')
 xtitle('Discrete IIR filter '+'( '+ w(3)+' ) ',' ',' ');

 hz
end

My question is, how can I convert the z domain expression in hz to a
set of coefficients suitable for use in a cascaded IIR filter
implementation? Any help would be greatly appreciated.

Best regards,
Markus.

(also posted in the comp.soft-sys.math.scilab group)


            </pre>
          </blockquote>
        </blockquote>
        <pre wrap="">
        </pre>
      </blockquote>
    </blockquote>
    <pre wrap="">
    </pre>
  </blockquote>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 

--------------------------------------------
Sumit Adhikari
System Design Engineer
austriamicrosystems AG
Business Unit : Automotive
Mob : 00-91-9885271710/00-91-9000161710

</pre>
</body>
</html>