Ordnerstruktur
This commit is contained in:
@@ -4,6 +4,7 @@ arguments
|
||||
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
|
||||
@@ -18,30 +19,17 @@ end
|
||||
eq_signal = PAMmapper(M,0).quantize(eq_signal);
|
||||
end
|
||||
|
||||
diff_indices = eq_signal.signal == ref_symbols.signal;
|
||||
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);
|
||||
|
||||
|
||||
% Identify the start of new sequences (when the difference is not 1)
|
||||
sequence_starts = [1, find(diff_indices ~= 1) + 1]; % Include the first index
|
||||
sequence_ends = [sequence_starts(2:end) - 1, length(errpos)]; % Calculate end indices
|
||||
|
||||
% Initialize burst count and print bursts longer than 10
|
||||
burst_len = 1:10;
|
||||
burst_count = zeros(length(burst_len),1);
|
||||
for t = 1:numel(burst_len)
|
||||
for i = 1:length(sequence_starts)
|
||||
% Extract current sequence
|
||||
current_burst = errpos(sequence_starts(i):sequence_ends(i));
|
||||
% Check if the sequence length matches criterion
|
||||
if length(current_burst) == burst_len(t)
|
||||
burst_count(t) = burst_count(t) + 1;
|
||||
end
|
||||
end
|
||||
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
|
||||
|
||||
burst_symbols = burst_count .* burst_len';
|
||||
burst_rate = burst_symbols ;%./ length(rx_signal);
|
||||
|
||||
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user