[Scilab-users] New problems with "freson" in CACSD module

lucien.povy lucien.povy at free.fr
Wed Sep 25 16:06:00 CEST 2019


Hello all !
I believe that there are new problems with "freson.sci" program in CACSD 
module.
If you are running two programs, one for continuous system another for 
sampled system,
sometimes you have a result as [ ] : you must improve the accuracy of 
result ;("ffreson.sci" program is proposed).
(Bugs not bugs ???? yes bugs : see in text REMARK.

1 . Example : continuous system.
    s=%s ; num = s+1.4*s^2+1.4*s^3+0.4*s^4 ; den = 
0.5+0.8*s+1.4*s^2+1.4*s^3+0.4*s^4 ;
    h = syslin("c",num,den)
    fr = freson(h)
    fr =
         []
    gainplot(h,0.01,1)
    with my new function "ffreson.sci" :
    ffreson(h)//La nouvelle fonction.
    ans  =
             0.111164226146

2 . Example : sampled system.
    The exercise in "help" page of "freson" with sampling period 
Ts=0.01s : the program gives "fr=[]" .
    With sampling period Ts=0.04s you have a good result (problem of 
accuracy) : run the example in help
    and change sampling period.

3 . My opinion and the proposed solutions.

    - For continuous system :
    If you calculated the function "h(s)*h(-s)" by convolution, the 
result, as I mentioned before,
    must be an even rational : with "horner" it's not, but by 
convolution the result is OK. (take a look on "ffreson" program :
    you find a program "hps_hms" which gives "h(s)*h(-s)" by convolution).
    - After that, the numerator of "h(s)*h(-s)"derivative is calculated, 
this polynomial "der" must be odd (s=0 is a particular root of "der" 
which   corresponds to zero frequency). If you excluded this root from 
"der", the new polynomial is even, and you can solve
     the finding roots problem with a new polynomial in u=s*s as 
variable.If "rac" is the vector of square roots of this new polynomial, 
the vector "r", roots of "der", is r=[rac;-rac;0]. You divide by two the 
degree of "der" and increase the accuracy
     of the result : I use this method in my program.

     REMARK : If you run "freson" and "ffreson", step by step, when you 
calculated the roots of derivatives, the number of roots are not the 
same !!!  (see "Exemple freson.pdf").

     - For sampled system :
     - We calculated the function "hh=h(z)*h(1/z)", also with 
convolution, the result of convolution gives for coefficients vectors
     of "hh" a symmetric vector [c1,c2, ....cn], (for numerator and 
denominator), c1=cn, c2=c(n-1) etc ....see "hpz_hiz" at the end of 
function "ffreson.sci".
     - After that we take account of "z^(degree(h.num)-degree(h.den)) in 
"hh", and calculated the numerator of derivative of new
     "hh".
     - Like for continuous system, you excluded "z=1" and "z=-1", which 
corresponds to frequencies f0=0 and f1=1/*(2*ts) (Nyquist frequency).
     - At the end you calculated the roots "r" of new polynomial (the 
degree of polynomial decreases by two) . A "good" solution must respect 
"rp=exp(%i*%pi*fp*ts)"; so |rp|=1 and fp>0. The end of my new program is 
the same as "freson.sci".
     I use those methods in the new program "ffreson.sci".
     REMARK : the same.

     Yours sincerely
     lucien.povy at free.fr

     PS
     I attached the new function "ffreson.sci" and a report ("Exemples 
freson.pdf", sorry in french language) to my email.
     In "ffreson" you have two functions "hps_hms" for h(s)*h(-s) and  
"hpz_hiz" for h(z)*h(1/z).
     This program "ffreson" can be used for "iodelay systems", and " 
hps_hms" , "hpz_hiz" used in m_margin and p_margin
     to improve the accuracy of results.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Exemples freson.pdf
Type: application/pdf
Size: 46122 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20190925/f7cd6293/attachment.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffreson.sci
Type: application/x-scilab-sci
Size: 6926 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20190925/f7cd6293/attachment.bin>


More information about the users mailing list