[Scilab-users] bug in function iir ?

grivet grivet at cnrs-orleans.fr
Tue Feb 23 14:41:19 CET 2016


Le 23/02/2016 14:21, Serge Steer a écrit :
> Please can you give more details :
> value of Order and Fcutoff/Fs/2
> and what you are doing with hz (because iir does not call dbphi)
> Serge
I am just running the example found in "how to design an elliptic 
filter". Here is the code:

Order    =  2;  // The order of the filter
Fs       =  1000;  // The sampling frequency
Fcutoff  =  40;    // The cutoff frequency

// We design a low pass elliptic filter
hz  =  iir <iir.html>(Order,'lp','ellip',[Fcutoff/Fs/2  0],[0.1  0.1]);

// We compute the frequency response of the filter
[frq,repf]=repfreq <repfreq.html>(hz,0:0.001:0.5);
[db_repf,  phi_repf]  =  dbphi <dbphi.html>(repf);

// And plot the bode like representation of the digital filter
subplot <subplot.html>(2,1,1);
plot2d <plot2d.html>(Fs*frq,db_repf);
xtitle <xtitle.html>('Obtained Frequency Response (Magnitude)');
subplot <subplot.html>(2,1,2);
plot2d <plot2d.html>(Fs*frq,phi_repf);
xtitle <xtitle.html>('Obtained Frequency Response (Phase in degree)');


with 'ellip' replaced by 'butt', and [Fcutoff/Fs/2 0] replaced 
byFcutoff/Fs/2.

I am beginning to use digital filters to treat some data. As my first 
step, I try to run the examples in the help,how to design an elliptic 
filter (using Scilab 5.5.1, Win7-64). This works . However, when I 
select a Butterworth filter:
>>          hz = iir(Order,'lp','butt',Fcutoff/Fs/2,[0.1 0.1]);
>> I get this error message:
>>
>> Singularité de la fonction log ou tan.
>> at line       6 of function dbphi called by :
>> [db_repf, phi_repf] = dbphi(repf);
>>
>> What did I miss ?
>> No bugs have been reported for function dbphi, but three similar bugs 
>> are listed for iir.
>> Any suggestion welcome.
>> JPGrivet

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20160223/db930667/attachment.htm>


More information about the users mailing list