ui_chan.m

来自「基于Matlab」· M 代码 · 共 107 行

M
107
字号
% this plots the frequency responses 

 % keep all variables local in scope
 function [] = ui_resp();
 
 % declare global variables
 dfec_global; ui_private_global;

 w=(0:255)'/256;
 if get(h_resp,'Value')
    figure(fig_chan);
    if (isreal(c))

       if (spacing==1)
          subplot(1,3,1); stemy(c);
          title('Channel IR'); 
          axis('square');
          axis('tight');

          subplot(1,3,2); semilogy(w,abs(C));
          axis('tight');
          title('Channel FR (Mag)'); 
          xlabel('f');
          axis('square');
          subplot(1,3,3); plot(w,unwrap(angle(C)));
          axis('tight');
          title('Channel FR (Phase)'); 
          xlabel('w');
          axis('square');

        elseif (spacing==1/2)
          subplot(2,2,1); stemy(ca);
          axis('tight');
          title('Subchannel (a) IR'); 
          subplot(2,2,2); stemy(cb); 
          axis('tight');
          title('Subchannel (b) IR'); 

          subplot(2,2,3); semilogy(w,abs(Ca),w,abs(Cb),'r--'); 
          axis('tight');
          legend('(a)','(b)');
          title('Subchannels FR (Mag)'); 
          xlabel('f');
          subplot(2,2,4); plot(w,unwrap(angle(Ca)),w,unwrap(angle(Cb)),'r--'); 
          axis('tight');
          legend('(a)','(b)');
           title('Subchannels FR (Phase)'); 
          xlabel('f');
        end;
   else
      if (spacing==1)
         subplot(2,2,1); stemy(real(c));
         axis('tight');
         title('Channel IR (Re)'); 
         subplot(2,2,2); stemy(imag(c)); 
         axis('tight');
         title('Channel IR (Im)'); 

         subplot(2,2,3); semilogy(w,abs(C));
         axis('tight');
         title('Channel FR (Mag)'); 
         xlabel('f');
         subplot(2,2,4); plot(w,unwrap(angle(C)));
         axis('tight');
         title('Channel FR (Phase)'); 
         xlabel('f');

     elseif (spacing==1/2);

         subplot(3,2,1); stemy(real(ca));
         axis('tight');
         title('Subchannel (a) IR (Re)'); 
         subplot(3,2,2); stemy(imag(ca)); 
         axis('tight');
         title('Subchannel (a) IR (Im)'); 

         subplot(3,2,3); stemy(real(cb));
         axis('tight');
         title('Subchannel (b) IR (Re)'); 
         xlabel('f');
         subplot(3,2,4); stemy(imag(cb)); 
         axis('tight');
         title('Subchannel (b) IR (Im)'); 
         xlabel('f');

         subplot(3,2,5); semilogy(w,abs(Ca),w,abs(Cb),'r--'); 
         axis('tight');
         legend('(a)','(b)');
         title('Subchannels FR (Mag)'); 
         xlabel('f');
         subplot(3,2,6); plot(w,unwrap(angle(Ca)),w,unwrap(angle(Cb)),'r--'); 
         axis('tight');
         legend('(a)','(b)');
         title('Subchannels FR (Phase)'); 
         xlabel('f');
    end;      
  end;
 else
    if ishandle(fig_chan), delete(fig_chan); end;
 end;






⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?