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

ident_param_ret.m
function [MOG,DEF,fe]=ident_param_ret(fei)


fe=fei;
MOG=zeros(2,7);
DEF=zeros(9,1);
figure(1)
e=ecran;
if e(1)<0
    e(1)=0;
end;
set(gcf,'position',e)
set(gcf,'unit','normalized','color','w')
grid off
set(gca,'xcolor','w','ycolor','w')
pause(0.1)
s='Identification d''un processus d''ordre n+k, classe k, avec retard T (rponse indicielle)';
text(0.5,0.95,s,'color','r','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','center','verticalalignment','middle')
s='              a_0 + a_1.p + ... + a_m.p^m';
text(0.4,0.9,s,'color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')
s='            p^k.(1 + b_1.p + ... + b_n.p^n)';
text(0.4,0.84,s,'color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')
s='T(p) = ';
for k=1:1:35
    s=[s,'-'];
end;
s=[s,'.e^{-T.p}'];
text(0.4,0.875,s,'color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')
text(0.05,0.75,'PROCESSUS','color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')
snum='degr numrateur (m)';           
MOG(2,1)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.02 0.6 0.2 0.05],'backgroundcolor','y',...
	           'foregroundcolor','b','string',snum,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sdnum='0';           
MOG(1,1)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.24 0.6 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',sdnum,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','sdnum=get(MOG(1,1),''string'');d_num=str2num(sdnum);DEF(1)=d_num;');
sden='degr dnominateur (n)';           
MOG(2,2)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.02 0.5 0.2 0.05],'backgroundcolor','y',...
	           'foregroundcolor','b','string',sden,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sdden='1';           
MOG(1,2)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.24 0.5 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',sdden,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','sdden=get(MOG(1,2),''string'');d_den=str2num(sdden);DEF(2)=d_den;');
sclasse='classe (k)';           
MOG(2,3)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.02 0.4 0.2 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','string',sclasse,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sc='0';           
MOG(1,3)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.24 0.4 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',sc,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','sc=get(MOG(1,3),''string'');classe=str2num(sc);DEF(3)=classe;');


text(0.6,0.75,'ENREGISTREMENT','color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')

sf='Frquence d''chantillonnage (Hz)';           
MOG(2,4)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.4 0.6 0.45 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','string',sf,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sfe=num2str(fe);           
MOG(1,4)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.87 0.6 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',sfe,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','sfe=get(MOG(1,4),''string'');fe=str2num(sfe);DEF(4)=1/fe;');
sd='Dure enregistrement (s)';           
MOG(2,5)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.4 0.5 0.45 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','string',sd,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
sduree='1';           
MOG(1,5)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.87 0.5 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',sduree,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','sduree=get(MOG(1,5),''string'');D=str2num(sduree);DEF(5)=D;');
    
    
text(0.6,0.4,'SYNCHRONISATION','color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')

sniv='Niveau synchro (V)';           
MOG(2,6)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.4 0.3 0.45 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','string',sniv,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
slevel='0.5';           
MOG(1,6)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.87 0.3 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',slevel,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','slevel=get(MOG(1,6),''string'');niveau=str2num(slevel);DEF(6)=niveau;');
ss='sens (+1=croissant ; -1 =dcroissant)';           
MOG(2,7)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.4 0.2 0.45 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','string',ss,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
ssens='+1';           
MOG(1,7)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.87 0.2 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',ssens,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','ssens=get(MOG(1,7),''string'');sens=str2num(ssens);DEF(7)=sens;');

sdnum=get(MOG(1,1),'string');
DEF(1)=str2double(sdnum);
sdden=get(MOG(1,2),'string');
DEF(2)=str2double(sdden);
sc=get(MOG(1,3),'string');
DEF(3)=str2double(sc);
sfe=get(MOG(1,4),'string');
fe=str2double(sfe);
DEF(4)=1/fe;
sduree=get(MOG(1,5),'string');
D=str2double(sduree);
DEF(5)=D;
slevel=get(MOG(1,6),'string');
niveau=str2double(slevel);
DEF(6)=niveau;
ssens=get(MOG(1,7),'string');
sens=str2double(ssens);
DEF(7)=sens;
DEF(8)=round(DEF(5)/DEF(4)); 
DEF(9)=round(1.1*DEF(8));
%**************** Bouton "OK" de validation
boutonok=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.8 0.05 0.1 0.1],...
	    'string','OK','foregroundcolor','r','fontunits','normalized','fontsize',0.4,'fontweight','bold',...
        'callback','[MOG,DEF,fe]=test_parametres(MOG,DEF);lance_acquisition_ret(DEF);');

%
%
%*************** bouton "FIN" : sortie du logiciel    
boutonfin=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.1 0.05 0.1 0.1],...
	    'string','FIN','foregroundcolor','r','fontunits','normalized','fontsize',0.4,'fontweight','bold',...
         'callback','fin;cd ..;liste_logiciels;');
    
    

Contact us