Now updated for 2 SPS! Works directly on the 2sps Scope output

This commit is contained in:
Silas Oettinghaus
2025-10-30 14:54:06 +01:00
parent ac95aef1e0
commit b27f1d3715

View File

@@ -102,7 +102,7 @@ classdef ML_MLSE < handle
% --- Parameters % --- Parameters
obj.S = numel(unique(D.signal)); % alphabet size obj.S = numel(unique(D.signal)); % alphabet size
obj.Nf = obj.order; % filter length obj.Nf = obj.order*obj.sps; % filter length
% obj.delta = 3;%ceil(obj.Nf/2); % delay parameter % obj.delta = 3;%ceil(obj.Nf/2); % delay parameter
obj.nStates = obj.S^obj.L; obj.nStates = obj.S^obj.L;
obj.nFeasible = obj.nStates*obj.S; obj.nFeasible = obj.nStates*obj.S;
@@ -195,8 +195,8 @@ classdef ML_MLSE < handle
k = symbol; k = symbol;
% --- Build Δ-delayed observation window y_k % --- Build Δ-delayed observation window y_k
i1 = k - obj.Nf + 1 + obj.delta; i1 = sample - obj.Nf + 1 + obj.delta;
i2 = k + obj.delta; i2 = sample + obj.delta;
buf = x(max(1,i1):min(length(x),i2)); buf = x(max(1,i1):min(length(x),i2));
padL = max(0,1 - i1); padL = max(0,1 - i1);
padR = max(0,i2 - length(x)); padR = max(0,i2 - length(x));
@@ -327,15 +327,19 @@ classdef ML_MLSE < handle
end end
[~, s_end] = max(pm); [~, s_end] = max(pm);
viterbi_path = zeros(N,1,'uint32'); viterbi_path = zeros(symbol,1,'uint32');
viterbi_path(N) = s_end; viterbi_path(symbol) = s_end;
for n = N:-1:2 for n = symbol:-1:2
viterbi_path(n-1) = pred(n, viterbi_path(n)); viterbi_path(n-1) = pred(n, viterbi_path(n));
end end
y_vit = obj.first_sym(viterbi_path); y_vit = obj.first_sym(viterbi_path);
y = obj.first_sym(viterbi_path); y = obj.first_sym(viterbi_path);
if 1 %debug || training if 1 %debug || training
err = sum(y ~= d(1:length(y))); err = sum(y ~= d(1:length(y)));
ser = err./length(y); ser = err./length(y);
@@ -354,7 +358,7 @@ classdef ML_MLSE < handle
subplot(2,2,4); subplot(2,2,4);
% scatter(1:N,pm_sto,1,'.') % scatter(1:N,pm_sto,1,'.')
plot(1:N,pm_sto) plot(1:symbol,pm_sto)
title('Path Metric Winners') title('Path Metric Winners')
end end