Code covered by the BSD License  

Highlights from
Logiciels temps réel

Logiciels temps réel

by

 

Real-time software concerning the domains of the signal processing, feedback and regulation

S=factorisation(P)
function S=factorisation(P)



S=[];
r=roots(P);
lr=length(r);
pr=[];
pc=[];
nn=0;
for k=1:1:lr
    if isreal(r(k))
        if r(k)==0
            nn=nn+1;
        else
            pr=[pr,r(k)];
        end;
    else
        lpc=length(pc);
        conjugue=0;
        for kpc=1:1:lpc
            if conj(r(k))==pc(kpc)
                conjugue=1;
            end;
        end;
        if ~conjugue
            pc=[pc,r(k)];
        end;
    end;
end;
cste_tps=-1./pr;
n1=length(cste_tps);
if isempty(pc)
    n2=0;
else
    w0=abs(pc);
    z=-real(pc)./w0;
    n2=length(pc);
end;
for kn=1:1:n1
    p1=[cste_tps(kn),1];
    S=[S,'(',num2str(p1(1)),'.p + 1)'];
end;
for kn=1:1:n2
    %p2=[1/w0(kn)^2,2*z(kn)/w0(kn),1];
    %S=[S,'(',num2str(p2(1)),'.p^2 + ',num2str(p2(2)),'.p + 1)'];
    p2=[w0(kn),z(kn)];
    S=[S,'(','p^2/',num2str(p2(1)),'^2 + 2*',num2str(p2(2)),'*p/',num2str(p2(1)),' + 1)'];
end;

        

Contact us