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

fft_page1.m
function [MOG,DEF,s]=fft_page1(fe,m)

%   Permet de dfinir :
%           - fe
%           - m
%           - le type d'tude (signal programm ou signaux rels)
%
%   MOG : matrice des objets graphiques (matrices 4 lignes x 7 colonnes)
%           ligne 1 : "handles" des cases EDIT
%           ligne 2 : "handles" de type TEXT
%           ligne 3 : "handles" des POPUP
%           ligne 4 : "handles" des ANNOTATIONS



MOG=zeros(4,7);
DEF=zeros(11,1);
s='';
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')
text(0.5,0.95,'PARAMETRES FFT :','color','r','fontunits','normalized','fontsize',0.03,'fontweight','bold',...
    'horizontalalignment','center','verticalalignment','middle')
etude=0;
if isempty(fe)   
    fe=1e3;
end;
fes=num2str(fe);
te=1/fe;
if isempty(m)   
    m=10;
end;
ms=num2str(m);
N=2^m;
%********************la fonction affiche_N permet d'actualiser le valeur de
%********************N en fonction de m
affiche_N(N);
%********************Choix de fe
sfreq='Frquence d''chantillonnage Fe (Hz) =';           
MOG(2,1)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.1 0.7 0.4 0.05],'backgroundcolor','y',...
	           'foregroundcolor','b','string',sfreq,'fontunits','normalized','fontsize',0.6,'fontweight','bold');
MOG(1,1)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.6 0.7 0.3 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','max',1,...
		'string',fes,'fontunits','normalized','fontsize',0.6,'fontweight','bold',...
		'callback','fes=get(MOG(1,1),''string'');fe=str2num(fes);DEF(10)=1/fe;');
%*******************Choix de m    
 snb='Nombre de points N=2^m . Exposant m =';           
MOG(2,2)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.1 0.6 0.4 0.05],'backgroundcolor','y',...
	           'foregroundcolor','b','string',snb,'fontunits','normalized','fontsize',0.6,'fontweight','bold');
MOG(1,2)=uicontrol(gcf,'style','edit','unit','normalized',...
		'position',[0.6 0.6 0.3 0.05],'backgroundcolor','y',...
	    'foregroundcolor','b','max',1,...
		'string',ms,'fontunits','normalized','fontsize',0.6,'fontweight','bold',...
		'callback','ms=get(MOG(1,2),''string'');m=str2num(ms);N=2^m;affiche_N(N);DEF(9)=m;');
%******************* Actualisation de N  
   sN='Soit N = ';           
MOG(2,3)=uicontrol(gcf,'style','text','unit','normalized',...
		'position',[0.1 0.5 0.4 0.05],'backgroundcolor','w',...
	           'foregroundcolor','k','string',sN,'fontunits','normalized','fontsize',0.6,'fontweight','bold',...
               'horizontalalignment','right');
%****************** Menu droulant (popup)
%****************** choix du type d'tude :
%******************         signal programm
%******************         signal rel (1 voie)
%******************         signaux rels (2 voies : influence filtre
%                                          antirepliement)
texte={'';'Simulation : signal programm';'Acquisition d''un signal rel';'Acquisition de 2 signaux rels'};  
MOG(2,4)=uicontrol(gcf,'style','text','unit','normalized',...
		            'position',[0.1 0.35 0.4 0.05],'backgroundcolor','w',...
	                'foregroundcolor','r','fontunits','normalized','fontsize',0.6,'fontweight','bold','string','TYPE D''ETUDE');                
MOG(3,1)=uicontrol(gcf,'style','popupmenu','unit','normalized',...
                    'position',[0.1,0.3,0.4,0.05],'backgroundcolor','y',...
                    'foregroundcolor','b','fontunits','normalized','fontsize',0.6,'fontweight','bold','string',texte,...
                    'callback','etude=get(MOG(3,1),''value'');DEF(11)=etude;');
%**************** Bouton "OK" de validation
boutonok=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.6 0.1 0.1 0.1],...
	    'string','OK','foregroundcolor','r','fontunits','normalized','fontsize',0.5,'fontweight','bold',...
        'callback','[MOG,DEF,x]=avertissement(MOG);');
%Le bouton OK lance la fonction "avertissement" : on ne peut pas continuer
%si on n'a pas choisi le type d'tude
%
%
%*************** bouton "FIN" : sortie du logiciel    
boutonfin=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0.1 0.1 0.1 0.1],...
	    'string','FIN','foregroundcolor','r','fontunits','normalized','fontsize',0.5,'fontweight','bold',...
         'callback','delete(gcf);cd ..;liste_logiciels');
   

Contact us