⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 impu.m

📁 基于Matlab
💻 M
字号:
% this plots the impulse responses 

 % keep all variables local in scope
 function [] = impu(c,spacing,f,dd,h,q,fa,fb,Nd,delta,SNR);
 

    if (((spacing==1) & isreal(f) & isreal(dd)) |... 
        ((spacing==0.5) & isreal(fa) & isreal(fb) & isreal(dd)))

       if (spacing==1)
          subplot(2,2,1); stemy(f);
          axis('tight');
          title(['BSE: Nf=' num2str(length(f))]);
 
          ax=[0 length(h)+1 -max(abs(h)) max(abs(h))+eps];
          subplot(2,2,2); stemy(dd);
          axis(ax); 
          axis('tight');
          title(['DFE: Nd=' num2str(Nd)]);
 
          subplot(2,2,3); stemy(h);
          axis(ax);
          axis('tight');
          title(['Channel-BSE: \delta=' num2str(delta)]);

          subplot(2,2,4); stemy(q);
          axis(ax); 
          axis('tight');
          title(['Channel-BSE+DFE: SNR=' num2str(SNR)]);

       elseif (spacing==1/2)
          subplot(2,3,1); stemy(fa);
          axis('tight');
          title(['Subequalizer (a): Nfa=' num2str(length(fa))]);

          subplot(2,3,2); stemy(fb);
          axis('tight');
          title(['Subequalizer (b): Nfb=' num2str(length(fb))]);

          ax=[0 length(h)+1 -max(abs(h)) max(abs(h))+eps];
          subplot(2,3,3); stemy(dd);
          axis(ax); 
          axis('tight');
          title(['DFE: Nd=' num2str(Nd)]);

          subplot(2,2,3); stemy(h);
          axis(ax);
          axis('tight');
          title(['Channel-FSE: \delta=' num2str(delta)]);

          subplot(2,2,4); stemy(q);
          axis(ax); 
          axis('tight');
          title(['Channel-FSE+DFE: SNR=' num2str(SNR)]);
       end;

    else
       if (spacing==1)
          x=zeros(10*length(f),1);
          x(1:10:10*length(f))=f;
          subplot(2,2,1); plot3(1:length(f),imag(f),real(f),'o'); hold on; 
          plot3(1+1/10*(0:10*length(f)-1),imag(x),real(x),'r'); hold off
          axis([0 length(f) max(abs(f))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['BSE: Nf=' num2str(length(f))]);
          rotate3d on

          x=zeros(10*length(dd),1);
          x(1:10:10*length(dd))=dd;
          subplot(2,2,2); plot3(1:length(dd),imag(dd),real(dd),'o'); hold on; 
          plot3(1+1/10*(0:10*length(dd)-1),imag(x),real(x),'r'); hold off
          axis([0 length(dd) max(abs(h))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['DFE: Nd=' num2str(Nd)]);
          rotate3d on

          x=zeros(10*length(h),1);
          x(1:10:10*length(h))=h;
          subplot(2,2,3); plot3(1:length(h),imag(h),real(h),'o'); hold on; 
          plot3(1+1/10*(0:10*length(h)-1),imag(x),real(x),'r'); hold off
          axis([0 length(h) max(abs(h))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['Channel-BSE: \delta=' num2str(delta)]);
          rotate3d on

          x=zeros(10*length(q),1);
          x(1:10:10*length(q))=q;
          subplot(2,2,4); plot3(1:length(q),imag(q),real(q),'o');
          hold on; 
          plot3(1+1/10*(0:10*length(q)-1),imag(x),real(x),'r'); hold off
          axis([0 length(q) max(abs(q))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['Channel-BSE+DFE: SNR=' num2str(SNR)]);
          rotate3d on

       elseif (spacing==1/2)

          x=zeros(10*length(fa),1);
          x(1:10:10*length(fa))=fa;
          subplot(2,3,1); plot3(1:length(fa),imag(fa),real(fa),'o'); hold on; 
          plot3(1+1/10*(0:10*length(fa)-1),imag(x),real(x),'r'); hold off
          axis([0 length(fa) max(abs(fa))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['Subequalizer (a): Nfa=' num2str(length(fa))]);
          rotate3d on

          x=zeros(10*length(fb),1);
          x(1:10:10*length(fb))=fb;
          subplot(2,3,2); plot3(1:length(fb),imag(fb),real(fb),'o'); hold on; 
          plot3(1+1/10*(0:10*length(fb)-1),imag(x),real(x),'r'); hold off
          axis([0 length(fb) max(abs(fb))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['Subequalizer (b): Nfb=' num2str(length(fb))]);
          rotate3d on

          x=zeros(10*length(dd),1);
          x(1:10:10*length(dd))=dd;
          subplot(2,3,3); plot3(1:length(dd),imag(dd),real(dd),'o'); hold on; 
          plot3(1+1/10*(0:10*length(dd)-1),imag(x),real(x),'r'); hold off
          axis([0 length(dd) max(abs(h))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['DFE: Nd=' num2str(Nd)]);
          rotate3d on

          x=zeros(10*length(h),1);
          x(1:10:10*length(h))=h;
          subplot(2,2,3); plot3(1:length(h),imag(h),real(h),'o'); hold on; 
          plot3(1+1/10*(0:10*length(h)-1),imag(x),real(x),'r'); hold off
          axis([0 length(h) max(abs(h))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['Channel-FSE: \delta=' num2str(delta)]);
          rotate3d on

          x=zeros(10*length(q),1);
          x(1:10:10*length(q))=q;
          subplot(2,2,4); plot3(1:length(q),imag(q),real(q),'o');
          hold on; 
          plot3(1+1/10*(0:10*length(q)-1),imag(x),real(x),'r'); hold off
          axis([0 length(q) max(abs(q))*[-1 1 -1 1]]);
          ylabel('Im');
          zlabel('Re');
          grid
          title(['Channel-FSE+DFE: SNR=' num2str(SNR)]);
          rotate3d on
      end;
   end;

⌨️ 快捷键说明

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