<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18812">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV style="FONT: 10pt arial"><FONT size=3>Hello. Not receiving answer from the
support team, and as suggested in an autoreply mail from <A
href="mailto:scilab@inria.fr ">scilab@inria.fr</FONT><FONT
size=3> </FONT></A><FONT size=3> (as well as from Antonelli),</FONT></DIV>
<DIV style="FONT: 10pt arial"><FONT size=3>I am forwarding you the following
message, hoping that someone of you can give me insight on this issue,
</FONT></DIV>
<DIV style="FONT: 10pt arial"><FONT size=3>and perhaps of contributing to the
improvement of the program.</FONT></DIV>
<DIV style="FONT: 10pt arial"><FONT size=3>Best regards,</FONT></DIV>
<DIV style="FONT: 10pt arial"><FONT size=3>--- Glauco Masotti</FONT></DIV>
<DIV> </DIV>
<DIV style="FONT: 10pt arial"><FONT size=3></FONT> </DIV>
<DIV style="FONT: 10pt arial">----- Original Message -----
<DIV style="BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> <A
title=glauco.masotti@alice.it href="mailto:glauco.masotti@alice.it">Glauco
Masotti</A> </DIV>
<DIV><B>To:</B> <A title=scilab.support@scilab.org
href="mailto:scilab.support@scilab.org">scilab.support@scilab.org</A> ; <A
title=scilab@inria.fr href="mailto:scilab@inria.fr">scilab@inria.fr</A> ; <A
title=antonelli@unicas.it
href="mailto:antonelli@unicas.it">antonelli@unicas.it</A> ; <A
title=chiaverini@unicas.it
href="mailto:chiaverini@unicas.it">chiaverini@unicas.it</A> </DIV>
<DIV><B>Sent:</B> Sunday, September 13, 2009 6:26 PM</DIV>
<DIV><B>Subject:</B> What's wrong with this?</DIV></DIV>
<DIV><BR></DIV>
<DIV><FONT face=Arial>Hello.<BR>I intended to use Scilab to design a digital
filter for a critical application.<BR>I am new to your program, thus I went
trough the documents available from your website: “Introduction to Scilab” and
“Signal Processing with Scilab”. </FONT></DIV>
<DIV><FONT face=Arial>I also found help in the document by Antonelli and
Chiaverini: “Introduzione a SCILAB 5.1”, in Italian.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial>I made some experiments with a relatively simple
filter architecture, conceived as the double difference of two couples of one
pole filters, i.e.:<BR>H(z) = (m4 - m3) - (m2 – m1), where each mi =
ai/(1-(1-ai)z^-1) is a filter with one real pole for z=ai (i.e. an exponential
moving average).<BR>I derived the exact transfer function crunching the algebra,
which I reported in the attached document “True0s.gif” . </FONT></DIV>
<DIV><FONT face=Arial>This is a screen shot of the program Graph, by Ivan
Johansen, which I used to find out where the true zeros of H(z) are located.
</FONT></DIV>
<DIV><FONT face=Arial>The attached documents report the case a1=0.99, a2= 0.98,
a3=0.97, a4=0.95.<BR>By inspection of H(z) it can be seen that, besides a double
0 for z=0, it has a zero for z=1, and, observing the graph of the second order
polynomial term, </FONT></DIV>
<DIV><FONT face=Arial>there are two real zeros close to the origin (at about
-0.045 and 0.025). It's also clear that H(z) preserves the poles at their
original locations, i.e. for z=a1, a2, a3, a4. </FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>The results which can be found using Scilab are very much
different! They are reported and summarized in the attached documents
“diff-diff.log” and “plzr(diff_diff)(0).gif”.<BR>According to Scilab the filter
has only 3 poles, thus a pole (at 0.98) has been canceled with a zero,
</FONT></DIV>
<DIV><FONT face=Arial>and the location of poles is somewhat different from the
original locations, </FONT><FONT face=Arial>with differences up to 0.3%.
</FONT></DIV>
<DIV><FONT face=Arial>The locations of zeros is even more surprising! There is
an error of 0.1% for the zero located at 1, plus a zero at 1.0446 is found, very
far from the true zeros, </FONT></DIV>
<DIV><FONT face=Arial>and also suggesting the filter is not minimum
phase!</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>The file “diff2-diff1.log” reports a variation on the
theme, where the magnitude response of the various filters is normalized for a
peak of 1. </FONT></DIV>
<DIV><FONT face=Arial>The response of these filters is shown in
“diff2-diff1.gif”. </FONT></DIV>
<DIV><FONT face=Arial>The green line should represent the correct response of
the double difference filter, as found by feeding Graph with the basic
expressions, </FONT></DIV>
<DIV><FONT face=Arial>whereas the blue line represent the response of the filter
outputted by Scilab. </FONT></DIV>
<DIV><FONT face=Arial>The response of the two filters is almost identical for x
(the normalized frequency) > 0.01, but is rather different at lower
frequencies.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Well, I may have been fooled by something, but can't
see what, so I assume that my algebra is correct. The results of Graph also
contradict the output from Scilab.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Therefore, how comes there are such big differences and
manifestly wrong results are found?<BR>Did I made something wrong in using
Scilab? Or did I hit a bug of the program?<BR>It doesn't look a problem of
numerical inaccuracy, the filter is relatively simple and the errors are too
big.<BR>I hope you can give me advice to deal with this, otherwise I will be
forced not to use Scilab and I will have much more work to do by using other
means.</FONT></DIV>
<DIV><FONT face=Arial></FONT> </DIV>
<DIV><FONT face=Arial>Best regards,</FONT></DIV>
<DIV><FONT face=Arial>--- Glauco Masotti</FONT></DIV>
<DIV><FONT face=Arial>Ravenna, ITALY</FONT></DIV>
<DIV><FONT face=Arial> </DIV></FONT></BODY></HTML>