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

📄 ui_fcluster.m

📁 基于Matlab
💻 M
字号:
% keep all variables local in scope
function [] = ui_fcluster();

% declare global variables
dfec_global; 
ui_private_global;

if get(h_fcluster,'Value')
   newparams;
   
   if isempty(fL)
      warn('No adaptation has been done yet.','Cannot display cluster diagram.');
   else

      % If external data use, plot only last 1000 points of adaptation
      if (data==3)
         figure(fig_fcluster);
         nn=(length(acluster)-1000):length(acluster);
         if real_source
            plot(real(acluster(nn)),'.');
            axis([0 1000 max(real(acluster))*[-1.1 1.1]]);
            xlabel('k');
            ylabel('z(k)');
         else
            plot(real(acluster(nn)),imag(acluster(nn)),'.');
            axis(max(real(acluster))*[-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(deltaL) ', SNR=' num2str(max(SNR))]);
         axis('square');

      % Otherwise, simulate
      else
         L=10000;
         a=make_src(cnstl_type,constellation,L);
         sig=10^(-max(SNR)/10);

         if (spacing==1)   
            n=make_noise(sig,real_noise,L);
            if (structure==1)
               z=filter(hL,[1; dL],a)+filter(fL,[1; dL],n);
            else
               z=filter(hL-ddL,1,a)+filter(fL,1,n);
            end;
         elseif (spacing==1/2)
            na=make_noise(sig,real_noise,L);
            nb=make_noise(sig,real_noise,L);
            if (structure==1)
               z=filter(hL,[1; dL],a)+...
                 filter(faL,[1; dL],na)+...
                 filter(fL,[1; dL],nb);
            else
               z=filter(hL-ddL,1,a)+...
                 filter(faL,1,na);
                 filter(fbL,1,nb);
            end;
         end;
         phiL=phi(length(phi)-1);
         v=z.*exp(-j*phiL);
         ss=ceil(0.2*L:0.8:L);
         CV=10*log10(mean(abs(z(ss)-a(ss-deltaL+1)).^2));
         z=z(ss);
         v=v(ss);

         figure(fig_fcluster);
         if real_source
            plot(real(z),'.');
            axis([0 10000 max(real(z))*[-1.1 1.1]]);
            xlabel('k');
            ylabel('z(k)');
         else
            plot(real(z),imag(z),'.',real(v),imag(v),'r.');
            legend('Equalizer output','Phase correction');
            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(deltaL) ', SNR=' num2str(max(SNR)) ...
	         ', CV=' num2str(CV) ' dB']);
         axis('square');
      end;       
   end;
else
   if ishandle(fig_fcluster), delete(fig_fcluster); end;
end;

⌨️ 快捷键说明

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