<html><head>
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
</head>
<body><div>First, 'bode' is going to give you a Bode plot, and it's going to be insistent on giving it to you in log-log format -- so if you want a plot on a linear frequency axis from -pi to +pi, then you need to do it by hand.</div><div><br></div><div>Second, 'bode' is pretty insistent about reporting things as per second -- if you define a system as 'd' then it'll act like the system is sampled at 1Hz.</div><div><br></div><div>If, for instance, you run:</div><div><br></div><div>H = syslin('d', (%z - 0.9) / (%z - 1));</div><div>g = scf(0); clf; bode(H, 0.001, 0.4999, 'rad')</div><div><br></div><div>You will get the following plot:</div><div><br></div><div><img src="cid:1488059631.3078.80.camel@wescottdesign.com"><br></div><div><br></div><div>It puts the vertical red lines there, presumably to mark Nyquist, even though we're displaying in radians per sample, and it reports things as radians/s. You can get into the guts of the graph and fix it up, though:</div><div><br></div><div>delete(g.children(2).children(1)); // Delete the top red line</div><div>delete(g.children(1).children(1)); // Delete the bottom red line</div><div>g.children(2).x_label.text = "Frequency (rad/sample)"; // Change the top text</div><div>g.children(1).x_label.text = "Frequency (rad/sample)"; // change the bottom text</div><div><br></div><div>Do all this, and you get:</div><div><br></div><div><img src="cid:1488059631.3078.81.camel@wescottdesign.com"><br></div><div><br></div><div>On Sat, 2017-02-25 at 20:38 +0100, Serge Steer wrote:</div><blockquote type="cite">
<div class="moz-cite-prefix">Le 25/02/2017 Ã 19:17, Pablo Fonovich a
écrit :<br>
</div>
<blockquote cite="mid:SN1PR10MB0383BAE6ABD85478C3EC0350EE550@SN1PR10MB0383.namprd10.prod.outlook.com" type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Hi:</p>
<p>This is the first time i work with discrete time transfers
functions and Scilab.</p>
<p>I want to use bode() for plotting the magnitud and phase
response of the system, however, i don't understand how to set
the frequencies to normalized values (-pi, pi).</p>
<p>This is what i'm doing:</p>
<p><br>
</p>
<div>s=poly(0,'s')<br>
H=(s^(-2400))/(1-0.5*s^(-2400))<br>
S=syslin('d',H)<br>
bode(S)</div>
<p><br>
</p>
<p>i get a warning that frequencies beyond nyquist rate are
ignored and the resulting plot is attached.</p>
<p><img tabindex="0" aria-expanded="false" crossorigin="anonymous" id="img472992" style="max-width:
99.9%;" contenttype="image/png" size="0" src="cid:part1.AF505552.9295B9D5@inria.fr"><br>
</p>
<p>In the help, it says that bode parameter could include fmin
and fmax in herz, but isn't a discrete system response limited
to normalized frequencies? And to transform the normalized
frecuency to herz the sample rate must be used, but i don't
know how to pass it to the system or something.</p>
</div>
</blockquote>
S=syslin(dt,H) defines a dynamical system sampled. dt beeing the
sampling period in second.<br>
If you want the frequency uniis be in rd/s add "rad" as last input
argument<br>
<blockquote cite="mid:SN1PR10MB0383BAE6ABD85478C3EC0350EE550@SN1PR10MB0383.namprd10.prod.outlook.com" type="cite">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Any hints would be appreciated.</p>
<p>Thanks<br>
</p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<p><br>
</p>
<pre>_______________________________________________
users mailing list
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre></blockquote><div><span><pre>--
Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell: 503.349.8432
</pre></span></div></body></html>