version where the signal is flipped and added together

This commit is contained in:
Silas Oettinghaus
2023-07-10 15:08:25 +02:00
parent 93dd63bb18
commit 3c11e4b2e5
10 changed files with 778 additions and 421 deletions

View File

@@ -104,15 +104,15 @@ classdef EQ
function signalclass_out = process(obj,signalclass_in, reference_signalclass_in)
% actual processing of the signal (steps 1. - 3.)
signalclass_in.signal = obj.process_(signalclass_in.signal', reference_signalclass_in.signal');
% actual processing of the signal (steps 1. - 3.)
signalclass_in.signal = obj.process_(signalclass_in.signal', reference_signalclass_in.signal');
signalclass_in.signal = signalclass_in.signal';
% append to logbook
lbdesc = ['EQ '];
% append to logbook
lbdesc = ['EQ '];
signalclass_in = signalclass_in.logbookentry(lbdesc);
% write to output
% write to output
signalclass_out = signalclass_in;
end
@@ -218,14 +218,20 @@ classdef EQ
e_ = zeros(obj.Ne(1)+N2+N3,1); % initialization of filter coefficients
% e(ceil(obj.Ne(1)/2)) = 1; % set central tap to 1 (better starting point since it's closer to the expected solution)
b_ = zeros(obj.Nb(1)+Nb2+Nb3,1);
e_dc = mean(data_in); % initilaization of the dc tap with the mean value of the data
% e_save = NaN(361,8.6e5);
% save_ind = 1;
for trainloops = 1:obj.training_loops
m = obj.k0+1; % starting symbol index at the delay compared to the training sequence
error_log = [];
for n = obj.K*obj.k0+1:obj.K:obj.K*obj.training_length
m = m+1;
X_1 = data(obj.Ne(1)+n+(obj.K-1):-1:n+obj.K).';
% X_1(X_1~=0) = X_1(X_1~=0) - mean(X_1(X_1~=0));
[X_2,X_3] = obj.calc_nl_vecs(X_1,ind_mat_2nd,ind_mat_3rd,norm_fac2,norm_fac3,delta_2,delta_3,cplx);
D_1 = ref(obj.Nb(1)-obj.k0+m-2:-1:m-obj.k0-1).';
@@ -255,14 +261,22 @@ classdef EQ
% e_save(:,save_ind) = e;
% save_ind = save_ind+1;
e_dc = e_dc - obj.DCmu*error;
error_log(end+1) = e_dc;
if obj.Nb(1) > 0
b_ = b_ + obj.DFEmu*error*reference_vec; % Seems like normalized DFE has worse performance
end
end
end
%%
end
end
%%
% Plot the intermediate coefficients after training mode
obj.b = b_(1:obj.Nb(1));
obj.b2 = b_(obj.Nb(1)+1:obj.Nb(1)+Nb2);
@@ -273,7 +287,8 @@ classdef EQ
if obj.plottrain
figure(8052)
subplot(2,3,1); stem(abs(obj.e),'Markersize',2);
sgtitle('Training Coeff')
subplot(2,3,1); stem((obj.e),'Markersize',2);
title('FFE coeff linear')
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
subplot(2,3,2); stem(obj.e2,'Markersize',2);
@@ -291,9 +306,10 @@ classdef EQ
subplot(2,3,6);stem(obj.b3,'Markersize',2);
title('DFE coeff nl 3rd')
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
set(gcf,'Position',[200 500 700 400])
%set(gcf,'Position',[200 500 700 400])
end
if obj.l1act
neg_lin = find(abs(obj.e) < obj.thres(1));
neg_2nd = find(abs(obj.e2) < obj.thres(2));
@@ -369,6 +385,9 @@ classdef EQ
for k = 1:obj.K:length(data_in)
m=m+1; % Symbol index
X_1 = data(obj.Ne(1)+k-1:-1:k).';
[X_2,X_3] = obj.calc_nl_vecs(X_1,ind_mat_2nd,ind_mat_3rd,norm_fac2,norm_fac3,delta_2,delta_3,cplx);
if obj.l1act
@@ -405,6 +424,7 @@ classdef EQ
if mu_mat ~= 0
e_dc = e_dc - obj.DCmu*error;
error_log(end+1) = e_dc;
end
end
@@ -434,6 +454,7 @@ classdef EQ
if obj.plotfinal
figure(8054)
if obj.l1act
sgtitle('Final Coeff')
subplot(2,3,1); stem(rel_lin,obj.e,'Markersize',2);
title('FFE coeff linear')
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
@@ -453,6 +474,7 @@ classdef EQ
title('DFE coeff nl 3rd')
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
else
sgtitle('Final Coeff')
subplot(2,3,1); stem(obj.e/max(e_),'Markersize',2);
title('FFE coeff linear')
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)