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

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


fe=fei;
MOG=zeros(2,8);
DEF=zeros(11,1);
DEF(6)=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';
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;
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.4,'ENREGISTREMENT','color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')
text(0.6,0.75,'CARACTERISTIQUES BRUIT','color','b','fontunits','normalized','fontsize',0.03,...
    'fontweight','bold','horizontalalignment','left',...
    'verticalalignment','middle','interpreter','Tex')

sf='Frquence d''horloge (Hz)';           
MOG(2,8)=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');
if DEF(10)==0
        fh=100;
else
    fh=DEF(10);
end;
sfh=num2str(fh);           
MOG(1,8)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.87 0.6 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',sfh,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','sfh=get(MOG(1,8),''string'');fh=str2num(sfh);DEF(10)=fh;');
sa='Valeur efficace (V)';           
MOG(2,6)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.4 0.5 0.45 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','string',sa,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
if DEF(7)==0
    svaleff='1';
else
    svaleff=num2str(DEF(7));
end;
MOG(1,6)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.87 0.5 0.1 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b',...
		'string',svaleff,'fontunits','normalized','fontsize',0.5,'fontweight','bold',...
		'callback','svaleff=get(MOG(1,6),''string'');valeff=str2num(svaleff);DEF(7)=valeff;');
sd='Dure enregistrement (s)';           
MOG(2,5)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.4 0.15 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.15 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;');
sf='Frquence d''chantillonnage (Hz)';           
MOG(2,4)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.4 0.25 0.45 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','string',sf,'fontunits','normalized','fontsize',0.5,'fontweight','bold');
if DEF(4)==0
        fe=1000;
else
    fe=1/DEF(4);
end;
sfe=num2str(fe);           
MOG(1,4)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.87 0.25 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;');

sdnum=get(MOG(1,1),'string');
DEF(1)=str2num(sdnum);
sdden=get(MOG(1,2),'string');
DEF(2)=str2num(sdden);
sc=get(MOG(1,3),'string');
DEF(3)=str2num(sc);
sfe=get(MOG(1,4),'string');
fe=str2num(sfe);
DEF(4)=1/fe;
sduree=get(MOG(1,5),'string');
D=str2num(sduree);
DEF(5)=D;
DEF(6)=1;
svaleff=get(MOG(1,6),'string');
DEF(7)=str2num(svaleff);
DEF(8)=round(DEF(5)/DEF(4)); 
sfh=get(MOG(1,8),'string');
DEF(10)=str2num(sfh);
DEF(9)=0;
inst1='[MOG,DEF,fe]=test_bb(MOG,DEF);M_bruit_blanc=gene_bb(DEF);';
inst2='DEF=val_init_bb(DEF);';
inst=[inst1,inst2];
%**************** 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',inst);
%
%
%*************** 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