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

affiche_2_spectre.m
function affiche_2_spectre(X1,X)

e=ecran;
if e(1)<0
    e(1)=0;
end;
K=(0:1:length(X)-1)';
K1=(0:1:length(X1)-1)';
[ligne,col]=size(X);
[ligne1,col1]=size(X1);
figure(3)
set(gcf,'position',e)
somme=col+col1;
switch somme
    case 2
        subplot(2,1,1)
        spectre(K1,abs(X1),'b',2)
        v=axis;
        v(1:2)=[0,max(K1)/2];
        axis(v)
        xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
        ylabel('|X_k| (sauv)',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
          set(gca,'ButtonDownFcn',@fft_zoom)
        subplot(2,1,2)
        spectre(K,abs(X),'b',2)
        v=axis;
        v(1:2)=[0,max(K)/2];
        axis(v)
        xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
        ylabel('|X_k|',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
          set(gca,'ButtonDownFcn',@fft_zoom)
    case 3
        if col<col1
            subplot(3,1,1)
            spectre(K1,abs(X1(:,1)),'b',2)
            v=axis;
            v(1:2)=[0,max(K1)/2];
            axis(v)
            xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
            ylabel('|X_k| (voie 0, sauv)',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
              set(gca,'ButtonDownFcn',@fft_zoom)
            subplot(3,1,2)
            spectre(K1,abs(X1(:,2)),'b',2)
            v=axis;
            v(1:2)=[0,max(K1)/2];
            axis(v)
            xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
            ylabel('|X_k| (voie 1, sauv)',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
              set(gca,'ButtonDownFcn',@fft_zoom)
            subplot(3,1,3)
            spectre(K,abs(X),'b',2)
            v=axis;
            v(1:2)=[0,max(K)/2];
            axis(v)
            xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
            ylabel('|X_k|',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
              set(gca,'ButtonDownFcn',@fft_zoom)
        else
            subplot(3,1,1)
            spectre(K1,abs(X1),'b',2)
            v=axis;
            v(1:2)=[0,max(K1)/2];
            axis(v)
            xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
            ylabel('|X_k| (sauv)',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
              set(gca,'ButtonDownFcn',@fft_zoom)
            subplot(3,1,2)
            spectre(K,abs(X(:,1)),'b',2)
            v=axis;
            v(1:2)=[0,max(K1)/2];
            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)
            subplot(3,1,3)
            spectre(K,abs(X(:,2)),'b',2)
            v=axis;
            v(1:2)=[0,max(K)/2];
            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)
        end;
    case 4
        subplot(2,2,1)
        spectre(K1,abs(X1(:,1)),'b',2)
        v=axis;
        v(1:2)=[0,max(K1)/2];
        axis(v)
        xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
        ylabel('|X_k| (voie 0, sauv)',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
          set(gca,'ButtonDownFcn',@fft_zoom)
        subplot(2,2,2)
        spectre(K1,abs(X1(:,2)),'b',2)
        v=axis;
        v(1:2)=[0,max(K1)/2];
        axis(v)
        xlabel('k',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
        ylabel('|X_k| (voie 1, sauv)',...
               'fontunits','normalized','fontsize',0.03,'fontweight','bold')
          set(gca,'ButtonDownFcn',@fft_zoom)
        subplot(2,2,3)
        spectre(K,abs(X(:,1)),'b',2)
        v=axis;
        v(1:2)=[0,max(K)/2];
        axis(v)
        xlabel('k','fontunits','normalized','fontsize',0.03,'fontweight','bold')
        ylabel('|X_k| (voie 0)','fontunits','normalized','fontsize',0.03,'fontweight','bold')
          set(gca,'ButtonDownFcn',@fft_zoom)
         subplot(2,2,4)
        spectre(K,abs(X(:,2)),'b',2)
        v=axis;
        v(1:2)=[0,max(K)/2];
        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)
end;
        

Contact us