+ duobinary_target now supports memoryless decoding (FFE targets DB response without MLSE) + PAMmapper.quantize now supports custom constellations for quantization + Added a new folder 'Documentations' for pdfs, slides, etc. + Added new FSO evaluation scripts in projects/FSO transmission/Evaluation Scripts + Added ffe_db (rudimentary module, not important anymore)
116 lines
3.9 KiB
Matlab
116 lines
3.9 KiB
Matlab
%%
|
|
clear all;
|
|
close all;
|
|
|
|
% General Parameters
|
|
M = 2;
|
|
fsym = 20e9;
|
|
K_over = 8;
|
|
fs = K_over*fsym;
|
|
pulselength_mf = 16;
|
|
rolloff_mf = 0.1;
|
|
N = 18;
|
|
Pform = Pulseformer("fsym",fsym,"fdac",fs,"pulse","rc","pulselength",16,"alpha",0.1);
|
|
duob_mode = db_mode.no_db;
|
|
|
|
% FFE Parameters
|
|
len_tr = 4096*2;
|
|
mu_ffe1 = 0.0001;
|
|
mu_ffe2 = 0.0008;
|
|
mu_ffe3 = 0.001;
|
|
mu_dc = 0.004;
|
|
mu_ffe = [mu_ffe1 mu_ffe3 mu_ffe3];
|
|
mu_dfe = 0.0004;
|
|
ffe_order = [300, 0, 0];
|
|
|
|
% Toggles
|
|
hybrid = 1;
|
|
ctle = 1;
|
|
timing_recovery = 0;
|
|
ffe = 0;
|
|
plots = 1;
|
|
|
|
% Generate Data
|
|
[a_1,a_1_Symbols,a_1_Tx_bits] = PAMsource(...
|
|
"fsym",fsym,"M",M,"order",N,"useprbs",0,...
|
|
"fs_out",fs,...
|
|
"applyclipping",0,"clipfactor",1.5,...
|
|
"applypulseform",1,"pulseformer",Pform,...
|
|
"randkey",1,...
|
|
'duobinary_mode',duob_mode,...
|
|
"mrds_code",0,"mrds_blocklength",512).process();
|
|
|
|
[a_2,a_2_Symbols,a_2_Tx_bits] = PAMsource(...
|
|
"fsym",fsym,"M",M,"order",18,"useprbs",0,...
|
|
"fs_out",fs,...
|
|
"applyclipping",0,"clipfactor",1.5,...
|
|
"applypulseform",1,"pulseformer",Pform,...
|
|
"randkey",1,...
|
|
'duobinary_mode',duob_mode,...
|
|
"mrds_code",0,"mrds_blocklength",512).process();
|
|
|
|
% S-Parameter Calculation
|
|
file_path = "C:\Users\magf\Desktop\Desktop\MATLAB-Zeugs\COM Test\Mellitz\host_pkg_top_50mm_max_skew_cable_module_pin_pad_fext1.s4p";
|
|
plot_parameters = 1;
|
|
test = 0;
|
|
S_test = [0,1;1,0];
|
|
[b_1, b_2] = Electrical_Trace_BiDi('file_path',file_path,'plot',plot_parameters,'test',test,'S_test',S_test).process(a_1,a_2);
|
|
|
|
% Hybrid
|
|
if hybrid
|
|
[~,b_1,~] = Electrical_Hybrid("file_path",file_path).process(a_1,b_1);
|
|
[~,b_2,~] = Electrical_Hybrid("file_path",file_path).process(a_2,b_2);
|
|
end
|
|
|
|
% CTLE
|
|
if ctle
|
|
b_2.normalize("mode","rms").plot("displayname",'Before CTLE','fignum',9);
|
|
b_2.normalize("mode","rms").spectrum("displayname",'Before CTLE','normalizeTo0dB',1,'fignum',10);
|
|
b_2.normalize("mode","rms").eye(fsym,2,'displayname','Before CTLE','fignum',11);
|
|
|
|
b_2 = CTLE('Aac_dB',0,'Adc_dB',-5,'f_p1',7.5e9,'f_p2',10e9,'plot',1).process(b_2);
|
|
|
|
b_2.normalize("mode","rms").plot("displayname",'After CTLE','fignum',9);
|
|
b_2.normalize("mode","rms").spectrum("displayname",'After CTLE','normalizeTo0dB',1,'fignum',10);
|
|
b_2.normalize("mode","rms").eye(fsym,2,'displayname','After CTLE','fignum',12);
|
|
end
|
|
|
|
% Timing Recovery
|
|
if timing_recovery
|
|
b_1 = MaxVar_Timing_Recovery('mode',0,'fsym',fsym,'fadc',K_over*fsym,'num_tau',K_over*128,'sps',K_over,'comp_signal',0,'comp_mode',0).process(b_1);
|
|
b_2 = MaxVar_Timing_Recovery('mode',0,'fsym',fsym,'fadc',K_over*fsym,'num_tau',K_over*128,'sps',K_over,'comp_signal',0,'comp_mode',0).process(b_2);
|
|
end
|
|
|
|
% FFE
|
|
if ffe
|
|
eq_ffe = EQ("Ne",ffe_order,"Nb",[0,0,0], ...
|
|
"training_length",len_tr,"training_loops",5,"dd_loops",5, ...
|
|
"K",1,"DCmu",mu_dc,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005, ...
|
|
"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
|
|
|
output.ffe_results = ffe(eq_ffe,M,b_2,a_1_Symbols,a_1_Tx_bits, ...
|
|
"precode_mode",duob_mode,'showAnalysis',1,"postFFE",[], ...
|
|
"eth_style_symbol_mapping",0);
|
|
|
|
output.ffe_results.metrics.print
|
|
end
|
|
|
|
% Plots
|
|
if plots
|
|
% Time Domain Signals
|
|
a_1.normalize("mode","rms").plot("displayname",'1st Port Tx','fignum',3);
|
|
b_2.normalize("mode","rms").plot("displayname",'2nd Port Rx','fignum',3);
|
|
|
|
a_2.normalize("mode","rms").plot("displayname",'2nd Port Tx','fignum',4);
|
|
b_1.normalize("mode","rms").plot("displayname",'1st Port Rx','fignum',4);
|
|
|
|
% Spectra
|
|
a_1.normalize("mode","rms").spectrum("displayname",'1st Port Tx','normalizeTo0dB',1,'fignum',5);
|
|
b_2.normalize("mode","rms").spectrum("displayname",'2nd Port Rx','normalizeTo0dB',1,'fignum',5);
|
|
|
|
a_2.normalize("mode","rms").spectrum("displayname",'2nd Port Tx','normalizeTo0dB',1,'fignum',6);
|
|
b_1.normalize("mode","rms").spectrum("displayname",'1st Port Rx','normalizeTo0dB',1,'fignum',6);
|
|
|
|
figure;plot(xcorr(a_1.signal,b_2.signal));
|
|
figure;plot(xcorr(a_2.signal,b_1.signal));
|
|
end |