Minimal Working - seems too good?!
This commit is contained in:
279
Classes/EQ.m
279
Classes/EQ.m
@@ -33,9 +33,24 @@ classdef EQ
|
||||
mode3rd %0: no reduction | 1: polynomial | 2: restricted to interval
|
||||
len_3rd %length of the interval (only for 3rd order mode = 3/4)
|
||||
|
||||
plottrain
|
||||
plotfinal
|
||||
load_decisions
|
||||
|
||||
save_taps
|
||||
|
||||
|
||||
%during simulation
|
||||
k0
|
||||
k0
|
||||
b
|
||||
b2
|
||||
b3
|
||||
e
|
||||
e2
|
||||
e3
|
||||
|
||||
coeff_number
|
||||
constellation_in
|
||||
|
||||
end
|
||||
|
||||
@@ -44,13 +59,65 @@ classdef EQ
|
||||
%EQ Construct an instance of this class
|
||||
% Detailed explanation goes here
|
||||
arguments(Input)
|
||||
options
|
||||
options.Ne = [10 0 0] %Number of feed forward coefficients (1st, 2nd and 3rd order)
|
||||
options.Nb = [10 0 0]%Number of decision feedback coefficients (1st, 2nd and 3rd order)
|
||||
options.K = 1 %Number of samples per symbol
|
||||
options.delay = 0 %Delay of incoming signal
|
||||
options.training_length = 1024 %Number of training symbols
|
||||
options.training_loops = 1 %Number of loops through sequence for training mode
|
||||
options.ideal_dfe = 0 %Error free DFE decisions
|
||||
|
||||
options.DB_aim %Aim at duobinary output sequence
|
||||
|
||||
options.M = 1 %Order of the PAM constellation (only relevant in case of DB aim)
|
||||
|
||||
options.FFEmu = 0 %mu parameter for FFE part in training mode (0 means normalized LMS)
|
||||
options.DFEmu = 0.005 % mu parameter for DFE part in training mode
|
||||
options.dd_loops = 1% Number of loops through sequence for DD mode
|
||||
options.DDmu = [0.0004 0.0004 0.0004 0.0004 ] % mu parameters for DD mode (individual value for each order)
|
||||
options.DCmu = 0.005 % mu parameter for the dc tap
|
||||
|
||||
options.l1act = 0 %Activate/deactive l1 regularization
|
||||
options.rho = 5e-4%Parameter for speed of coeff shrinking
|
||||
options.epsilon = [10 100 1000] %Reciprocal value of the magnitude of the coeff to converge to zero (1st,2nd,3rd order)
|
||||
options.thres = [5e-3 4e-3 5e-4]%Theshold for neglecting coefficienties (1st,2nd,3rd order)
|
||||
options.static_act = 0 %Activate/deactive static coefficient reduction
|
||||
|
||||
options.mode2nd = 1%0: no reduction | 1: polynomial | 2: restricted to interval
|
||||
options.len_2nd = 1 %length of the interval (only for 2nd order mode = 2)
|
||||
|
||||
options.mode3rd = 1%0: no reduction | 1: polynomial | 2: restricted to interval
|
||||
options.len_3rd = 1%length of the interval (only for 3rd order mode = 3/4)
|
||||
|
||||
options.plottrain = 0
|
||||
options.plotfinal = 0
|
||||
options.load_decisions = 0
|
||||
options.save_taps = 0
|
||||
end
|
||||
|
||||
fn = fieldnames(options);
|
||||
for n = 1:numel(fn)
|
||||
obj.(fn{n}) = options.(fn{n});
|
||||
end
|
||||
|
||||
% alles nochmal mappen
|
||||
end
|
||||
|
||||
function yout = process(obj,data_in,ref_in)
|
||||
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');
|
||||
|
||||
signalclass_in.signal = signalclass_in.signal';
|
||||
% append to logbook
|
||||
lbdesc = ['EQ '];
|
||||
signalclass_in = signalclass_in.logbookentry(lbdesc);
|
||||
|
||||
% write to output
|
||||
signalclass_out = signalclass_in;
|
||||
|
||||
end
|
||||
|
||||
function yout = process_(obj,data_in,ref_in)
|
||||
%METHOD1 Summary of this method goes here
|
||||
% Detailed explanation goes here
|
||||
|
||||
@@ -141,107 +208,107 @@ classdef EQ
|
||||
[ind_mat_DFE_2nd,ind_mat_DFE_3rd] = obj.calc_DFE_ind(obj.Nb(2),Nb2,obj.Nb(3),Nb3);
|
||||
|
||||
if obj.l1act
|
||||
epsilon = diag([ones(1,obj.Ne(1))*obj.epsilon(1) ones(1,N2)*obj.epsilon(2) ones(1,N3)*obj.epsilon(3)]);
|
||||
epsilon_ = diag([ones(1,obj.Ne(1))*obj.epsilon(1) ones(1,N2)*obj.epsilon(2) ones(1,N3)*obj.epsilon(3)]);
|
||||
end
|
||||
|
||||
obj.k0 = obj.delay; % input delay compared to training sequence
|
||||
|
||||
if 1 % obj.active
|
||||
%% Calculation of the filter coefficients in training based LMS mode
|
||||
e = zeros(obj.Ne(1)+N2+N3,1); % initialization of filter coefficients
|
||||
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);
|
||||
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 = state.k0+1; % starting symbol index at the delay compared to the training sequence
|
||||
for n = obj.K*state.k0+1:obj.K:obj.K*obj.training_length
|
||||
m = obj.k0+1; % starting symbol index at the delay compared to the training sequence
|
||||
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_2,X_3] = calc_nl_vecs(X_1,ind_mat_2nd,ind_mat_3rd,norm_fac2,norm_fac3,delta_2,delta_3,cplx);
|
||||
[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)-state.k0+m-2:-1:m-state.k0-1).';
|
||||
[D_2,D_3] = calc_nl_vecs(D_1,ind_mat_DFE_2nd,ind_mat_DFE_3rd,norm_fac_DFE2,norm_fac_DFE3,delta_DFE2,delta_DFE3,cplx);
|
||||
D_1 = ref(obj.Nb(1)-obj.k0+m-2:-1:m-obj.k0-1).';
|
||||
[D_2,D_3] = obj.calc_nl_vecs(D_1,ind_mat_DFE_2nd,ind_mat_DFE_3rd,norm_fac_DFE2,norm_fac_DFE3,delta_DFE2,delta_DFE3,cplx);
|
||||
|
||||
input_vec = [X_1;X_2;X_3];
|
||||
reference_vec = [D_1;D_2;D_3];
|
||||
error = e_dc + e.'*input_vec - b.'*reference_vec - ref_in(m-state.k0); % error = e_dc + e.'*input_vec - b.'*reference_vec - ref_in(m-state.k0);
|
||||
error = e_dc + e_.'*input_vec - b_.'*reference_vec - ref_in(m-obj.k0); % error = e_dc + e.'*input_vec - b.'*reference_vec - ref_in(m-obj.k0);
|
||||
|
||||
if real(obj.FFEmu)
|
||||
if obj.l1act
|
||||
sgn_e = e;
|
||||
sgn_e(e~=0) = e(e~=0)./abs(e(e~=0));
|
||||
e = e - obj.rho*sgn_e./(1+epsilon*abs(e)) - error*input_vec*obj.FFEmu;
|
||||
sgn_e = e_;
|
||||
sgn_e(e_~=0) = e_(e_~=0)./abs(e_(e_~=0));
|
||||
e_ = e_ - obj.rho*sgn_e./(1+epsilon_*abs(e_)) - error*input_vec*obj.FFEmu;
|
||||
else
|
||||
e = e - error*conj(input_vec)*obj.FFEmu; %e = e - error*conj(input_vec)*obj.FFEmu; %e = e - error*input_vec*obj.FFEmu;
|
||||
e_ = e_ - error*conj(input_vec)*obj.FFEmu; %e = e - error*conj(input_vec)*obj.FFEmu; %e = e - error*input_vec*obj.FFEmu;
|
||||
end
|
||||
else
|
||||
if obj.l1act
|
||||
sgn_e = e;
|
||||
sgn_e(e~=0) = e(e~=0)./abs(e(e~=0));
|
||||
e = e - obj.rho*sgn_e./(1+epsilon*abs(e)) - error*input_vec/(input_vec.'*input_vec);
|
||||
sgn_e = e_;
|
||||
sgn_e(e_~=0) = e_(e_~=0)./abs(e_(e_~=0));
|
||||
e_ = e_ - obj.rho*sgn_e./(1+epsilon_*abs(e_)) - error*input_vec/(input_vec.'*input_vec);
|
||||
else
|
||||
e = e - error*input_vec/(input_vec.'*input_vec);
|
||||
e_ = e_ - error*input_vec/(input_vec.'*input_vec);
|
||||
end
|
||||
end
|
||||
% e_save(:,save_ind) = e;
|
||||
% save_ind = save_ind+1;
|
||||
e_dc = e_dc - obj.dcmu*error;
|
||||
e_dc = e_dc - obj.DCmu*error;
|
||||
|
||||
if obj.Nb(1) > 0
|
||||
b = b + obj.DFEmu*error*reference_vec; % Seems like normalized DFE has worse performance
|
||||
b_ = b_ + obj.DFEmu*error*reference_vec; % Seems like normalized DFE has worse performance
|
||||
end
|
||||
end
|
||||
end
|
||||
%%
|
||||
|
||||
% Plot the intermediate coefficients after training mode
|
||||
state.b = b(1:obj.Nb(1));
|
||||
state.b2 = b(obj.Nb(1)+1:obj.Nb(1)+Nb2);
|
||||
state.b3 = b(obj.Nb(1)+Nb2+1:end);
|
||||
state.e = e(1:obj.Ne(1));
|
||||
state.e2 = e(obj.Ne(1)+1:obj.Ne(1)+N2);
|
||||
state.e3 = e(obj.Ne(1)+N2+1:end);
|
||||
obj.b = b_(1:obj.Nb(1));
|
||||
obj.b2 = b_(obj.Nb(1)+1:obj.Nb(1)+Nb2);
|
||||
obj.b3 = b_(obj.Nb(1)+Nb2+1:end);
|
||||
obj.e = e_(1:obj.Ne(1));
|
||||
obj.e2 = e_(obj.Ne(1)+1:obj.Ne(1)+N2);
|
||||
obj.e3 = e_(obj.Ne(1)+N2+1:end);
|
||||
|
||||
if obj.plottrain
|
||||
figure(8052)
|
||||
subplot(2,3,1); stem(abs(state.e),'Markersize',2);
|
||||
subplot(2,3,1); stem(abs(obj.e),'Markersize',2);
|
||||
title('FFE coeff linear')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,2); stem(state.e2,'Markersize',2);
|
||||
subplot(2,3,2); stem(obj.e2,'Markersize',2);
|
||||
title('FFE coeff nl 2nd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,3); stem(state.e3,'Markersize',2);
|
||||
subplot(2,3,3); stem(obj.e3,'Markersize',2);
|
||||
title('FFE coeff nl 3rd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,4);stem(state.b,'Markersize',2);
|
||||
subplot(2,3,4);stem(obj.b,'Markersize',2);
|
||||
title('DFE coeff linear')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,5);stem(state.b2,'Markersize',2);
|
||||
subplot(2,3,5);stem(obj.b2,'Markersize',2);
|
||||
title('DFE coeff nl 2nd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,6);stem(state.b3,'Markersize',2);
|
||||
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])
|
||||
end
|
||||
|
||||
if obj.l1act
|
||||
neg_lin = find(abs(state.e) < obj.thres(1));
|
||||
neg_2nd = find(abs(state.e2) < obj.thres(2));
|
||||
neg_3rd = find(abs(state.e3) < obj.thres(3));
|
||||
neg_lin = find(abs(obj.e) < obj.thres(1));
|
||||
neg_2nd = find(abs(obj.e2) < obj.thres(2));
|
||||
neg_3rd = find(abs(obj.e3) < obj.thres(3));
|
||||
|
||||
neg = [neg_lin;neg_2nd+obj.Ne(1);neg_3rd+obj.Ne(1)+N2]; % indices of the neglected coefficients
|
||||
|
||||
rel_lin = find(abs(state.e) >= obj.thres(1));
|
||||
rel_2nd = find(abs(state.e2) >= obj.thres(2));
|
||||
rel_3rd = find(abs(state.e3) >= obj.thres(3));
|
||||
rel_lin = find(abs(obj.e) >= obj.thres(1));
|
||||
rel_2nd = find(abs(obj.e2) >= obj.thres(2));
|
||||
rel_3rd = find(abs(obj.e3) >= obj.thres(3));
|
||||
|
||||
state.coeff_number = length(rel_lin)+2*length(rel_2nd)+3*length(rel_3rd);
|
||||
obj.coeff_number = length(rel_lin)+2*length(rel_2nd)+3*length(rel_3rd);
|
||||
|
||||
rel = [rel_lin;rel_2nd+obj.Ne(1);rel_3rd+obj.Ne(1)+N2]; % indices of the relevant coefficients
|
||||
e(neg) = 0;
|
||||
e_(neg) = 0;
|
||||
|
||||
ind_mat_2nd(neg_2nd,:) = [];
|
||||
|
||||
@@ -250,24 +317,25 @@ classdef EQ
|
||||
|
||||
%% decision directed mode
|
||||
if ~obj.DB_aim
|
||||
constellation_in = unique(ref_in); % getting the symbol constellation from reference data
|
||||
constellation_in_ = unique(ref_in); % getting the symbol constellation from reference data
|
||||
else
|
||||
if obj.M == 2
|
||||
constellation_in = [-3 -2 -1 0 1 2 3]/sqrt(5)*2;
|
||||
constellation_in_ = [-3 -2 -1 0 1 2 3]/sqrt(5)*2;
|
||||
elseif obj.M == 2.5
|
||||
constellation_in = [-5 -4 -3 -2 -1 0 1 2 3 4 5]/sqrt(10)*2;
|
||||
constellation_in_ = [-5 -4 -3 -2 -1 0 1 2 3 4 5]/sqrt(10)*2;
|
||||
elseif obj.M == 3
|
||||
constellation_in = [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]/sqrt(21)*2;
|
||||
constellation_in_ = [-7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7]/sqrt(21)*2;
|
||||
else
|
||||
constellation_in = unique(ref_in);
|
||||
constellation_in_ = unique(ref_in);
|
||||
end
|
||||
end
|
||||
|
||||
state.constellation_in = constellation_in;
|
||||
obj.constellation_in = constellation_in_;
|
||||
|
||||
if obj.l1act
|
||||
coeff = [e(rel);b]; % combine FFE and DFE coefficient vectors for DD mode
|
||||
coeff = [e_(rel);b_]; % combine FFE and DFE coefficient vectors for DD mode
|
||||
else
|
||||
coeff = [e;b];
|
||||
coeff = [e_;b_];
|
||||
end
|
||||
|
||||
for dd_loop = 1:obj.dd_loops
|
||||
@@ -277,20 +345,21 @@ classdef EQ
|
||||
D_2 = zeros(Nb2,1);
|
||||
D_3 = zeros(Nb3,1);
|
||||
|
||||
if all(obj.mu == obj.mu(1))
|
||||
mu_mat = obj.mu(1);
|
||||
if all(obj.DDmu == obj.DDmu(1))
|
||||
mu_mat = obj.DDmu(1);
|
||||
else
|
||||
if obj.l1act
|
||||
mu_mat = diag([ones(1,length(rel_lin))*obj.mu(1) ones(1,length(rel_2nd))*obj.mu(2) ones(1,length(rel_3rd))*obj.mu(3) ones(1,obj.Nb)*obj.mu(4)]);
|
||||
mu_mat = diag([ones(1,length(rel_lin))*obj.DDmu(1) ones(1,length(rel_2nd))*obj.DDmu(2) ones(1,length(rel_3rd))*obj.DDmu(3) ones(1,obj.Nb)*obj.DDmu(4)]);
|
||||
else
|
||||
mu_mat = diag([ones(1,obj.Ne(1))*obj.mu(1) ones(1,N2)*obj.mu(2) ones(1,N3)*obj.mu(3) ones(1,obj.Nb(1)+Nb2+Nb3)*obj.mu(4)]);
|
||||
mu_mat = diag([ones(1,obj.Ne(1))*obj.DDmu(1) ones(1,N2)*obj.DDmu(2) ones(1,N3)*obj.DDmu(3) ones(1,obj.Nb(1)+Nb2+Nb3)*obj.DDmu(4)]);
|
||||
end
|
||||
end
|
||||
|
||||
if obj.load_decisions
|
||||
pathn = evalin('base','modeldir');
|
||||
temp = load([pathn, 'MLSE_out', '.mat']) ;
|
||||
eval(['dd_out_vals = temp.', 'a', ';']) ;
|
||||
%eval(['dd_out_vals = temp.', 'a', ';']) ;
|
||||
dd_out_vals=temp.a;
|
||||
dd_out = zeros(size(data_in));
|
||||
dd_out(1:2:length(data_in)) = dd_out_vals;
|
||||
else
|
||||
@@ -300,7 +369,7 @@ 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] = calc_nl_vecs(X_1,ind_mat_2nd,ind_mat_3rd,norm_fac2,norm_fac3,delta_2,delta_3,cplx);
|
||||
[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
|
||||
input_vec = [X_1(rel_lin);X_2;X_3;-dd_DFE;-D_2;-D_3];
|
||||
@@ -311,18 +380,18 @@ classdef EQ
|
||||
output_vec(m) = e_dc + input_vec.'*coeff;
|
||||
|
||||
if ~obj.load_decisions
|
||||
[~,dd_idx] = min(abs(output_vec(m) - constellation_in)); % decision for closest constellation point
|
||||
dd_out(k) = constellation_in(dd_idx);
|
||||
[~,dd_idx] = min(abs(output_vec(m) - constellation_in_)); % decision for closest constellation point
|
||||
dd_out(k) = constellation_in_(dd_idx);
|
||||
end
|
||||
|
||||
if obj.Nb(1) > 0
|
||||
dd_DFE(2:end) = dd_DFE(1:end-1);
|
||||
dd_DFE(1) = dd_out(k);
|
||||
|
||||
if obj.error_free && m > state.k0
|
||||
dd_DFE(1) = ref_in(m-state.k0);
|
||||
if obj.ideal_dfe && m > obj.k0
|
||||
dd_DFE(1) = ref_in(m-obj.k0);
|
||||
end
|
||||
[D_2,D_3] = calc_nl_vecs(dd_DFE,ind_mat_DFE_2nd,ind_mat_DFE_3rd,norm_fac_DFE2,norm_fac_DFE3,delta_DFE2,delta_DFE3,cplx);
|
||||
[D_2,D_3] = obj.calc_nl_vecs(dd_DFE,ind_mat_DFE_2nd,ind_mat_DFE_3rd,norm_fac_DFE2,norm_fac_DFE3,delta_DFE2,delta_DFE3,cplx);
|
||||
end
|
||||
% if dd_loop ~= 21
|
||||
error = output_vec(m) - dd_out(k);
|
||||
@@ -335,18 +404,96 @@ classdef EQ
|
||||
% save_ind = save_ind+1;
|
||||
|
||||
if mu_mat ~= 0
|
||||
e_dc = e_dc - obj.dcmu*error;
|
||||
e_dc = e_dc - obj.DCmu*error;
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
% shifting the output sequence by k0 symbols
|
||||
yout = (circshift(output_vec.',-(obj.k0))).'; %(circshift(dd_out.',-(obj.k0))).';
|
||||
|
||||
e_ = coeff(1:end-obj.Nb(1)-Nb2-Nb3);
|
||||
b_ = coeff(end-obj.Nb(1)-Nb2-Nb3+1:end);
|
||||
|
||||
if obj.l1act
|
||||
obj.e = e_(1:length(rel_lin));
|
||||
obj.e2 = e_(length(rel_lin)+1:length(rel_lin)+length(rel_2nd));
|
||||
obj.e3 = e_(length(rel_lin)+length(rel_2nd)+1:end);
|
||||
else
|
||||
obj.e = e_(1:obj.Ne(1));
|
||||
obj.e2 = e_(obj.Ne(1)+1:obj.Ne(1)+N2);
|
||||
obj.e3 = e_(obj.Ne(1)+N2+1:end);
|
||||
end
|
||||
obj.b = b_(1:obj.Nb(1));
|
||||
obj.b2 = b_(obj.Nb(1)+1:obj.Nb(1)+Nb2);
|
||||
obj.b3 = b_(obj.Nb(1)+Nb2+1:end);
|
||||
|
||||
% plot the final coefficients after DD mode
|
||||
if obj.plotfinal
|
||||
figure(8054)
|
||||
if obj.l1act
|
||||
subplot(2,3,1); stem(rel_lin,obj.e,'Markersize',2);
|
||||
title('FFE coeff linear')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,2); stem(rel_2nd,obj.e2,'Markersize',2);
|
||||
title('FFE coeff nl 2nd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,3); stem(rel_3rd,obj.e3,'Markersize',2);
|
||||
title('FFE coeff nl 3rd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,4);stem(obj.b,'Markersize',2);
|
||||
title('DFE coeff linear')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,5);stem(obj.b2,'Markersize',2);
|
||||
title('DFE coeff nl 2nd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,6);stem(obj.b3,'Markersize',2);
|
||||
title('DFE coeff nl 3rd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
else
|
||||
subplot(2,3,1); stem(obj.e/max(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);
|
||||
title('FFE coeff nl 2nd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,3); stem(obj.e3,'Markersize',2);
|
||||
title('FFE coeff nl 3rd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,4);stem(obj.b,'Markersize',2);
|
||||
title('DFE coeff linear')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,5);stem(obj.b2,'Markersize',2);
|
||||
title('DFE coeff nl 2nd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
subplot(2,3,6);stem(obj.b3,'Markersize',2);
|
||||
title('DFE coeff nl 3rd')
|
||||
xlabel('coefficient index'); ylabel('value'); set(gca,'Fontsize',12)
|
||||
end
|
||||
set(gcf,'Position',[1000 500 700 400])
|
||||
end
|
||||
|
||||
% save frequency response to the work space
|
||||
if obj.save_taps
|
||||
% save the FFE coefficients to the work space
|
||||
% pathn = evalin('base','modeldir');
|
||||
% eval([obj.field_ffe, ' = obj.e ;']) ;
|
||||
% eval([obj.field_dfe, ' = b ;']) ;
|
||||
% eval(['save(''', pathn, '\',obj.filen,''', ''', obj.field_ffe,''', ''',obj.field_dfe,''') ;']) ;
|
||||
|
||||
save("coefficients",obj.e, obj.b);
|
||||
end
|
||||
|
||||
else
|
||||
yout = data_in;
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
function [X_2,X_3] = calc_nl_vecs(X_1,ind_mat_2,ind_mat_3,norm_fac2,norm_fac3,delta_2,delta_3,cplx)
|
||||
function [X_2,X_3] = calc_nl_vecs(obj,X_1,ind_mat_2,ind_mat_3,norm_fac2,norm_fac3,delta_2,delta_3,cplx)
|
||||
% calculation of the vectors containing all combinations of input symbols
|
||||
% of second and third order based on the linear symbols
|
||||
|
||||
@@ -370,7 +517,7 @@ classdef EQ
|
||||
end
|
||||
end
|
||||
|
||||
function [ind_mat_2nd,ind_mat_3rd] = calc_ind(Ne2,N2,Ne3,N3,mode2nd,mode3rd,len_2nd,len_3rd,cplx)
|
||||
function [ind_mat_2nd,ind_mat_3rd] = calc_ind(obj,Ne2,N2,Ne3,N3,mode2nd,mode3rd,len_2nd,len_3rd,cplx)
|
||||
|
||||
if Ne2 > 0
|
||||
ind_mat_2nd = NaN(N2,2);
|
||||
@@ -498,7 +645,7 @@ classdef EQ
|
||||
|
||||
end
|
||||
|
||||
function [ind_mat_2nd,ind_mat_3rd] = calc_DFE_ind(Ne2,N2,Ne3,N3)
|
||||
function [ind_mat_2nd,ind_mat_3rd] = calc_DFE_ind(obj,Ne2,N2,Ne3,N3)
|
||||
|
||||
if Ne2 > 0
|
||||
ind_mat_2nd = NaN(N2,2);
|
||||
|
||||
Reference in New Issue
Block a user