clc; clear; close all; tic; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot setting %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% file path FilePath = '.\'; %% Plot coeffcients AmpFactor = 2; FontName = 'Times New Roman'; % FontName = 'Arial'; FontSize = 9*AmpFactor; MarkSize = 6*AmpFactor; LineWid = 0.5*AmpFactor; %limit setting AxW = 2.25*AmpFactor; AxH = 2*AmpFactor; PlotMinW = 1*AmpFactor; PlotMinH = 1*AmpFactor; PlotMaxW = 3.4*AmpFactor;%AxW*2; PlotMaxH = 2.6*AmpFactor; %% Fig.position Fig1 = figure; Fig1.Units = 'inches'; Fig1.InnerPosition = [PlotMinW, PlotMinH, PlotMaxW, PlotMaxH]; % colormap parula%jet%autumn%winter% ax1 = axes; ax1.InnerPosition = [0.12 0.13 0.97-0.12 0.995-0.13];%position with labels %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% file path FileName = 'Scan_10x12.mat'; load(FileName,'SCAN'); NPattern = 100; Nt = 10; %% HD-FEC limit p(1) = semilogy(ax1, [0 Nt], [4.7e-3 4.7e-3],'k--',... 'LineWidth', LineWid); hold on; %% BER SicBer = sort(SCAN.SicBer,2); SicBerChAvg = mean(SicBer,1); MmseBer = sort(SCAN.MmseBer,2); MmseBerChAvg = mean(MmseBer,1); p(2) = semilogy(ax1, 1:Nt, SicBerChAvg, 'bs-', 'MarkerSize',MarkSize, ... 'LineWidth', LineWid, 'DisplayName', 'SIC'); hold on; p(3) = semilogy(ax1, 1:Nt, MmseBerChAvg, 'ro-','MarkerSize',MarkSize, ... 'LineWidth', LineWid, 'DisplayName', 'MMSE'); hold on; xlabel('Channel order'); % yticks(10.^[ -8 -6 -5 -4 -3 -2 -1]) % yticklabels({'0','10^{-6}','10^{-5}','10^{-4}','10^{-3}','10^{-2}','10^{-1}'}) ylabel('Average BER'); ax1.FontName = FontName; ax1.FontSize = FontSize; ax1.LineWidth = LineWid; axis([0 Nt 1e-4 4e-2]) grid on;%grid minor legend(p(2:3),'Location','northwest'); t = text(7.3,6e-3,'HD-FEC limit'); % t = text(5.3,3e-3,'HD-FEC limit'); t.FontName = FontName; t.FontSize = FontSize; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot constellation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Color = 'ColorOff'; load('RxSymbolTest.mat') %% MMSE min ax2 = axes; ax2.InnerPosition = [0.095 0.435 0.25,0.25]; i1 = 9; if strcmp(Color,'ColorOn') ScatterColormap(ax2,real(RxSymbol.Mmse(:, i1)), imag(RxSymbol.Mmse(:, i1))); hold on; else SurfColormap(ax2,real(RxSymbol.Mmse(:, i1)), imag(RxSymbol.Mmse(:, i1))); hold on; % plot(ax,Symbol(:, i1), 'g.'); hold on; end axis off % arrow x = [0.205 0.22 ]; y = [0.26 0.45 ]; x = fliplr(x); y = fliplr(y); ar1 = annotation('arrow',x,y); %% SIC min ax3 = axes; ax3.InnerPosition = [0.36 0.14 0.25,0.25]; i1 = 10; if strcmp(Color,'ColorOn') ScatterColormap(ax3,real(RxSymbol.Sic(:, i1)), imag(RxSymbol.Sic(:, i1))); hold on; else SurfColormap(ax3,real(RxSymbol.Sic(:, i1)), imag(RxSymbol.Sic(:, i1))); hold on; % plot(ax,Symbol(:, i1), 'g.'); hold on; end axis off % arrow x = [0.22 0.4 ]; y = [0.2 0.265]; x = fliplr(x); y = fliplr(y); ar1 = annotation('arrow',x,y); %% MMSE max ax4 = axes; ax4.InnerPosition = [0.39 0.73 0.25,0.25]; i1 = 2; if strcmp(Color,'ColorOn') ScatterColormap(ax4,real(RxSymbol.Mmse(:, i1)), imag(RxSymbol.Mmse(:, i1))); hold on; else SurfColormap(ax4,real(RxSymbol.Mmse(:, i1)), imag(RxSymbol.Mmse(:, i1))); hold on; % plot(ax,Symbol(:, i1), 'g.'); hold on; end axis off % arrow x = [0.95 0.62]; y = [0.96 0.855]; x = fliplr(x); y = fliplr(y); ar1 = annotation('arrow',x,y); %% SIC max ax5 = axes; ax5.InnerPosition = [0.74 0.26 0.25,0.25]; i1 = 2; if strcmp(Color,'ColorOn') ScatterColormap(ax5,real(RxSymbol.Sic(:, i1)), imag(RxSymbol.Sic(:, i1))); hold on; else SurfColormap(ax5,real(RxSymbol.Sic(:, i1)), imag(RxSymbol.Sic(:, i1))); hold on; % plot(ax,Symbol(:, i1), 'g.'); hold on; end axis off % arrow x = [0.96 0.9]; y = [0.59 0.5]; x = fliplr(x); y = fliplr(y); ar1 = annotation('arrow',x,y); toc;