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

affich_coeff(NUM,DEN,DEF)
function affich_coeff(NUM,DEN,DEF)

h=get(0,'child');
k=find(h==3);
if ~isempty(k)
    delete(h(k));
end;
figure(3)
e=ecran;
if e(1)<0
    e(1)=0;
end;
set(gcf,'position',e)
set(gcf,'unit','normalized')
set(gcf,'color','w')
grid off
set(gca,'xcolor','w','ycolor','w')
pause(0.5)
if ~isempty(NUM)
    switch DEF(2)
        case 2
           s1=['FILTRE R.I.F.     (F_E = ',num2str(1/DEF(1)),' Hz )'];
           s2='H(z) = a_0 + a_1.z^{-1} + a_2.z^{-2} + ... +a_P.z^{-P}';
           text(0.5,0.95,s1,'color','r','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                'horizontalalignment','center','verticalalignment','middle','interpreter','Tex')
            text(0.5,0.875,s2,'color','b','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                'horizontalalignment','center','verticalalignment','middle','interpreter','Tex')
            posy=0.85;
            posx=0.0;
            for k=1:1:length(NUM)
                posy=posy-0.05;
                if posy<0
                    posy=0.80;
                    posx=posx+0.15;
                end;
                s=['a_{',num2str(k-1),'} = ',num2str(NUM(k),'% +12.5e')];
                text(posx,posy,s,'color','k','fontunits','normalized','fontsize',0.02,'fontweight','bold',...
                'horizontalalignment','left','interpreter','Tex')
            end;
          
        case 3
            if ~isempty(DEN)
                 s1=['FILTRE R.I.I.     (F_E = ',num2str(1/DEF(1)),' Hz )'];
                text(0.5,0.95,s1,'color','r','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                'horizontalalignment','center','verticalalignment','middle','interpreter','Tex')
                s2='a_0 + a_1.z^{-1} + a_2.z^{-2} + ... +a_P.z^{-P}';
                s3='b_0 + b_1.z^{-1} + b_2.z^{-2} + ... +b_Q.z^{-Q}';
                s4='H(z) = ';
                h4=text(0.3,0.8,s4,'color','b','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                'horizontalalignment','left','verticalalignment','middle','interpreter','Tex');
                P4=get(h4,'extent'); 
                h2=text(0.3+P4(3),0.85,s2,'color','b','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                'horizontalalignment','left','verticalalignment','middle','interpreter','Tex');
                h3=text(0.3+P4(3),0.75,s3,'color','b','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                'horizontalalignment','left','verticalalignment','middle','interpreter','Tex');
                h5=text(0.3+P4(3),0.8,'-','color','b','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                'horizontalalignment','left','verticalalignment','middle','interpreter','Tex');
                P5=get(h5,'extent');
                P2=get(h2,'extent');
                while P5(1)<P2(1)+P2(3);
                    h5=text(P5(1)+0.01,0.8,'-','color','b','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
                    'horizontalalignment','left','verticalalignment','middle','interpreter','Tex');
                     P5=get(h5,'extent');
                end;
                posy=0.7;
                posx=0.0;
                for k=1:1:length(NUM)
                    posy=posy-0.05;
                    if posy<0
                        posy=0.65;
                        posx=posx+0.15;
                    end;
                s=['a_{',num2str(k-1),'} = ',num2str(NUM(k),'% +12.5e')];
                text(posx,posy,s,'color','k','fontunits','normalized','fontsize',0.02,'fontweight','bold',...
                'horizontalalignment','left','interpreter','Tex')
                end;
                posy=0.7;
                posx=0.5;
                for k=1:1:length(DEN)
                    posy=posy-0.05;
                    if posy<0
                        posy=0.65;
                        posx=posx+0.15;
                    end;
                s=['b_{',num2str(k-1),'} = ',num2str(DEN(k),'% +12.5e')];
                text(posx,posy,s,'color','k','fontunits','normalized','fontsize',0.02,'fontweight','bold',...
                'horizontalalignment','left','interpreter','Tex')
                end;
            end;
    end;
end;

Contact us