Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function
transfer function realization from frequency response
[h [,err]]=frep2tf(frq,repf,dg [,dom,tols,weight])
vector of frequencies in Hz.
vector of frequency response
degree of linear system
time domain (
a vector of size 3 giving the relative and absolute tolerance and the maximum number of iterations (default values are
rtol=1.e-2; atol=1.e-4, N=10).
vector of weights on frequencies
SISO transfer function
error (for example if
sum(abs(h(2i*pi*frq) - rep)^2)/size(frq,*))
Frequency response to transfer function conversion. The order of
is a priori given in
dg which must be provided.
The following linear system is solved in the least square sense.
weight(k)*(n( phi_k) - d(phi_k)*rep_k)=0, k=1,..,n
phi_k= 2*%i*%pi*frq when
phi_k=exp(2*%i*%pi*dom*frq if not. If the
weight vector is not given a default
penalization is used (when
A stable and minimum phase system can be obtained by using function
Sys=ssrand(1,1,10); frq=logspace(-3,2,200); [frq,rep]=repfreq(Sys,frq); //Frequency response of Sys [Sys2,err]=frep2tf(frq,rep,10); Sys2=clean(Sys2) //Sys2 obtained from freq. resp of Sys [frq,rep2]=repfreq(Sys2,frq); //Frequency response of Sys2 clf(); bode(frq,[rep;rep2]) //Responses of Sys and Sys2 [gsort(spec(Sys('A'))), gsort(roots(Sys2('den')))] //poles