MPI analysis, work on DC tracking

This commit is contained in:
Silas Oettinghaus
2026-07-09 12:29:41 +02:00
parent 3cafb06c4f
commit 753bc582b9
6 changed files with 253 additions and 44 deletions

View File

@@ -20,22 +20,23 @@ function output = mpi_recipe_dev(Scpe_sig_raw, Symbols, Tx_bits, options)
"mode", "auto", ...
"debug_plots", options.debug_plots);
mu_dc = 0;%1e-5;
eq_settings = { ...
"epochs_tr", 5, ...
"epochs_dd", 5, ...
"len_tr", 4096*2, ...
"mu_dd",0.02, ...
"mu_tr",0.2, ...
"len_tr", 4096, ...
"mu_tr",0.04, ...
"mu_dd",0.012, ...
"mu_dc", 0.012, ...
"adaptive_dc_enabled", 0, ...
"order", 25, ...
"sps", 2, ...
"decide", 0, ...
"optmize_mus", 1, ...
"optmize_mus", 0, ...
"dd_mode", 1, ...
"adaption_technique", "nlms", ...
"mu_dc", mu_dc};
"plot_mu_optimization", options.debug_plots,...
"save_debug",true};
eq_ffe = FFE(eq_settings{:});
@@ -51,7 +52,7 @@ function output = mpi_recipe_dev(Scpe_sig_raw, Symbols, Tx_bits, options)
%% NORMAL FFE
if 1
ffe_results = ffe(eq_ffe, options.M, Scpe_sig, Symbols, Tx_bits, ...
[ffe_results,equalized_signal] = ffe(eq_ffe, options.M, Scpe_sig, Symbols, Tx_bits, ...
"precode_mode", options.duob_mode, ...
'showAnalysis', options.debug_plots, ...
"postFFE", [], ...
@@ -60,8 +61,84 @@ function output = mpi_recipe_dev(Scpe_sig_raw, Symbols, Tx_bits, options)
ffe_results.metrics.print("description",sprintf('Normal FFE; SIR %d dB',options.dataTable.sir));
output.ffe_package = ffe_results;
[~, avg_for_lvl] = showLevelScatter(equalized_signal, Symbols, ...
"fsym", options.fsym, ...
"fignum", 401, ...
"normalize", true);
output.ffe_debug = struct();
dbg = eq_ffe.debug_struct;
smooth_len = 501;
output.ffe_debug.smoothing_window = smooth_len;
error_first_s = movmean(dbg.error_first_epoch(:),smooth_len,"omitnan");
error_last_s = movmean(dbg.error(:),smooth_len,"omitnan");
mu_dc_eff_s = movmean(dbg.mu_dc_eff(:),smooth_len,"omitnan");
e_dc_eff_s = movmean(dbg.e_dc_eff(:),smooth_len,"omitnan");
figure(460); clf;
tiledlayout(2,1,"TileSpacing","compact","Padding","compact");
nexttile;
semilogy(error_first_s + eps,"DisplayName","first epoch");
hold on;
semilogy(error_last_s + eps,"DisplayName","last epoch");
grid on;
ylabel("error");
title("FFE debug error");
legend("Location","best");
nexttile;hold on
% plot(eq_sig_mov,"DisplayName","err dc eff");
plot(mu_dc_eff_s,"DisplayName","mu DC - either fixed or adaptive");
e_dc_scale = max(abs(e_dc_eff_s),[],"omitnan") + eps;
plot(-1.*e_dc_eff_s./e_dc_scale,"DisplayName","Inverted DC-tracking; Value that is subtracted during EQ");
avg_lvl_dc=mean(avg_for_lvl,1,"omitnan");
plot(avg_lvl_dc./0.01,"DisplayName","Smoothed EQ output signal; calc'd by showLevelScatter");
grid on;
xlabel("Symbol");
ylabel("mu dc eff");
title("Effective adaptive DC step");
legend
inv_dc_track = -e_dc_eff_s(:);
avg_lvl_dc = avg_lvl_dc(:);
xcorr_len = min(numel(inv_dc_track),numel(avg_lvl_dc));
inv_dc_xcorr = inv_dc_track(1:xcorr_len);
avg_lvl_xcorr = avg_lvl_dc(1:xcorr_len);
inv_dc_xcorr = fillmissing(inv_dc_xcorr,"linear","EndValues","nearest");
avg_lvl_xcorr = fillmissing(avg_lvl_xcorr,"linear","EndValues","nearest");
inv_dc_xcorr = inv_dc_xcorr - mean(inv_dc_xcorr,"omitnan");
avg_lvl_xcorr = avg_lvl_xcorr - mean(avg_lvl_xcorr,"omitnan");
[dc_level_xcorr,dc_level_lags] = xcorr(inv_dc_xcorr,avg_lvl_xcorr,"coeff");
[dc_level_corr,dc_level_idx] = max(dc_level_xcorr);
dc_level_delay_symbols = dc_level_lags(dc_level_idx);
output.ffe_debug.dc_level_delay_symbols = dc_level_delay_symbols;
output.ffe_debug.dc_level_delay_corr = dc_level_corr;
output.ffe_debug.dc_level_lags = dc_level_lags;
output.ffe_debug.dc_level_xcorr = dc_level_xcorr;
fprintf("FFE debug: xcorr(inv DC tracking, avg level) delay=%d symbols, corr=%6.3f\n", ...
dc_level_delay_symbols,dc_level_corr);
figure(461); clf;
plot(dc_level_lags,dc_level_xcorr,"DisplayName","xcorr");
hold on;
plot(dc_level_delay_symbols,dc_level_corr,"ro","DisplayName","max");
grid on;
xlabel("Lag in symbols");
ylabel("Correlation coefficient");
title(sprintf("Delay estimate: %d symbols (corr %.3f)",dc_level_delay_symbols,dc_level_corr));
legend("Location","best");
end
%% MPI Reduction
if 1