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_calcul.m
function [X,K]=fft_calcul(DEF,x)



m=DEF(9);
te=DEF(10);
K=(0:1:2^m-1)';
figure(1)
e=ecran;
if e(1)<0
    e(1)=0;
end;
set(gcf,'position',e,'color','w')
switch DEF(8)
    case {0,1}
    stem(K,x,'linestyle','none','marker','o','markersize',2,'markerfacecolor','b')
    xlabel('n','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    ylabel('x_n','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    v=axis;
    v(2)=max(K);
    axis(v);
    grid on
    case 2
    subplot(2,1,1)
    stem(K,x(:,1),'linestyle','none','marker','o','markersize',2,'markerfacecolor','b')
    xlabel('n','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    ylabel('x_n  (voie 0)','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    v=axis;
    v(2)=max(K);
    axis(v);
    grid on
    subplot(2,1,2)
    stem(K,x(:,2),'linestyle','none','marker','o','markersize',2,'markerfacecolor','b')
    xlabel('n','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    ylabel('x_n  (voie 1)','fontunits','normalized','fontsize',0.03,'fontweight','bold')
    v=axis;
    v(2)=max(K);
    axis(v);
    grid on
end;
test=[];
hgcf=get(gcf,'child');
lgcf=length(hgcf);
for kgcf=1:1:lgcf
    test=[test;strcmp(get(hgcf(kgcf),'type'),'uimenu')];
end
if ~any(test)
h=uimenu('label','CALCUL FFT','foregroundcolor','r');
hp=uimenu('parent',h,'label','Fentre');
ht1=uimenu('parent',hp,'label','Rectangulaire','callback','c=get(gcbo,''label'');[K,X]=fenetre(c,x,DEF);');
ht2=uimenu('parent',hp,'label','Triangulaire (Bartlett)','callback','c=get(gcbo,''label'');[K,X]=fenetre(c,x,DEF);');
ht3=uimenu('parent',hp,'label','Hann','callback','c=get(gcbo,''label'');[K,X]=fenetre(c,x,DEF);');
ht4=uimenu('parent',hp,'label','Hamming','callback','c=get(gcbo,''label'');[K,X]=fenetre(c,x,DEF);');
ht5=uimenu('parent',hp,'label','Blackman','callback','c=get(gcbo,''label'');[K,X]=fenetre(c,x,DEF);');
ht6=uimenu('parent',hp,'label','Flattop','callback','c=get(gcbo,''label'');[K,X]=fenetre(c,x,DEF);');
h1=uimenu('label','NOUVEAU SIGNAL','foregroundcolor','r',...
        'callback','delete(figure(1));delete(figure(2));[MOG,x,X,K]=fft_nouveau_signal(MOG,DEF);');
    if DEF(8)~=0
        h2=uimenu('label','fermer modle','foregroundcolor','r',...
                'callback','close_system(gcs)');
    end;
end;
if DEF(8)<2
    X=zeros(uint32(2^m),1);
else
    X=zeros(uint32(2^m),DEF(8));
end;

Contact us