work on MPI
This commit is contained in:
404
Functions/EQ_recipes/mpi_recipe.m
Normal file
404
Functions/EQ_recipes/mpi_recipe.m
Normal file
@@ -0,0 +1,404 @@
|
||||
function output = mpi_recipe_dev(Scpe_sig_raw, Symbols, Tx_bits, options)
|
||||
%mpi_recipe_dev Minimal example recipe for the DSP job framework.
|
||||
% This recipe intentionally performs only light preprocessing and records
|
||||
% summary values. It demonstrates the recipe interface without running a
|
||||
% full equalizer chain.
|
||||
|
||||
arguments
|
||||
Scpe_sig_raw
|
||||
Symbols
|
||||
Tx_bits
|
||||
options.fsym
|
||||
options.M
|
||||
options.duob_mode
|
||||
options.dataTable table
|
||||
options.userParameters struct = struct()
|
||||
options.debug_plots (1,1) logical = false
|
||||
end
|
||||
|
||||
Scpe_sig = preprocessSignal(Scpe_sig_raw, Symbols, options.fsym, ...
|
||||
"mode", "auto", ...
|
||||
"debug_plots", options.debug_plots);
|
||||
output = struct();
|
||||
|
||||
%% conventional FFE
|
||||
eq_core_settings = { ...
|
||||
"sps", 2, ...
|
||||
"order", 25, ...
|
||||
"decide", 0, ...
|
||||
"adaption_technique", "nlms"};
|
||||
|
||||
eq_training_settings = { ...
|
||||
"len_tr", 4096, ...
|
||||
"epochs_tr", 5, ...
|
||||
"mu_tr", 0.04};
|
||||
|
||||
eq_dd_settings = { ...
|
||||
"dd_mode", 1, ...
|
||||
"epochs_dd", 3, ...
|
||||
"mu_dd", 0.012};
|
||||
|
||||
eq_a1_settings = { ...
|
||||
"dc_smoothing_a1", 0, ...
|
||||
"dc_avg_bufferlength_a1", 0, ...
|
||||
"dc_avg_update_blocklength_a1", 1};
|
||||
|
||||
eq_a2_settings = { ...
|
||||
"dc_smoothing_a2", 0, ...
|
||||
"dc_level_avg_bufferlength_a2", 0, ...
|
||||
"dc_level_update_blocklength_a2", 0, ...
|
||||
"dc_level_weights_a2", [0.6 0.6 0.6 0.6]};
|
||||
|
||||
eq_dc_tracking_settings = { ...
|
||||
"dc_tracking_mu", 0, ...
|
||||
"dc_tracking_adaptive_enabled", 0, ...
|
||||
"dc_tracking_persistence_gain", 0, ...
|
||||
"dc_tracking_buffer_len", 0};
|
||||
|
||||
eq_ffe_update_settings = { ...
|
||||
"ffe_update_buffer_len", 1};
|
||||
|
||||
eq_optimizer_settings = { ...
|
||||
"optmize_mus", 0, ...
|
||||
"plot_mu_optimization", options.debug_plots, ...
|
||||
"optimize_dc_tracking_params", 0, ...
|
||||
"optimize_a2_level_weights", 0, ...
|
||||
"a2_level_weight_optimization_len", 2^15, ...
|
||||
"a2_level_weight_optimization_max_evals", 30, ...
|
||||
"a2_level_weight_max", 1};
|
||||
|
||||
eq_debug_settings = { ...
|
||||
"save_debug", false};
|
||||
|
||||
eq_settings = [ ...
|
||||
eq_core_settings, ...
|
||||
eq_training_settings, ...
|
||||
eq_dd_settings, ...
|
||||
eq_a1_settings, ...
|
||||
eq_a2_settings, ...
|
||||
eq_dc_tracking_settings, ...
|
||||
eq_ffe_update_settings, ...
|
||||
eq_optimizer_settings, ...
|
||||
eq_debug_settings];
|
||||
|
||||
eq_ffe = FFE(eq_settings{:});
|
||||
|
||||
if 1
|
||||
|
||||
[ffe_results,equalized_signal] = ffe(eq_ffe, options.M, Scpe_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", options.duob_mode, ...
|
||||
'showAnalysis', options.debug_plots, ...
|
||||
"postFFE", [], ...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
ffe_results.metrics.print("description",sprintf('Immediate A2; SIR %d dB',options.dataTable.sir));
|
||||
output.conventional_ffe = ffe_results;
|
||||
|
||||
end
|
||||
|
||||
if options.debug_plots
|
||||
showLevelScatter(Scpe_sig_raw, Symbols, ...
|
||||
"fsym", options.fsym, ...
|
||||
"fignum", 400, ...
|
||||
"normalize", true);
|
||||
|
||||
[~, avg_for_lvl] = showLevelScatter(equalized_signal, Symbols, ...
|
||||
"fsym", options.fsym, ...
|
||||
"fignum", 401, ...
|
||||
"normalize", true);
|
||||
|
||||
end
|
||||
|
||||
|
||||
%% A2
|
||||
eq_core_settings = { ...
|
||||
"sps", 2, ...
|
||||
"order", 25, ...
|
||||
"decide", 0, ...
|
||||
"adaption_technique", "nlms"};
|
||||
|
||||
eq_training_settings = { ...
|
||||
"len_tr", 4096, ...
|
||||
"epochs_tr", 5, ...
|
||||
"mu_tr", 0.04};
|
||||
|
||||
eq_dd_settings = { ...
|
||||
"dd_mode", 1, ...
|
||||
"epochs_dd", 3, ...
|
||||
"mu_dd", 0.012};
|
||||
|
||||
eq_a1_settings = { ...
|
||||
"dc_smoothing_a1", 0, ...
|
||||
"dc_avg_bufferlength_a1", 0, ...
|
||||
"dc_avg_update_blocklength_a1", 1};
|
||||
|
||||
eq_a2_settings = { ...
|
||||
"dc_smoothing_a2", 1, ...
|
||||
"dc_level_avg_bufferlength_a2", 256, ...
|
||||
"dc_level_update_blocklength_a2", options.userParameters.block_update, ...
|
||||
"dc_level_weights_a2", [0.6 0.6 0.6 0.6]};
|
||||
|
||||
eq_dc_tracking_settings = { ...
|
||||
"dc_tracking_mu", 0, ...
|
||||
"dc_tracking_adaptive_enabled", 0, ...
|
||||
"dc_tracking_persistence_gain", 0, ...
|
||||
"dc_tracking_buffer_len", 0};
|
||||
|
||||
eq_ffe_update_settings = { ...
|
||||
"ffe_update_buffer_len", 1};
|
||||
|
||||
eq_optimizer_settings = { ...
|
||||
"optmize_mus", 0, ...
|
||||
"plot_mu_optimization", options.debug_plots, ...
|
||||
"optimize_dc_tracking_params", 0, ...
|
||||
"optimize_a2_level_weights", 1, ...
|
||||
"a2_level_weight_optimization_len", 2^15, ...
|
||||
"a2_level_weight_optimization_max_evals", 30, ...
|
||||
"a2_level_weight_max", 1};
|
||||
|
||||
eq_debug_settings = { ...
|
||||
"save_debug", false};
|
||||
|
||||
eq_settings = [ ...
|
||||
eq_core_settings, ...
|
||||
eq_training_settings, ...
|
||||
eq_dd_settings, ...
|
||||
eq_a1_settings, ...
|
||||
eq_a2_settings, ...
|
||||
eq_dc_tracking_settings, ...
|
||||
eq_ffe_update_settings, ...
|
||||
eq_optimizer_settings, ...
|
||||
eq_debug_settings];
|
||||
|
||||
eq_ffe = FFE(eq_settings{:});
|
||||
|
||||
if 1
|
||||
|
||||
[ffe_results,equalized_signal] = ffe(eq_ffe, options.M, Scpe_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", options.duob_mode, ...
|
||||
'showAnalysis', options.debug_plots, ...
|
||||
"postFFE", [], ...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
ffe_results.metrics.print("description",sprintf('Immediate A2; SIR %d dB',options.dataTable.sir));
|
||||
output.a2_immediate_updates = ffe_results;
|
||||
|
||||
end
|
||||
|
||||
if options.debug_plots
|
||||
showLevelScatter(Scpe_sig_raw, Symbols, ...
|
||||
"fsym", options.fsym, ...
|
||||
"fignum", 400, ...
|
||||
"normalize", true);
|
||||
|
||||
[~, avg_for_lvl] = showLevelScatter(equalized_signal, Symbols, ...
|
||||
"fsym", options.fsym, ...
|
||||
"fignum", 401, ...
|
||||
"normalize", true);
|
||||
|
||||
end
|
||||
|
||||
%% A1
|
||||
|
||||
eq_a1_settings = { ...
|
||||
"dc_smoothing_a1", 1 ...
|
||||
"dc_avg_bufferlength_a1", 2048, ...
|
||||
"dc_avg_update_blocklength_a1", options.userParameters.block_update};
|
||||
|
||||
eq_a2_settings = { ...
|
||||
"dc_smoothing_a2", 0, ...
|
||||
"dc_level_avg_bufferlength_a2", 0, ...
|
||||
"dc_level_update_blocklength_a2", 0, ...
|
||||
"dc_level_weights_a2", [0.6 0.6 0.6 0.6]};
|
||||
|
||||
eq_optimizer_settings = { ...
|
||||
"optmize_mus", 0, ...
|
||||
"plot_mu_optimization", options.debug_plots, ...
|
||||
"optimize_dc_tracking_params", 0, ...
|
||||
"optimize_a2_level_weights", 0, ...
|
||||
"a2_level_weight_optimization_len", 2^15, ...
|
||||
"a2_level_weight_optimization_max_evals", 30, ...
|
||||
"a2_level_weight_max", 1};
|
||||
|
||||
eq_debug_settings = { ...
|
||||
"save_debug", false};
|
||||
|
||||
eq_settings = [ ...
|
||||
eq_core_settings, ...
|
||||
eq_training_settings, ...
|
||||
eq_dd_settings, ...
|
||||
eq_a1_settings, ...
|
||||
eq_a2_settings, ...
|
||||
eq_dc_tracking_settings, ...
|
||||
eq_ffe_update_settings, ...
|
||||
eq_optimizer_settings, ...
|
||||
eq_debug_settings];
|
||||
|
||||
eq_ffe = FFE(eq_settings{:});
|
||||
|
||||
if 1
|
||||
|
||||
[ffe_results,equalized_signal] = ffe(eq_ffe, options.M, Scpe_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", options.duob_mode, ...
|
||||
'showAnalysis', options.debug_plots, ...
|
||||
"postFFE", [], ...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
ffe_results.metrics.print("description",sprintf('Immediate A1; SIR %d dB',options.dataTable.sir));
|
||||
output.a1_immediate_updates = ffe_results;
|
||||
|
||||
end
|
||||
|
||||
%% Tracking
|
||||
|
||||
eq_core_settings = { ...
|
||||
"sps", 2, ...
|
||||
"order", 25, ...
|
||||
"decide", 0, ...
|
||||
"adaption_technique", "nlms"};
|
||||
|
||||
eq_training_settings = { ...
|
||||
"len_tr", 4096, ...
|
||||
"epochs_tr", 5, ...
|
||||
"mu_tr", 0.04};
|
||||
|
||||
eq_dd_settings = { ...
|
||||
"dd_mode", 1, ...
|
||||
"epochs_dd", 3, ...
|
||||
"mu_dd", 0.012};
|
||||
|
||||
eq_a1_settings = { ...
|
||||
"dc_smoothing_a1", 0, ...
|
||||
"dc_avg_bufferlength_a1", 0, ...
|
||||
"dc_avg_update_blocklength_a1", 1};
|
||||
|
||||
eq_a2_settings = { ...
|
||||
"dc_smoothing_a2", 0, ...
|
||||
"dc_level_avg_bufferlength_a2", 0, ...
|
||||
"dc_level_update_blocklength_a2", 0, ...
|
||||
"dc_level_weights_a2", [0.6 0.6 0.6 0.6]};
|
||||
|
||||
eq_dc_tracking_settings = { ...
|
||||
"dc_tracking_mu", 0.002, ...
|
||||
"dc_tracking_adaptive_enabled", 0, ...
|
||||
"dc_tracking_persistence_gain", 0, ...
|
||||
"dc_tracking_buffer_len", options.userParameters.block_update};
|
||||
|
||||
eq_ffe_update_settings = { ...
|
||||
"ffe_update_buffer_len", 1};
|
||||
|
||||
eq_optimizer_settings = { ...
|
||||
"optmize_mus", 0, ...
|
||||
"plot_mu_optimization", options.debug_plots, ...
|
||||
"optimize_dc_tracking_params", 1, ...
|
||||
"optimize_a2_level_weights", 0, ...
|
||||
"a2_level_weight_optimization_len", 2^15, ...
|
||||
"a2_level_weight_optimization_max_evals", 30, ...
|
||||
"a2_level_weight_max", 1};
|
||||
|
||||
eq_debug_settings = { ...
|
||||
"save_debug", false};
|
||||
|
||||
eq_settings = [ ...
|
||||
eq_core_settings, ...
|
||||
eq_training_settings, ...
|
||||
eq_dd_settings, ...
|
||||
eq_a1_settings, ...
|
||||
eq_a2_settings, ...
|
||||
eq_dc_tracking_settings, ...
|
||||
eq_ffe_update_settings, ...
|
||||
eq_optimizer_settings, ...
|
||||
eq_debug_settings];
|
||||
|
||||
eq_ffe = FFE(eq_settings{:});
|
||||
|
||||
if 1
|
||||
|
||||
[ffe_results,equalized_signal] = ffe(eq_ffe, options.M, Scpe_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", options.duob_mode, ...
|
||||
'showAnalysis', options.debug_plots, ...
|
||||
"postFFE", [], ...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
ffe_results.metrics.print("description",sprintf('Immediate A2; SIR %d dB',options.dataTable.sir));
|
||||
output.tracking_fixmu_immediate_updates = ffe_results;
|
||||
|
||||
end
|
||||
|
||||
%% Tracking Adaptive
|
||||
|
||||
eq_core_settings = { ...
|
||||
"sps", 2, ...
|
||||
"order", 25, ...
|
||||
"decide", 0, ...
|
||||
"adaption_technique", "nlms"};
|
||||
|
||||
eq_training_settings = { ...
|
||||
"len_tr", 4096, ...
|
||||
"epochs_tr", 5, ...
|
||||
"mu_tr", 0.04};
|
||||
|
||||
eq_dd_settings = { ...
|
||||
"dd_mode", 1, ...
|
||||
"epochs_dd", 3, ...
|
||||
"mu_dd", 0.012};
|
||||
|
||||
eq_a1_settings = { ...
|
||||
"dc_smoothing_a1", 0, ...
|
||||
"dc_avg_bufferlength_a1", 0, ...
|
||||
"dc_avg_update_blocklength_a1", 1};
|
||||
|
||||
eq_a2_settings = { ...
|
||||
"dc_smoothing_a2", 0, ...
|
||||
"dc_level_avg_bufferlength_a2", 0, ...
|
||||
"dc_level_update_blocklength_a2", 0, ...
|
||||
"dc_level_weights_a2", [0.6 0.6 0.6 0.6]};
|
||||
|
||||
eq_dc_tracking_settings = { ...
|
||||
"dc_tracking_mu", 0.002, ...
|
||||
"dc_tracking_adaptive_enabled", 1, ...
|
||||
"dc_tracking_persistence_gain", 0, ...
|
||||
"dc_tracking_buffer_len", options.userParameters.block_update};
|
||||
|
||||
eq_ffe_update_settings = { ...
|
||||
"ffe_update_buffer_len", 1};
|
||||
|
||||
eq_optimizer_settings = { ...
|
||||
"optmize_mus", 0, ...
|
||||
"plot_mu_optimization", options.debug_plots, ...
|
||||
"optimize_dc_tracking_params", 1, ...
|
||||
"optimize_a2_level_weights", 0, ...
|
||||
"a2_level_weight_optimization_len", 2^15, ...
|
||||
"a2_level_weight_optimization_max_evals", 30, ...
|
||||
"a2_level_weight_max", 1};
|
||||
|
||||
eq_debug_settings = { ...
|
||||
"save_debug", false};
|
||||
|
||||
eq_settings = [ ...
|
||||
eq_core_settings, ...
|
||||
eq_training_settings, ...
|
||||
eq_dd_settings, ...
|
||||
eq_a1_settings, ...
|
||||
eq_a2_settings, ...
|
||||
eq_dc_tracking_settings, ...
|
||||
eq_ffe_update_settings, ...
|
||||
eq_optimizer_settings, ...
|
||||
eq_debug_settings];
|
||||
|
||||
eq_ffe = FFE(eq_settings{:});
|
||||
|
||||
if 1
|
||||
|
||||
[ffe_results,equalized_signal] = ffe(eq_ffe, options.M, Scpe_sig, Symbols, Tx_bits, ...
|
||||
"precode_mode", options.duob_mode, ...
|
||||
'showAnalysis', options.debug_plots, ...
|
||||
"postFFE", [], ...
|
||||
"eth_style_symbol_mapping", 0);
|
||||
|
||||
ffe_results.metrics.print("description",sprintf('Immediate A2; SIR %d dB',options.dataTable.sir));
|
||||
output.tracking_adaptive_immediate_updates = ffe_results;
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user