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

fenetre_dB_bi.m
function [Kbi,Xbi]=fenetre_dB_bi(K,X,DEF,c);


m=DEF(9);
te=DEF(10);
N=2^m;
e=ecran;
if e(1)<0
    e(1)=0;
end;
Kbi=K-N/2;
[ligne,col]=size(X);
Xbi=zeros(ligne,col);
figure(2)
set(gcf,'position',e)
if col==1
Xbi=fftshift(X);
    Xmax=max(abs(X));
    XmaxdB=floor(log10(Xmax));
    precis=10^(XmaxdB-3);
    spectredb(Kbi,abs(Xbi),precis,'b',2)
    v=axis;
    v(1:2)=[-N/2 N/2-1];
    dx=v(2)-v(1);
    dy=v(4)-v(3);
    axis(v)
    xlabel('k','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    ylabel('|X_k|','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    s=['F.F.T. de x_n : N = ',num2str(2^m),' ; F_E = ',num2str(1/te),' Hz ; Rsolution : F_E/N = ',num2str(1/(2^m*te)),' Hz ; fentre : ',c];
    title(s,'fontunits','normalized','fontsize',0.03,'fontweight','bold')
    grid on
else
    Xbi(:,1)=fftshift(X(:,1));
    Xbi(:,2)=fftshift(X(:,2));
    subplot(2,1,1)
    Xmax=max(abs(X(:,1)));
    XmaxdB=floor(log10(Xmax));
    precis=10^(XmaxdB-3);
    spectredb(Kbi,abs(Xbi(:,1)),precis,'b',2)
    v=axis;
     v(1:2)=[-N/2 N/2-1];
    axis(v)
    xlabel('k','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    ylabel('|X_k| (voie 0)','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    s=['F.F.T. de x_n : N = ',num2str(2^m),' ; F_E = ',num2str(1/te),' Hz ; Rsolution : F_E/N = ',num2str(1/(2^m*te)),' Hz ; fentre : ',c];
    title(s,'fontunits','normalized','fontsize',0.03,'fontweight','bold')
    set(gca,'ButtonDownFcn',@fft_zoom)
    grid on
    subplot(2,1,2)
    Xmax=max(abs(X(:,2)));
    XmaxdB=floor(log10(Xmax));
    precis=10^(XmaxdB-3);
    spectredb(Kbi,abs(Xbi(:,2)),precis,'b',2)
    v=axis;
     v(1:2)=[-N/2 N/2-1];
    axis(v)
    xlabel('k','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    ylabel('|X_k| (voie 1)','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    set(gca,'ButtonDownFcn',@fft_zoom)
    grid on
end;     

hgcf=get(gcf,'child');
test=[];
lgcf=length(hgcf);
for kgcf=1:1:lgcf
    test=[test;strcmp(get(hgcf(kgcf),'type'),'uimenu')];
end
if ~any(test)
    hh=uimenu('label','SAUVER LE SPECTRE','foregroundcolor','r','callback','fft_sauve_spectre(X);');
    hh1=uimenu('label','AFFICHER 2 SPECTRES','foregroundcolor','r','callback','load(''X1.mat'');affiche_2_spectre(X1,X);');
    hh2=uimenu('label','VALEURS RAIES','foregroundcolor','r','callback','[MOG,preci,voie]=impression(MOG,K,X);');
    hh3=uimenu('label','CHANGER DE FENETRE','foregroundcolor','r','callback','delete(figure(2));[X,K]=fft_calcul(DEF,x);');
    hh4=uimenu('label','NOUVEAU SIGNAL','foregroundcolor','r',...
        'callback','delete(figure(1));delete(figure(2));[MOG,x,X,K]=fft_nouveau_signal(MOG,DEF);');
    hh5=uimenu('label','NOUVELLE FFT','foregroundcolor','r',...
        'callback','delete(figure(1));delete(figure(2));[MOG,DEF]=fft_page1(fe,m);');
end;
set(gcf,'toolbar','figure')
boutonchoix_echelle=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0,0.95,0.1,0.05],...
	    'string','Echelle linaire','foregroundcolor','r','fontunits','normalized','fontsize',0.4,'fontweight','bold',...
       'callback','delete(figure(2));[Kbi,Xbi]=fenetre_bi(K,X,DEF,c);');
bouton_spectrebi=uicontrol(gcf,'style','push','unit','normalized',...
		'position',[0,0.9,0.1,0.05],...
	    'string','Spectre monolatral','foregroundcolor','r','fontunits','normalized','fontsize',0.4,'fontweight','bold',...
       'callback','delete(figure(2));[K,X]=fenetre_dB(c,x,DEF);');

Contact us