<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Le 25/02/2016 18:10, grivet a écrit :<br>
</div>
<blockquote cite="mid:56CF356F.1090108@cnrs-orleans.fr" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Le 24/02/2016 21:40, Serge Steer a
écrit :<br>
</div>
<blockquote cite="mid:56CE154E.40302@inria.fr" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<div class="moz-cite-prefix">Le 24/02/2016 11:30, grivet a
écrit :<br>
</div>
<blockquote cite="mid:56CD8655.10403@cnrs-orleans.fr"
type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<div class="moz-cite-prefix">I appreciate your help; however,
neither suggestion works: I still get the same error
message.<br>
The similar line <br>
[frq,repf]=repfreq(hz,0.01,0.49);<br>
has no problem<br>
</div>
</blockquote>
</blockquote>
</blockquote>
You are right the problem is exactly for the frequency 0.5 besause <br>
exp(2*%pi*%i*0.5) -> - 1. + 1.225D-16i <br>
and hz.num has 2 zeros very near -1<br>
<br>
I checked the hz value with Matlab, the results are the same. So it
seems that hz is ok. So it is probabily a probleme due to floating
point computations procucing a zero value instead of a very small
one.<br>
<br>
Serge<br>
<blockquote cite="mid:56CF356F.1090108@cnrs-orleans.fr" type="cite">
<blockquote cite="mid:56CE154E.40302@inria.fr" type="cite">
<blockquote cite="mid:56CD8655.10403@cnrs-orleans.fr"
type="cite">
<div class="moz-cite-prefix"> </div>
</blockquote>
please can you save the hz value using the Scilab save function
and send the file?<br>
Serge<br>
<blockquote cite="mid:56CD8655.10403@cnrs-orleans.fr"
type="cite">
<div class="moz-cite-prefix"> </div>
<blockquote cite="mid:56CC6DE0.7040602@inria.fr" type="cite">
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<br>
</blockquote>
</blockquote>
</blockquote>
Voila le code:<br>
//filtre Butterworth<br>
Order = 2; // The order of the filter<br>
Fs = 1000; // The sampling frequency<br>
Fcutoff = 40; // The cutoff frequency<br>
<br>
// We design a low pass Butterworth filter<br>
hz = iir(Order,'lp','butt',Fcutoff/Fs/2,[0.1 0.1]);<br>
<br>
// We compute the frequency response of the filter<br>
[frq,repf]=repfreq(hz,0,0.5);<br>
[db_repf, phi_repf] = dbphi(repf);<br>
<br>
// And plot the bode like representation of the digital filter<br>
subplot(2,1,1);<br>
plot2d(Fs*frq,db_repf);<br>
xtitle('Obtained Frequency Response (Magnitude)');<br>
subplot(2,1,2);<br>
plot2d(Fs*frq,phi_repf);<br>
xtitle('Obtained Frequency Response (Phase in degree)');<br>
<br>
iir est sauvegardé dans "svgd_iir" joint (binaire).<br>
<br>
Cordialement,<br>
JP Grivet<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</body>
</html>