work on MPI
This commit is contained in:
@@ -14,10 +14,13 @@ classdef FFE_test < IMDDTestCase
|
||||
testCase.verifyEqual(ffe.epochs_dd, 5);
|
||||
testCase.verifyFalse(logical(ffe.optimize_dc_tracking_params));
|
||||
testCase.verifyEqual(ffe.dc_tracking_optimization_delay_weight, 1e-3);
|
||||
testCase.verifyEqual(ffe.dc_tracking_persistence_gain, 0);
|
||||
testCase.verifyEqual(ffe.dc_tracking_power_exponent, 2);
|
||||
testCase.verifyEqual(ffe.dc_avg_bufferlength_a1, 0);
|
||||
testCase.verifyEqual(ffe.dc_avg_update_blocklength_a1, 0);
|
||||
testCase.verifyEqual(ffe.dc_smoothing_a1, 0);
|
||||
testCase.verifyEqual(ffe.dc_level_avg_bufferlength_a2, 0);
|
||||
testCase.verifyEqual(ffe.dc_level_update_blocklength_a2, 0);
|
||||
testCase.verifyEqual(ffe.dc_smoothing_a2, 0);
|
||||
testCase.verifyEqual(ffe.dc_level_weights_a2, 0);
|
||||
testCase.verifyEqual(ffe.dc_tracking_buffer_len, 1);
|
||||
@@ -101,6 +104,76 @@ classdef FFE_test < IMDDTestCase
|
||||
testCase.verifyEqual(ffe.e_dc, 0.19, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function dcTrackingUnbufferedPathUpdatesEverySymbol(testCase)
|
||||
x = zeros(4, 1);
|
||||
d = ones(4, 1);
|
||||
|
||||
ffe = FFE( ...
|
||||
"sps", 1, ...
|
||||
"order", 1, ...
|
||||
"dc_tracking_mu", 0.1, ...
|
||||
"dc_tracking_buffer_len", 1, ...
|
||||
"dd_mode", 0, ...
|
||||
"adaption_technique", adaption_method.lms);
|
||||
|
||||
ffe.constellation = unique(d);
|
||||
ffe.equalize(x, d, 0, 1, numel(x), true, false);
|
||||
|
||||
testCase.verifyEqual(ffe.e_dc, 1 - 0.9^4, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function dcTrackingBlockUpdateUsesMeanBlockError(testCase)
|
||||
ffe = FFE("dc_tracking_mu", 0.1);
|
||||
|
||||
[e_dc_next,stats] = ffe.dcTrackingBlockUpdate(0.5, [1; 2; 3]);
|
||||
|
||||
testCase.verifyEqual(e_dc_next, 0.7, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(stats.err_mean, 2, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(stats.mu_eff, 0.1, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(stats.update, 0.2, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function dcTrackingBlockUpdateDoesNotSuppressLargeErrorPower(testCase)
|
||||
ffe = FFE("dc_tracking_mu", 0.1);
|
||||
|
||||
[e_dc_next,stats] = ffe.dcTrackingBlockUpdate(0, [10; 10]);
|
||||
|
||||
testCase.verifyEqual(e_dc_next, 1, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(stats.err_mean, 10, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(stats.mu_eff, 0.1, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function dcTrackingBlockUpdateCanBoostPersistentMean(testCase)
|
||||
ffe = FFE("dc_tracking_mu", 0.1);
|
||||
|
||||
[e_dc_next,stats] = ffe.dcTrackingBlockUpdate(0, [2; 2; 2], ...
|
||||
"persistence_gain", 1);
|
||||
|
||||
testCase.verifyEqual(e_dc_next, 0.4, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(stats.persistence_scale, 1, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(stats.mu_eff, 0.2, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function dcTrackingLoopUsesBlockPersistenceGain(testCase)
|
||||
x = zeros(4, 1);
|
||||
d = ones(4, 1);
|
||||
|
||||
ffe = FFE( ...
|
||||
"sps", 1, ...
|
||||
"order", 1, ...
|
||||
"dc_tracking_mu", 0.1, ...
|
||||
"dc_tracking_adaptive_enabled", true, ...
|
||||
"dc_tracking_persistence_gain", 1, ...
|
||||
"dc_tracking_buffer_len", 2, ...
|
||||
"dd_mode", 0, ...
|
||||
"adaption_technique", adaption_method.lms);
|
||||
|
||||
ffe.constellation = unique(d);
|
||||
ffe.equalize(x, d, 0, 1, numel(x), true, false);
|
||||
|
||||
testCase.verifyEqual(ffe.e_dc, 0.36, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function ffeBufferDelaysTapUpdateUntilBlockBoundary(testCase)
|
||||
x = ones(4, 1);
|
||||
d = ones(4, 1);
|
||||
@@ -181,6 +254,28 @@ classdef FFE_test < IMDDTestCase
|
||||
testCase.verifyEqual(ffe.debug_struct.dc_avg_offset, expected_offset, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function dcAvgA1UpdateBlocklengthOneRefreshesEverySymbol(testCase)
|
||||
x = (1:4).';
|
||||
d = zeros(4, 1);
|
||||
expected_offset = [0, 1, 1.5, 2];
|
||||
expected_y = [1; 1; 1.5; 2];
|
||||
|
||||
ffe = FFE( ...
|
||||
"sps", 1, ...
|
||||
"order", 1, ...
|
||||
"dc_avg_bufferlength_a1", 3, ...
|
||||
"dc_avg_update_blocklength_a1", 1, ...
|
||||
"save_debug", true, ...
|
||||
"dd_mode", 0, ...
|
||||
"adaption_technique", adaption_method.lms);
|
||||
ffe.e = 1;
|
||||
|
||||
[y,~] = ffe.equalize(x, d, 0, 1, numel(x), true, false);
|
||||
|
||||
testCase.verifyEqual(y, expected_y, "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(ffe.debug_struct.dc_avg_offset, expected_offset, "AbsTol", 1e-12);
|
||||
end
|
||||
|
||||
function dcAvgA1WarnsWhenCombinedWithDcTracking(testCase)
|
||||
testCase.verifyWarning(@() FFE( ...
|
||||
"dc_avg_bufferlength_a1", 3, ...
|
||||
@@ -211,6 +306,30 @@ classdef FFE_test < IMDDTestCase
|
||||
testCase.verifyEqual(ffe.debug_struct.dc_level_valid_count, [0, 0, 2, 2]);
|
||||
end
|
||||
|
||||
function dcLevelAvgA2UpdateBlocklengthOneRefreshesEverySymbol(testCase)
|
||||
x = (1:4).';
|
||||
d = zeros(4, 1);
|
||||
|
||||
ffe = FFE( ...
|
||||
"sps", 1, ...
|
||||
"order", 1, ...
|
||||
"dc_level_avg_bufferlength_a2", 2, ...
|
||||
"dc_level_update_blocklength_a2", 1, ...
|
||||
"dc_level_weights_a2", 1, ...
|
||||
"save_debug", true, ...
|
||||
"dd_mode", 0, ...
|
||||
"adaption_technique", adaption_method.lms);
|
||||
ffe.e = 1;
|
||||
ffe.constellation = 0;
|
||||
|
||||
[y,~] = ffe.equalize(x, d, 0, 1, numel(x), true, false);
|
||||
|
||||
testCase.verifyEqual(y, [1; 1.5; 1.5; 1.5], "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(ffe.debug_struct.dc_level_mpi_est, [0, 1, 1.5, 2.5], "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(ffe.debug_struct.dc_level_weight, [0, 0.5, 1, 1], "AbsTol", 1e-12);
|
||||
testCase.verifyEqual(ffe.debug_struct.dc_level_valid_count, [0, 1, 2, 2]);
|
||||
end
|
||||
|
||||
function dcLevelAvgA2UsesVectorWeightsInConstellationOrder(testCase)
|
||||
x = [1; 3; 1; 4];
|
||||
d = [0; 2; 0; 2];
|
||||
|
||||
Reference in New Issue
Block a user