36 lines
1.1 KiB
Matlab
36 lines
1.1 KiB
Matlab
function showErrorBurstCount(eq_signal,ref_symbols,options)
|
|
arguments
|
|
eq_signal
|
|
ref_symbols
|
|
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.max_burst_length (1,1) double = 20
|
|
end
|
|
|
|
% Determine the figure number to use or create a new figure
|
|
if isnan(options.fignum)
|
|
fig = figure; % Create a new figure and get its handle
|
|
else
|
|
fig = figure(options.fignum); % Use the specified figure number
|
|
end
|
|
|
|
if numel(unique(eq_signal.signal)) > 20
|
|
M = numel(unique(ref_symbols.signal));
|
|
eq_signal = PAMmapper(M,0).quantize(eq_signal);
|
|
end
|
|
|
|
errpos = find(eq_signal.signal(:) ~= ref_symbols.signal(:));
|
|
burst_len = 1:options.max_burst_length;
|
|
burst_count = count_error_bursts(errpos, options.max_burst_length);
|
|
|
|
bar(burst_len, burst_count, "DisplayName", options.displayname);
|
|
grid on;
|
|
xlabel("Error burst length");
|
|
ylabel("Count");
|
|
title("Error burst count");
|
|
if ~isempty(options.displayname)
|
|
legend("show");
|
|
end
|
|
|
|
end
|