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.
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.
If, for instance, you run:
H = syslin('d', (%z - 0.9) / (%z - 1));
g = scf(0); clf; bode(H, 0.001, 0.4999, 'rad')
You will get the following plot:
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:
delete(g.children(2).children(1));   // Delete the top red line
delete(g.children(1).children(1));   // Delete the bottom red line
g.children(2).x_label.text = "Frequency (rad/sample)";  // Change the
top text
g.children(1).x_label.text = "Frequency (rad/sample)";  // change the
bottom text
Do all this, and you get:
On Sat, 2017-02-25 at 20:38 +0100, Serge Steer wrote:
> Le 25/02/2017 à 19:17, Pablo Fonovich a écrit :
> > Hi:
> > This is the first time i work with discrete time transfers
> > functions and Scilab.
> > 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).
> > This is what i'm doing:
> > 
> > s=poly(0,'s')
> > H=(s^(-2400))/(1-0.5*s^(-2400))
> > S=syslin('d',H)
> > bode(S)
> > 
> > i get a warning that frequencies beyond nyquist rate are ignored
> > and the resulting plot is attached.
> > 
> > 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.
>  S=syslin(dt,H) defines a dynamical system sampled. dt beeing the
> sampling period in second.
> If you want the frequency uniis be in rd/s add "rad" as last input
> argument
> > Any hints would be appreciated.
> > Thanks
> > 
> > 
> > _______________________________________________
> > users mailing list
> > users@lists.scilab.org
> > http://lists.scilab.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
-- 

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to