Re: [Scilab-users] Bode of discret time transfer function.
I was implementing a digital reverberation for a class, and i wanted to show that it was indeed a comb filter.. Thanks all of you! you helped me a lot. De: users <users-boun...@lists.scilab.org> en nombre de Tim Wescott <t...@wescottdesign.com> Enviado: sábado, 25 de febrero de 2017 06:57 p.m. Para: Users mailing list for Scilab Asunto: Re: [Scilab-users] Bode of discret time transfer function. Not sure what you're trying to achieve, but if you want a plot of the linear amplitude response on a linear frequency line, use Horner: H = syslin('d', (%z - 0.9) / (%z - 99)); th = %pi * (-1:0.01:1)'; clf; plot2d(th, abs(horner(H, exp(%i * th; xgrid(2) On Sat, 2017-02-25 at 18:17 +, Pablo Fonovich wrote: > 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. > > Any hints would be appreciated. > Thanks > ___ > users mailing list > users@lists.scilab.org > http://lists.scilab.org/mailman/listinfo/users users Info Page - Scilab<http://lists.scilab.org/mailman/listinfo/users> lists.scilab.org The place to ask (and answer) questions on using Scilab. To see the collection of prior postings to the list, visit the users archives. -- Tim Wescott www.wescottdesign.com<http://www.wescottdesign.com> Wescott Design Services<http://www.wescottdesign.com/> www.wescottdesign.com Wescott Design Services Located in the foothills of the northern Oregon Cascades, Wescott Design Services is ready to use its proven expertise in systems design ... 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 users Info Page - Scilab<http://lists.scilab.org/mailman/listinfo/users> lists.scilab.org The place to ask (and answer) questions on using Scilab. To see the collection of prior postings to the list, visit the users archives. ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] Bode of discret time transfer function.
Not sure what you're trying to achieve, but if you want a plot of the linear amplitude response on a linear frequency line, use Horner: H = syslin('d', (%z - 0.9) / (%z - 99)); th = %pi * (-1:0.01:1)'; clf; plot2d(th, abs(horner(H, exp(%i * th; xgrid(2) On Sat, 2017-02-25 at 18:17 +, Pablo Fonovich wrote: > 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. > > Any hints would be appreciated. > Thanks > ___ > 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
Re: [Scilab-users] Bode of discret time transfer function.
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
Re: [Scilab-users] Bode of discret time transfer function.
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
[Scilab-users] Bode of discret time transfer function.
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. [cid:4845973f-0da4-4dd3-ade0-64a7e55422d3] 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. Any hints would be appreciated. Thanks ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users