new plots for Diss. Mostly AI gen. Few changes in actual codebase
This commit is contained in:
@@ -5,7 +5,8 @@ arguments
|
||||
options.fignum (1,1) double = NaN % Default to NaN if not provided
|
||||
options.displayname (1,:) char = '' % Default to an empty string if not provided
|
||||
options.ref_symbol_uncoded = []
|
||||
options.nbins (1,1) double = 1000
|
||||
options.nbins (1,1) double = 200
|
||||
options.legendLabels = []
|
||||
end
|
||||
|
||||
if isa(eq_signal,'Signal')
|
||||
@@ -21,6 +22,7 @@ end
|
||||
eq_signal = eq_signal(:);
|
||||
ref_symbols = ref_symbols(:);
|
||||
ref_symbol_uncoded = options.ref_symbol_uncoded(:);
|
||||
legend_labels = string(options.legendLabels);
|
||||
|
||||
assert(numel(eq_signal) == numel(ref_symbols), ...
|
||||
'showLevelHistogram:LengthMismatch', ...
|
||||
@@ -66,11 +68,16 @@ end
|
||||
for lvl = 1:numel(constellation)
|
||||
intermediate = received_sd(lvl,:);
|
||||
cnt(lvl) = round(numel(intermediate(~isnan(intermediate)))./numel(eq_signal),3).*100;
|
||||
if isempty(legend_labels)
|
||||
display_name = ['Lvl ',num2str(lvl),' ; ',num2str(cnt(lvl)),' '];
|
||||
else
|
||||
display_name = char(legend_labels(lvl));
|
||||
end
|
||||
hold on
|
||||
warning off
|
||||
histogram(received_sd(lvl,:),options.nbins, ...
|
||||
"EdgeAlpha",0, ...
|
||||
"DisplayName",['Lvl ',num2str(lvl),' ; ',num2str(cnt(lvl)),' '], ...
|
||||
"DisplayName",display_name, ...
|
||||
"FaceColor",lvlcol(lvl,:), ...
|
||||
"Normalization","pdf");
|
||||
warning on
|
||||
@@ -90,7 +97,7 @@ end
|
||||
rm_idx = mid + (-1:2); % two before mid and two after (2x2 removal centered)
|
||||
rm_idx = max(1,min(size(lvlcol,1),rm_idx));
|
||||
lvlcol(rm_idx,:) = [];
|
||||
lvlcol = lvlcol(1:numel(sir_group_labels),:);
|
||||
% lvlcol = lvlcol(1:numel(sir_group_labels),:);
|
||||
|
||||
for db_lvl = 1:numel(db_constellation)
|
||||
db_mask = ref_symbols == db_constellation(db_lvl);
|
||||
@@ -99,12 +106,20 @@ end
|
||||
cnt = round(nnz(ref_symbol_uncoded == mapped_class)./numel(eq_signal),3).*100;
|
||||
|
||||
if db_lvl == findFirstMappedDbLevel(ref_symbols,ref_symbol_uncoded,db_constellation,mapped_class)
|
||||
display_name = ['p(y|x_',num2str(class_idx),') ; ',num2str(cnt),' '];
|
||||
display_name = ['p(y|x_',num2str(class_idx),')'];
|
||||
if isempty(legend_labels)
|
||||
display_name = ['p(y|x_',num2str(class_idx),') ; ',num2str(cnt),' '];
|
||||
display_name = ['p(y|x_',num2str(class_idx),')'];
|
||||
else
|
||||
display_name = char(legend_labels(class_idx));
|
||||
end
|
||||
handle_visibility = "on";
|
||||
else
|
||||
display_name = ['p(y|x_',num2str(class_idx),') ; ',num2str(cnt),' '];
|
||||
display_name = ['p(y|x_',num2str(class_idx),')'];
|
||||
if isempty(legend_labels)
|
||||
display_name = ['p(y|x_',num2str(class_idx),') ; ',num2str(cnt),' '];
|
||||
display_name = ['p(y|x_',num2str(class_idx),')'];
|
||||
else
|
||||
display_name = char(legend_labels(class_idx));
|
||||
end
|
||||
handle_visibility = "off";
|
||||
end
|
||||
|
||||
@@ -123,7 +138,7 @@ end
|
||||
end
|
||||
end
|
||||
xlim([-3 3]);
|
||||
legend
|
||||
legend("Interpreter", "latex");
|
||||
grid on
|
||||
|
||||
% view([90 -90]);
|
||||
|
||||
Reference in New Issue
Block a user