ui_cluster.m

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

M
50
字号
% keep all variables local in scope
function [] = ui_cluster();

% declare global variables
dfec_global; 
ui_private_global;

if get(h_cluster,'Value')
   newparams;
   L=10000;
   
   a=make_src(cnstl_type,constellation,L);
   N=sqrt(Ms/4);
   sig=10^(-max(SNR)/10);

   if (spacing==1)   
      n=make_noise(sig,real_noise,L);
      w=filter(f,1,n);
   elseif (spacing==1/2)
      na=make_noise(sig,real_noise,L);
      nb=make_noise(sig,real_noise,L);
      w=filter(fa,1,na)+filter(fb,1,nb);
   end;
   z=filter(h-dd,1,a)+w;
   ss=ceil(0.2*L:0.8:L);
   CV=10*log10(mean(abs(z(ss)-a(ss-delta+1)).^2));
   z=z(ss);

   figure(fig_cluster);
   if real_source
      plot(real(z),'.');
      xlabel('k');
      ylabel('z(k)');
   else
      plot(real(z),imag(z),'.');
      axis(max(real(z))*[-1.1 1.1 -1.1 1.1]);
      xlabel('Re');
      ylabel('Im');
      grid
   end;
   title(['Cluster Plot: Nf=' num2str(Nf) ', Nd=' num2str(Nd) ...
           ', \delta=' num2str(delta) ', SNR=' num2str(max(SNR)) ...
	   ', CV=' num2str(CV) ' dB']);

   axis('square');

else
   if ishandle(fig_cluster), delete(fig_cluster); end;
end;

⌨️ 快捷键说明

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