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

etude.m
nmin=floor(log10(min([FA,FP])/10));
nmax=ceil(log10(max([FA,FP])*10));
f=logspace(nmin,nmax,10000);
[ligne,col]=size(denfinal);

switch type_etude
case 2
    switch type_de_filtre
        case {'PL','PH'}
            ordre_reel=ordre;
        case 'PB'
            ordre_reel=2*ordre;
    end;
    open_system([pwd,'\transfert'])
    nom_systeme=get_param(gcs,'name');
    bloc=[nom_systeme,'/fct transfert'];
   
    taille=32;
    set_param(bloc,'fontsize',taille)
    set_param(gcs,'location',ecran,'zoomfactor','fitsystem')
    pause
     save_system('transfert')
    close_system('transfert')
case 3
    w=2*pi*f;
    g=20*log10(abs(polyval(NUM,1i*w)./polyval(DEN,1i*w)));
    figure(3)
    set(gcf,'color','w')
    semilogx(f,g,'b','linewidth',2);
    hold on
    v=axis;
    switch type_de_filtre
    case 'PL'
    semilogx([v(1),FP],[Amax,Amax],'r','linewidth',2)
    semilogx([FP,FP],[v(3),Amax],'r','linewidth',2)
    semilogx([FA,v(2)],[Amin,Amin],'r','linewidth',2)
    semilogx([FA,FA],[v(4),Amin],'r','linewidth',2)
    semilogx(f,g,'b','linewidth',2);
    case 'PH'
    semilogx([v(1),FA],[Amin,Amin],'r','linewidth',2)
    semilogx([FA,FA],[v(4),Amin],'r','linewidth',2)
    semilogx([FP,v(2)],[Amax,Amax],'r','linewidth',2)
    semilogx([FP,FP],[v(3),Amax],'r','linewidth',2)
    semilogx(f,g,'b','linewidth',2);
    case 'PB'
    semilogx([v(1),FA(1)],[Amin,Amin],'r','linewidth',2)
    semilogx([FA(1),FA(1)],[v(4),Amin],'r','linewidth',2)
    semilogx([FP(1),FP(2)],[Amax,Amax],'r','linewidth',2)
    semilogx([FP(1),FP(1)],[v(3),Amax],'r','linewidth',2)
    semilogx([FP(2),FP(2)],[v(3),Amax],'r','linewidth',2)
    semilogx([v(2),FA(2)],[Amin,Amin],'r','linewidth',2)
    semilogx([FA(2),FA(2)],[v(4),Amin],'r','linewidth',2)
    semilogx(f,g,'b','linewidth',2);
    end;
    grid on
    figure(4)
    set(gcf,'color','w')
    phi=angle(polyval(NUM,1i*w)./polyval(DEN,1i*w))*180/pi;
    phi=dephasage_continu(phi);
    semilogx(f,phi,'b','linewidth',2);
    grid on
case 4
    t=0:1e-5/min(f):1/min(f);
    ind=step(fct,t);
    figure(5)
    set(gcf,'color','w')
    plot(t,ind,'linewidth',2)
    grid on
    title('Rponse indicielle')
case 5
    t=0:1e-5/min(f):1/min(f);
    imp=impulse(fct,t);
    figure(6)
    set(gcf,'color','w')
    plot(t,imp,'linewidth',2)
    grid on
    title('Rponse impulsionnelle')
case 6
    figure(7) 
    set(gcf,'color','w')
    [z,p,k]=tf2zp(NUM,DEN);
    long=length(p);
    for kp=1:1:long
        polar(angle(p(kp)),abs(p(kp)),'xb')
        hold on
        end
    long=length(z)
    for kz=1:1:long;
        polar(angle(z(kz)),abs(z(kz)),'or')
        hold on
    end;   
    M=max(abs(p));
    propriete=get(gca,'child');
    set(propriete,'linewidth',2)
    set(propriete,'markersize',10)
    title('Positions des poles et zros')
    vp=axis;
    text(1.25*vp(2)/sqrt(2),-vp(2)/sqrt(2),'x : poles',...
        'fontunits','normalized','fontsize',0.04,'fontweight','bold','color','b')
    text(1.25*vp(2)/sqrt(2),-1.25*vp(2)/sqrt(2),'o : zeros',...
        'fontunits','normalized','fontsize',0.04,'fontweight','bold','color','r')
    text(M/10,0,[num2str(long),' zros'],...
        'fontunits','normalized','fontsize',0.04,'fontweight','bold','color','r')
case 7
    switch type_de_filtre
    case 'PL'
            simulation_pl(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,0,type_etude);
    case 'PH'
            simulation_ph(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,0,type_etude);
     case 'PB'
             simulation_pb(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,0,type_etude);
    end;
case 8
    texte4={'','Srie E6 (20 %)','Srie E12 (10 %)','Srie E24 (5 %)','Srie E48 (2 %)','Srie E96 (1 %)'};
    txt_precision=uicontrol(gcf,'style','text',...
        'unit','normalized',...
		'position',[0.6 0.475 0.30 0.05],...
        'backgroundcolor','w',...
	     'foregroundcolor','b','fontunits','normalized','fontsize',0.4,...
         'fontweight','bold','string','PRECISION DES COMPOSANTS');    

    pop_precision=uicontrol(gcf,'style','popupmenu',...
        'unit','normalized',...
        'position',[0.6,0.3,0.3,0.2],...
        'backgroundcolor','y',...
        'foregroundcolor','b',...
        'fontweight','bold','string',texte4,...
         'callback','serie=get(pop_precision,''value'');R0n=val_norm(R0,serie);C0n=val_norm(C0,serie);R1n=val_norm(R1,serie);R2n=val_norm(R2,serie);C1n=val_norm(C1,serie);C2n=val_norm(C2,serie);RPn=val_norm(RP,serie);CPn=val_norm(CP,serie);simulation_normalise(R0n,C0n,R1n,R2n,RPn,CPn,C1n,C2n,A0,FT,S,VCC,RID,RS,type_de_filtre,type_etude)');                
    case 9
    texte4={'','Srie E6 (20 %)','Srie E12 (10 %)','Srie E24 (5 %)','Srie E48 (2 %)','Srie E96 (1 %)'};
    txt_precision=uicontrol(gcf,'style','text',...
        'unit','normalized',...
		'position',[0.6 0.475 0.30 0.05],...
        'backgroundcolor','w',...
	    'foregroundcolor','b','fontunits','normalized','fontsize',0.4,...
        'fontweight','bold','string','PRECISION DES COMPOSANTS');    

    pop_precision=uicontrol(gcf,'style','popupmenu',...
        'unit','normalized',...
         'position',[0.6,0.3,0.3,0.2],'backgroundcolor','y',...
         'foregroundcolor','b','fontweight','bold','string',texte4,...
          'callback','analyse_monte_carlo');                    

    case 10
         switch type_de_filtre
        case 'PL'
            simulation_pl(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,0,type_etude);
        case 'PH'
            simulation_ph(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,0,type_etude);
        case 'PB'
             simulation_pb(R0,C0,R1,R2,RP,CP,C1,C2,A0,FT,S,VCC,RID,RS,0,type_etude);            
    end;
end;


Contact us