clc; clear; close all; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% load data %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% HdFec = 4.7e-3; PatternLen = 100; %% file path FilePath = '.\'; MmseBerAvg = NaN(3,4); MmseOutage = NaN(3,4); SicBerAvg = NaN(3,4); SicOutage = NaN(3,4); %% Tx = 6 FileName = 'Scan_6x6.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(1,1) = mean(SCAN.SicBerAvg); SicOutage(1,1) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(1,1) = mean(SCAN.MmseBerAvg); MmseOutage(1,1) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; FileName = 'Scan_6x8.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(1,2) = mean(SCAN.SicBerAvg); SicOutage(1,2) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(1,2) = mean(SCAN.MmseBerAvg); MmseOutage(1,2) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; FileName = 'Scan_6x10.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(1,3) = mean(SCAN.SicBerAvg); SicOutage(1,3) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(1,3) = mean(SCAN.MmseBerAvg); MmseOutage(1,3) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; FileName = 'Scan_6x12.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(1,4) = mean(SCAN.SicBerAvg); SicOutage(1,4) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(1,4) = mean(SCAN.MmseBerAvg); MmseOutage(1,4) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; %% Tx = 8 FileName = 'Scan_8x8.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(2,2) = mean(SCAN.SicBerAvg); SicOutage(2,2) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(2,2) = mean(SCAN.MmseBerAvg); MmseOutage(2,2) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; FileName = 'Scan_8x10.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(2,3) = mean(SCAN.SicBerAvg); SicOutage(2,3) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(2,3) = mean(SCAN.MmseBerAvg); MmseOutage(2,3) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; FileName = 'Scan_8x12.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(2,4) = mean(SCAN.SicBerAvg); SicOutage(2,4) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(2,4) = mean(SCAN.MmseBerAvg); MmseOutage(2,4) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; %% Tx = 10 FileName = 'Scan_10x10.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(3,3) = mean(SCAN.SicBerAvg); SicOutage(3,3) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(3,3) = mean(SCAN.MmseBerAvg); MmseOutage(3,3) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; FileName = 'Scan_10x12.mat'; load([FilePath,FileName],'SCAN'); SicBerAvg(3,4) = mean(SCAN.SicBerAvg); SicOutage(3,4) = sum(SCAN.SicBerAvg > HdFec) / PatternLen; MmseBerAvg(3,4) = mean(SCAN.MmseBerAvg); MmseOutage(3,4) = sum(SCAN.MmseBerAvg > HdFec) / PatternLen; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% plot settings FontName = 'Times New Roman'; % FontName = 'Arial'; FontSize = 9; Fig1 = figure; Fig1.Units = 'inches'; Fig1.Position = [1, 1, 3.4, 2.6]; %common label for all subfigures. han=axes(Fig1,'visible','off'); han.InnerPosition = [0.12, 0.14, 0.73, 0.77];%position with labels han.Title.Visible='on'; han.XLabel.Visible='on'; han.YLabel.Visible='on'; xlabel(han,'Number of Transmit Channels'); ylabel(han,'Number of Receive Channels'); han.FontName = FontName; han.FontSize = FontSize; %% MMSE avg BER ax1 = axes; ax1.InnerPosition = [0.1, 0.6, 0.35, 0.32];%position with labels % ax1.OuterPosition = [-0.01, 0, 1.05, 0.5];%position with labels xvalues = {'6','8','10'}; yvalues = {'12','10','8','6'}; h = heatmap(xvalues,yvalues,flipud(MmseBerAvg.')); % h.YLabel = 'Number of Receive Channels'; % h.XLabel = 'Number of Transmit Channels'; h.CellLabelFormat = '%.1e'; h.Colormap = parula; h.ColorScaling = 'log'; h.ColorbarVisible = 'off'; h.ColorLimits = log([8.3e-5 3.2e-2]); % h.GridVisible = 'on'; h.FontName = FontName; h.FontSize = FontSize; h.Title = '(a) MMSE BER'; %% SIC avg BER ax1 = axes; ax1.InnerPosition = [0.51, 0.6, 0.35, 0.32];%position with labels % ax1.OuterPosition = [-0.01, 0, 1.05, 0.5];%position with labels xvalues = {'6','8','10'}; yvalues = {'12','10','8','6'}; h = heatmap(xvalues,yvalues,flipud(SicBerAvg.')); % h.YLabel = 'Number of Receive Channels'; % h.XLabel = 'Number of Transmit Channels'; h.CellLabelFormat = '%.1e'; h.Colormap = parula; h.ColorLimits = log([8.3e-5 3.2e-2]); h.ColorScaling = 'log'; h.ColorbarVisible = 'off'; % h.GridVisible = 'off'; h.FontName = FontName; h.FontSize = FontSize; h.Title = '(b) SIC BER'; %% plot colorbar hp = h.Position; cbax = axes('Position',[hp(1)+hp(3), hp(2), 0, hp(4)],... 'XTick',[], 'YTick', []); cbax.XAxis.Visible = 'off'; cbax.YAxis.Visible = 'off'; cbax.Colormap = h.Colormap; % Add a colorbar the same vertical position as the heatmap cbh = colorbar(cbax); % Set the limits to 0:1 and set the ticks so that they % are in the center of each bar cbh.Limits = [0,1]; cbh.Ticks = (log([1e-4,1e-3,1e-2])-log(8.3e-5))/(log(3.2e-2)-log(8.3e-5)); % Set the new labels for each tick cbh.TickLabels = {'10^{-4}','10^{-3}','10^{-2}'}; % Set the colorbar fontsize to the same value as heatmap fontsize cbh.FontName = FontName; cbh.FontSize = FontSize; %% MMSE Outage ax1 = axes; ax1.InnerPosition = [0.1, 0.13, 0.35, 0.32];%position with labels % ax1.OuterPosition = [-0.01, 0, 1.05, 0.5];%position with labels xvalues = {'6','8','10'}; yvalues = {'12','10','8','6'}; h = heatmap(xvalues,yvalues,flipud(MmseOutage.')*100); % h.YLabel = 'Number of Receive Channels'; % h.XLabel = 'Number of Transmit Channels'; h.CellLabelFormat = '%2.0f%%'; h.Colormap = parula; % h.ColorScaling = 'log'; h.ColorbarVisible = 'off'; h.ColorLimits = [0 100]; h.GridVisible = 'on'; h.FontName = FontName; h.FontSize = FontSize; h.Title = '(c) MMSE Outage'; %% SIC Outage ax1 = axes; ax1.InnerPosition = [0.51, 0.13, 0.35, 0.32];%position with labels % ax1.OuterPosition = [-0.01, 0, 1.05, 0.5];%position with labels xvalues = {'6','8','10'}; yvalues = {'12','10','8','6'}; h = heatmap(xvalues,yvalues,flipud(SicOutage.')*100); % h.YLabel = 'Number of Receive Channels'; % h.XLabel = 'Number of Transmit Channels'; h.CellLabelFormat = '%2.0f%%'; h.Colormap = parula; % h.ColorScaling = 'log'; h.ColorbarVisible = 'off'; h.ColorLimits = [0 100]; h.GridVisible = 'on'; h.FontName = FontName; h.FontSize = FontSize; h.Title = '(d) SIC Outage'; %% plot colorbar hp = h.Position; cbax = axes('Position',[hp(1)+hp(3), hp(2), 0, hp(4)],... 'XTick',[], 'YTick', []); cbax.XAxis.Visible = 'off'; cbax.YAxis.Visible = 'off'; cbax.Colormap = h.Colormap; % Add a colorbar the same vertical position as the heatmap cbh = colorbar(cbax); % Set the limits to 0:1 and set the ticks so that they % are in the center of each bar cbh.Limits = [0,1]; cbh.Ticks = [0,0.5,1]; % Set the new labels for each tick cbh.TickLabels = {'0%','50%','100%'}; % Set the colorbar fontsize to the same value as heatmap fontsize cbh.FontName = FontName; cbh.FontSize = FontSize;