Many changes for 400G DSP

Minimal Example
...
This commit is contained in:
sioe
2024-12-17 16:17:58 +01:00
parent 397cfa61dd
commit e47a4dbbbe
68 changed files with 2749 additions and 2948 deletions

View File

@@ -0,0 +1,150 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1365 313" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;">
<g transform="matrix(1,0,0,1,-350.052,-234.682)">
<g id="g40994" transform="matrix(3.14734,0,0,3.14734,-400.995,-235.585)">
<path id="rect40684" d="M277.516,207.069C277.516,206.587 277.125,206.197 276.643,206.197L240.002,206.197C239.52,206.197 239.129,206.587 239.129,207.069L239.129,243.711C239.129,244.192 239.52,244.583 240.002,244.583L276.643,244.583C277.125,244.583 277.516,244.192 277.516,243.711L277.516,207.069Z" style="fill:none;stroke:black;stroke-width:1px;"/>
<g id="g40700" transform="matrix(1,0,0,1,53.6992,6.29287)">
<path id="path40686" d="M211.915,223.139L198.35,223.139L201.742,217.266L205.133,211.392L208.524,217.266L211.915,223.139Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
<path id="path40688" d="M205.133,223.139L205.133,230.555" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
<path id="path40690" d="M205.133,211.392L205.133,205.096" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
<path id="path40694" d="M198.143,211.392L212.123,211.392" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
</g>
<g id="path40702" transform="matrix(0.317729,-0,-0,0.317729,238.629,149.417)">
<path d="M82.941,200.888L86.409,190.917L76.351,194.125C79.689,194.169 82.984,197.55 82.941,200.888Z" style="fill:rgb(255,0,0);fill-rule:nonzero;"/>
<path d="M80.998,196.189C77.477,199.62 73.535,203.461 73.535,203.461" style="fill:none;fill-rule:nonzero;stroke:rgb(255,0,0);stroke-width:3.15px;"/>
</g>
<g id="path40702-1" transform="matrix(0.317729,-0,-0,0.317729,238.629,149.417)">
<path d="M102.022,200.888L105.49,190.917L95.433,194.125C98.771,194.169 102.066,197.55 102.022,200.888Z" style="fill:rgb(255,0,0);fill-rule:nonzero;"/>
<path d="M100.08,196.189C96.559,199.62 92.617,203.461 92.617,203.461" style="fill:none;fill-rule:nonzero;stroke:rgb(255,0,0);stroke-width:3.15px;"/>
</g>
</g>
<g id="g40994-4" transform="matrix(3.07687,0,0,3.07687,-308.034,-474.106)">
<g id="g41806">
<path id="path41709" d="M272.852,307.633L280.529,307.633L288.207,302.14L295.884,302.141L303.561,307.633L311.239,307.633" style="fill:none;fill-rule:nonzero;stroke:rgb(2,0,0);stroke-width:1px;"/>
<path id="path41709-4" d="M272.852,307.633L280.529,307.633L288.207,313.126L295.884,313.126L303.561,307.633L311.239,307.633" style="fill:none;fill-rule:nonzero;stroke:rgb(2,0,0);stroke-width:1px;"/>
</g>
<path id="rect40684-3" d="M311.239,289.332C311.239,288.84 310.839,288.44 310.346,288.44L273.745,288.44C273.252,288.44 272.852,288.84 272.852,289.332L272.852,325.934C272.852,326.427 273.252,326.827 273.745,326.827L310.346,326.827C310.839,326.827 311.239,326.427 311.239,325.934L311.239,289.332Z" style="fill:none;stroke:rgb(2,0,0);stroke-width:1px;"/>
</g>
<g transform="matrix(1,0,0,1,462.763,-27.6418)">
<g id="g42228" transform="matrix(3.07687,0,0,3.07687,-770.796,-623.629)">
<path id="rect40684-3-5" d="M311.239,289.332C311.239,288.84 310.839,288.44 310.346,288.44L273.745,288.44C273.252,288.44 272.852,288.84 272.852,289.332L272.852,325.934C272.852,326.427 273.252,326.827 273.745,326.827L310.346,326.827C310.839,326.827 311.239,326.427 311.239,325.934L311.239,289.332Z" style="fill:none;stroke:rgb(2,0,0);stroke-width:1px;"/>
</g>
<g transform="matrix(0.916758,0,0,0.916758,-209.942,-134.558)">
<g transform="matrix(36.36,0,0,36.36,410.943,511.232)">
</g>
<text x="325.44px" y="511.232px" style="font-family:'ArialMT', 'Arial';font-size:36.36px;">A<tspan x="348.342px 382.661px " y="511.232px 511.232px ">WG</tspan></text>
</g>
</g>
<g id="use14586" transform="matrix(4.16667,0,0,4.16667,538.992,319.037)">
<g id="path38721" transform="matrix(1.27892,-0.000404508,-0.000404508,1,-27.2331,0.0394952)">
<path d="M71.975,37.134L122.852,37.061" style="fill:none;fill-rule:nonzero;stroke:rgb(255,0,0);stroke-width:0.73px;"/>
</g>
<circle id="circle38723" cx="90.574" cy="26.615" r="10.503" style="fill:none;stroke:rgb(255,0,0);stroke-width:0.73px;"/>
<circle id="circle38725" cx="96.619" cy="26.638" r="10.503" style="fill:none;stroke:rgb(255,0,0);stroke-width:0.73px;"/>
<circle id="circle38727" cx="102.664" cy="26.594" r="10.503" style="fill:none;stroke:rgb(255,0,0);stroke-width:0.73px;"/>
</g>
<g transform="matrix(1,0,0,1,-180.978,231.592)">
<g transform="matrix(1.12196,0,0,1.12196,-146.494,-56.6939)">
<circle cx="974.409" cy="265.748" r="29.528" style="fill:white;stroke:rgb(255,0,0);stroke-width:2.67px;stroke-miterlimit:1.5;"/>
</g>
<g transform="matrix(1.16567,-0.0445706,-0.0445706,1.1674,-141.533,6.43198)">
<g transform="matrix(0.859131,0.032801,0.032801,0.857855,577.71,19.194)">
<path d="M441.614,202.956L452.737,201.256L451.254,212.411L441.614,202.956Z" style="fill:rgb(255,0,0);"/>
<path d="M382.592,272.779C382.592,272.779 431.613,222.795 447.694,206.398" style="fill:none;stroke:rgb(255,0,0);stroke-width:3px;stroke-miterlimit:1.5;"/>
</g>
</g>
<g transform="matrix(1,0,0,1,-20.5026,130.73)">
<text x="933.238px" y="184.877px" style="font-family:'ArialMT', 'Arial';font-size:33.333px;">P</text>
<g transform="matrix(20.8333,0,0,20.8333,1016.86,184.877)">
</g>
<text x="955.471px" y="184.877px" style="font-family:'ArialMT', 'Arial';font-size:20.833px;">launch</text>
</g>
</g>
<g transform="matrix(1,0,0,1,350.518,231.592)">
<g transform="matrix(1.12196,0,0,1.12196,-146.494,-56.6939)">
<circle cx="974.409" cy="265.748" r="29.528" style="fill:white;stroke:rgb(255,0,0);stroke-width:2.67px;stroke-miterlimit:1.5;"/>
</g>
<g transform="matrix(1.16567,-0.0445706,-0.0445706,1.1674,-141.533,6.43198)">
<g transform="matrix(0.859131,0.032801,0.032801,0.857855,121.085,1.76038)">
<path d="M973.11,202.956L984.233,201.256L982.75,212.411L973.11,202.956Z" style="fill:rgb(255,0,0);"/>
<path d="M914.089,272.779C914.089,272.779 963.109,222.795 979.19,206.398" style="fill:none;stroke:rgb(255,0,0);stroke-width:3px;stroke-miterlimit:1.5;"/>
</g>
</g>
<g transform="matrix(1,0,0,1,-20.5026,130.73)">
<text x="937.937px" y="184.877px" style="font-family:'ArialMT', 'Arial';font-size:33.333px;">PD</text>
<g transform="matrix(20.8333,0,0,20.8333,1000.46,184.877)">
</g>
<text x="984.242px" y="184.877px" style="font-family:'ArialMT', 'Arial';font-size:20.833px;">in</text>
</g>
</g>
<g transform="matrix(1.04523e-16,1.70851,-1.55299,9.48961e-17,2134.48,-837.195)">
<path d="M767.327,630.707L794.304,673.144L740.349,673.144L767.327,630.707Z" style="fill:none;stroke:rgb(255,20,3);stroke-width:1.84px;stroke-miterlimit:1.5;"/>
</g>
<g id="g409941" serif:id="g40994" transform="matrix(3.07687,0,0,3.07687,681.554,-221.053)">
<path id="rect406841" serif:id="rect40684" d="M277.516,207.089C277.516,206.596 277.116,206.197 276.623,206.197L240.022,206.197C239.529,206.197 239.129,206.596 239.129,207.089L239.129,243.691C239.129,244.183 239.529,244.583 240.022,244.583L276.623,244.583C277.116,244.583 277.516,244.183 277.516,243.691L277.516,207.089Z" style="fill:none;stroke:black;stroke-width:1px;"/>
<g id="g407001" serif:id="g40700" transform="matrix(1,0,0,1,53.6992,6.29287)">
<path id="path406861" serif:id="path40686" d="M211.915,223.139L198.35,223.139L201.742,217.266L205.133,211.392L208.524,217.266L211.915,223.139Z" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
<path id="path406881" serif:id="path40688" d="M205.133,223.139L205.133,230.555" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
<path id="path406901" serif:id="path40690" d="M205.133,211.392L205.133,205.096" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
<path id="path406941" serif:id="path40694" d="M198.143,211.392L212.123,211.392" style="fill:none;fill-rule:nonzero;stroke:black;stroke-width:1px;"/>
</g>
<g id="path407021" serif:id="path40702" transform="matrix(0.325006,-0,-0,0.325006,-107.74,148.117)">
<path d="M1147.45,199.771L1137.62,202.907L1141.01,193.159C1140.97,196.423 1144.19,199.728 1147.45,199.771Z" style="fill:rgb(255,0,0);fill-rule:nonzero;"/>
<path d="M1150.21,190.644C1150.21,190.644 1146.35,194.399 1142.91,197.753" style="fill:none;fill-rule:nonzero;stroke:rgb(255,0,0);stroke-width:3.08px;"/>
</g>
<g id="path40702-11" serif:id="path40702-1" transform="matrix(0.325006,-0,-0,0.325006,-107.74,148.117)">
<path d="M1166.11,199.771L1156.28,202.907L1159.67,193.159C1159.62,196.423 1162.84,199.728 1166.11,199.771Z" style="fill:rgb(255,0,0);fill-rule:nonzero;"/>
<path d="M1168.86,190.644C1168.86,190.644 1165.01,194.399 1161.56,197.753" style="fill:none;fill-rule:nonzero;stroke:rgb(255,0,0);stroke-width:3.08px;"/>
</g>
</g>
<g transform="matrix(1,0,0,1,1525.75,150.876)">
<g id="g422281" serif:id="g42228" transform="matrix(3.07687,0,0,3.07687,-770.796,-623.629)">
<path id="rect40684-3-51" serif:id="rect40684-3-5" d="M311.239,289.332C311.239,288.84 310.839,288.44 310.346,288.44L273.745,288.44C273.252,288.44 272.852,288.84 272.852,289.332L272.852,325.934C272.852,326.427 273.252,326.827 273.745,326.827L310.346,326.827C310.839,326.827 311.239,326.427 311.239,325.934L311.239,289.332Z" style="fill:none;stroke:rgb(2,0,0);stroke-width:1px;"/>
</g>
<g transform="matrix(0.916758,0,0,0.916758,-209.942,-134.558)">
<g transform="matrix(36.36,0,0,36.36,405.909,511.232)">
</g>
<text x="330.473px" y="511.232px" style="font-family:'ArialMT', 'Arial';font-size:36.36px;">R<tspan x="356.074px " y="511.232px ">T</tspan>O</text>
</g>
</g>
<g transform="matrix(1.26861,0.00113446,0.00113446,1,277.224,235.237)">
<g transform="matrix(0.788264,-0.000894252,-0.000894252,0.999996,57.4082,-0.620229)">
<path d="M368.303,230.541L376.948,237.082L368.248,243.55L368.303,230.541Z" style="fill:rgb(255,0,0);"/>
<path d="M304.499,236.776C304.499,236.776 351.883,236.976 370.01,237.053" style="fill:none;stroke:rgb(255,0,0);stroke-width:2.89px;stroke-miterlimit:1.5;"/>
</g>
</g>
<g transform="matrix(0.934186,-0.000277962,-0.000277962,0.999999,198.405,236.65)">
<g transform="matrix(1.07045,0.000297545,0.000297545,1,162.33,-1.92253)">
<path d="M170.653,231.452L179.298,237.993L170.598,244.461L170.653,231.452Z" style="fill:rgb(255,0,0);"/>
<path d="M125.948,237.768C125.948,237.768 157.916,237.903 172.36,237.964" style="fill:none;stroke:rgb(255,0,0);stroke-width:2.89px;stroke-miterlimit:1.5;"/>
</g>
</g>
<g transform="matrix(1.73353,0.00309801,0.00309801,1.00001,639.025,236.856)">
<g transform="matrix(0.57686,-0.0017871,-0.0017871,0.999992,-166.693,-1.6572)">
<path d="M895.303,232.857L903.948,239.399L895.248,245.866L895.303,232.857Z" style="fill:rgb(255,0,0);"/>
<path d="M804.948,238.98C804.948,238.98 874.5,239.274 897.01,239.369" style="fill:none;stroke:rgb(255,0,0);stroke-width:2.89px;stroke-miterlimit:1.5;"/>
</g>
</g>
<g transform="matrix(1.45403,0.00191757,0.00191757,1.00001,901.662,237.501)">
<g transform="matrix(0.687744,-0.00131879,-0.00131879,0.999994,-379.363,-2.09148)">
<path d="M1058.63,233.083L1067.27,239.624L1058.57,246.092L1058.63,233.083Z" style="fill:rgb(255,0,0);"/>
<path d="M984.233,239.274C984.233,239.274 1040.38,239.511 1060.33,239.595" style="fill:none;stroke:rgb(255,0,0);stroke-width:2.89px;stroke-miterlimit:1.5;"/>
</g>
</g>
<g transform="matrix(0.00422338,0.959693,-0.999991,0.00405319,825.177,70.1581)">
<path d="M297.222,235.883L354.331,236.124" style="fill:none;"/>
<g transform="matrix(0.00422338,-0.999991,1.04198,0.00440072,169.424,475.845)">
<path d="M248.693,165.557L240.499,176.482L232.306,165.557L248.693,165.557Z"/>
<path d="M240.499,121.674L240.499,167.742" style="fill:none;stroke:black;stroke-width:3.64px;stroke-miterlimit:1.5;"/>
</g>
</g>
<g transform="matrix(0.959693,-0.00422338,0.00405319,0.999991,1250.8,239.181)">
<path d="M297.222,235.883L354.331,236.124" style="fill:none;"/>
<g transform="matrix(1.04198,0.00440072,-0.00422338,0.999991,-938.545,-8.46312)">
<path d="M1230.83,230.931L1241.76,239.125L1230.83,247.318L1230.83,230.931Z"/>
<path d="M1186.95,239.125L1233.02,239.125" style="fill:none;stroke:black;stroke-width:3.64px;stroke-miterlimit:1.5;"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M480-120q-151 0-255.5-46.5T120-280v-400q0-66 105.5-113T480-840q149 0 254.5 47T840-680v400q0 67-104.5 113.5T480-120Zm0-479q89 0 179-25.5T760-679q-11-29-100.5-55T480-760q-91 0-178.5 25.5T200-679q14 30 101.5 55T480-599Zm0 199q42 0 81-4t74.5-11.5q35.5-7.5 67-18.5t57.5-25v-120q-26 14-57.5 25t-67 18.5Q600-528 561-524t-81 4q-42 0-82-4t-75.5-11.5Q287-543 256-554t-56-25v120q25 14 56 25t66.5 18.5Q358-408 398-404t82 4Zm0 200q46 0 93.5-7t87.5-18.5q40-11.5 67-26t32-29.5v-98q-26 14-57.5 25t-67 18.5Q600-328 561-324t-81 4q-42 0-82-4t-75.5-11.5Q287-343 256-354t-56-25v99q5 15 31.5 29t66.5 25.5q40 11.5 88 18.5t94 7Z"/></svg>

After

Width:  |  Height:  |  Size: 729 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="m105-399-65-47 200-320 120 140 160-260 120 180 135-214 65 47-198 314-119-179-152 247-121-141-145 233Zm475 159q42 0 71-29t29-71q0-42-29-71t-71-29q-42 0-71 29t-29 71q0 42 29 71t71 29ZM784-80 676-188q-21 14-45.5 21t-50.5 7q-75 0-127.5-52.5T400-340q0-75 52.5-127.5T580-520q75 0 127.5 52.5T760-340q0 26-7 50.5T732-244l108 108-56 56Z"/></svg>

After

Width:  |  Height:  |  Size: 452 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e8eaed"><path d="M440-120v-480H120v-160q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H440Zm80-80h240v-160H520v160Zm0-240h240v-160H520v160ZM200-680h560v-80H200v80ZM120-80v-80h102q-48-23-77.5-68T115-330q0-79 55.5-134.5T305-520v80q-45 0-77.5 32T195-330q0 39 24 69t61 38v-97h80v240H120Z"/></svg>

After

Width:  |  Height:  |  Size: 421 B

View File

@@ -1,85 +0,0 @@
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
useGui = 0;
db = DBHandler("pathToDB",[basePath,'silas_labor.db']);
if useGui
filterParams = db.promptFilterParameters();
selectedFields = db.promptSelectFields();
else
filterParams = db.tables;
filterParams.Configurations = struct( ...
'bitrate', [], ...
'db_mode', [], ...
'fiber_length', 10, ...
'interference_attenuation', [], ...
'interference_path_length', [], ...
'is_mpi', 0, ...
'pam_level', [], ...
'precomp_amp', [], ...
'rop_attenuation', 0, ...
'symbolrate', [], ...
'v_awg', [], ...
'v_bias', [], ...
'wavelength', 1310 ...
);
filterParams.Equalizer.eq_type = equalizer_structure.vnle_pf_mlse;
filterParams.Equalizer.eq_id = equalizer_structure.vnle;
selectedFields = {'Runs.run_id','BERs.ber_id','Equalizer.eq_id','Equalizer.eq_type','BERs.ber','BERs.occurrence',...
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp',...
'Measurements.power_rop','Measurements.power_laser','Measurements.power_pd_in'};
end
[dataTable,~] = db.queryDB(filterParams, selectedFields);
% Calculate the mean BER for each combination of 'run_id' and 'eq_type'
groupedData = groupsummary(dataTable, {'run_id', 'eq_type'}, 'mean', {'ber', 'power_rop','power_pd_in'});
% Extract unique rows from dataTable for each run_id with relevant configuration details
uniqueConfigFields = {'run_id', 'pam_level', 'bitrate','symbolrate', 'fiber_length', 'wavelength', 'precomp_amp', 'db_mode'};
[~, uniqueIdx] = unique(dataTable.run_id); % Get unique run_id indices
configDetails = dataTable(uniqueIdx, uniqueConfigFields); % Extract unique configurations for each run_id
% Prepare the join key for both groupedData and configDetails
groupedDataTable = table(groupedData.run_id, groupedData.eq_type, groupedData.GroupCount, groupedData.mean_ber,groupedData.mean_power_rop,groupedData.mean_power_pd_in, ...
'VariableNames', {'run_id', 'eq_type', 'GroupCount', 'mean_ber','mean_power_rop','mean_power_pd_in'});
% Join groupedData with configDetails on the run_id field
joinedData = join(groupedDataTable, configDetails, 'Keys', 'run_id');
a=plot(fsym_vals.*1e-9.*log2(M_vals(modulation_iter)),ber_ffe(:,modulation_iter),...
'Color',cols(modulation_iter,:),'MarkerSize',2,'LineWidth',1,...
'Marker','o','MarkerFaceColor',cols(modulation_iter,:),'MarkerEdgeColor','black',...
'DisplayName',['PAM ',num2str(M_vals(modulation_iter))]);
a.DataTipTemplate.DataTipRows(1).Label = 'Bitr';
a.DataTipTemplate.DataTipRows(1).Format = ['%.1f',' Gbps'];
a.DataTipTemplate.DataTipRows(2).Label = 'BER';
a.DataTipTemplate.DataTipRows(2).Format ='%.1e';
a.DataTipTemplate.DataTipRows(3).Label = 'P_{out}';
a.DataTipTemplate.DataTipRows(3).Value = rop(:,modulation_iter);
a.DataTipTemplate.DataTipRows(3).Format = ['%.2f',' dBm'];
a.DataTipTemplate.DataTipRows(4).Label = 'Baudr';
a.DataTipTemplate.DataTipRows(4).Value = fsym_vals.*1e-9;
a.DataTipTemplate.DataTipRows(4).Format = ['%.1f',' GBd'];
a.DataTipTemplate.FontSize = 9;
a.DataTipTemplate.FontName = 'arial';
% Continue with the rest of your plot settings
title('Opt B2B')
yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
xlabel('Bit Rate in GBps');
ylabel('Bit Error Rate (BER)');
set(gca, 'yscale', 'log');
set(gca, 'Box', 'on');
grid on;
grid minor;
legend('Interpreter', 'none');

View File

@@ -0,0 +1,137 @@
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
useGui = 0;
pamlvls = [4, 6, 8];
wlengths = [1310];
db = DBHandler("pathToDB", [basePath, 'silas_labor.db']);
for w = 1:numel(wlengths)
for p = 1:numel(pamlvls)
% Load data from database
joinedData = loadDataFromDB(db, pamlvls(p), wlengths(w), useGui);
% Plot filtered data
figure(pamlvls(p));
hold on;
plotFilteredData(joinedData, wlengths(w));
% Continue with the rest of your plot settings
finalizePlot();
end
end
% Custom function to load data from database
function joinedData = loadDataFromDB(db, pamlvl, wlength, useGui)
if useGui
filterParams = db.promptFilterParameters();
selectedFields = db.promptSelectFields();
else
filterParams = db.tables;
filterParams.Configurations = struct( ...
'bitrate', [], 'db_mode', [], 'fiber_length', 1, ...
'interference_attenuation', [], 'interference_path_length', [], ...
'is_mpi', 0, 'pam_level', pamlvl, 'precomp_amp', [], ...
'rop_attenuation', 0, 'symbolrate', [], 'v_awg', [], 'v_bias', [], ...
'wavelength', wlength ...
);
selectedFields = {'Runs.run_id', 'BERs.ber_id', 'Equalizer.eq_id', 'Equalizer.eq_type', 'BERs.ber', 'BERs.occurrence', ...
'Configurations.db_mode', 'Configurations.pam_level', 'Configurations.bitrate', 'Configurations.symbolrate', ...
'Configurations.fiber_length', 'Configurations.wavelength', 'Configurations.precomp_amp', ...
'Measurements.power_rop', 'Measurements.power_laser', 'Measurements.power_pd_in'};
end
% Get data table from DB
[dataTable, ~] = db.queryDB(filterParams, selectedFields);
% Extract unique rows for each run_id
uniqueConfigFields = {'run_id', 'pam_level', 'bitrate', 'symbolrate', 'fiber_length', 'wavelength', 'precomp_amp', 'db_mode'};
[~, uniqueIdx] = unique(dataTable.run_id);
configDetails = dataTable(uniqueIdx, uniqueConfigFields);
% Calculate the mean BER for each combination of 'run_id' and 'eq_type'
groupedData = groupsummary(dataTable, {'run_id', 'eq_type'}, {'mean', 'min', @(x) meanExcludingOutliers(x)}, {'ber', 'power_rop', 'power_pd_in'});
% Join groupedData with configDetails on the run_id field
joinedData = join(groupedData, configDetails, 'Keys', 'run_id');
end
% Custom function to plot filtered data
function plotFilteredData(joinedData, wlength)
filterFields = {'eq_type'};
cols = linspecer(8);
lst = ["-", ":", "--"];
% Loop over each field you want to filter by
for f = 1:numel(filterFields)
currentField = filterFields{f};
uniqueValues = unique(joinedData.(currentField));
for i = 1:numel(uniqueValues)
currentValue = uniqueValues(i);
% Filter joinedData for the current value
if isnumeric(currentValue)
filteredData = joinedData(joinedData.(currentField) == currentValue, :);
else
filteredData = joinedData(strcmp(joinedData.(currentField), currentValue), :);
end
% Group and average BERs of several run ids => repeated measurements in lab!
groupVars = {'bitrate'};
groupedDataWithMeans = groupsummary(filteredData, groupVars, {'mean', 'min'}, {'mean_ber', 'min_ber', 'fun1_ber', 'mean_power_rop', 'mean_power_pd_in'});
[~, uniqueIdx] = unique(filteredData.bitrate);
constantFields = filteredData(uniqueIdx, {'bitrate', 'GroupCount', 'pam_level', 'symbolrate', 'fiber_length', 'wavelength', 'precomp_amp', 'db_mode'});
groupedRunIDs = varfun(@(x) {unique(x)}, filteredData, 'GroupingVariables', groupVars, 'InputVariables', 'run_id');
groupedRunIDs.Properties.VariableNames(end) = {'GroupedRunIDs'};
groupedDataWithMeans = join(groupedDataWithMeans, constantFields, 'Keys', 'bitrate');
groupedDataWithMeans = join(groupedDataWithMeans, groupedRunIDs, 'Keys', 'bitrate');
filteredData = groupedDataWithMeans;
% Plotting
a = plot(filteredData.bitrate .* 1e-9, filteredData.mean_fun1_ber, ...
'Color', cols(i, :), 'MarkerSize', 4, 'LineWidth', 1, 'LineStyle', lst(mod(wlength - 1, numel(lst)) + 1), ...
'Marker', 'o', 'MarkerFaceColor', 'auto', 'MarkerEdgeColor', cols(i, :), ...
'DisplayName', [char(currentValue), '; ', num2str(wlength), ' nm']);
a.DataTipTemplate.DataTipRows(1).Label = 'Bitrate';
a.DataTipTemplate.DataTipRows(1).Format = ['%.1f', ' Gbit/s'];
a.DataTipTemplate.DataTipRows(2).Label = 'BER';
a.DataTipTemplate.DataTipRows(2).Format = '%.1e';
a.DataTipTemplate.DataTipRows(3).Label = 'P_{out}';
a.DataTipTemplate.DataTipRows(3).Value = filteredData.mean_mean_power_rop;
a.DataTipTemplate.DataTipRows(3).Format = ['%.2f', ' dBm'];
a.DataTipTemplate.DataTipRows(4).Label = 'Baudr';
a.DataTipTemplate.DataTipRows(4).Value = filteredData.bitrate .* 1e-9;
a.DataTipTemplate.DataTipRows(4).Format = ['%.1f', ' GBd'];
a.DataTipTemplate.DataTipRows(5).Label = 'Run ID';
a.DataTipTemplate.DataTipRows(5).Value = filteredData.GroupedRunIDs;
a.DataTipTemplate.FontSize = 9;
a.DataTipTemplate.FontName = 'arial';
end
end
end
% Custom function to finalize the plot settings
function finalizePlot()
yline(2e-2, 'DisplayName', '20% O-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
xlabel('Bit Rate in GBps');
ylabel('Bit Error Rate (BER)');
xlim([300, 480]);
set(gca, 'yscale', 'log');
set(gca, 'Box', 'on');
grid on;
grid minor;
legend('Interpreter', 'none');
end
% Custom function using rmoutliers to calculate mean after removing outliers
function meanWithoutOutliers = meanExcludingOutliers(x)
[xWithoutOutliers,outlierpos] = rmoutliers(x);
if isempty(xWithoutOutliers)
meanWithoutOutliers = NaN;
else
meanWithoutOutliers = mean(xWithoutOutliers);
end
end

View File

@@ -0,0 +1,170 @@
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
useGui = 0;
pamlvls = [4,6,8];
wlengths = [1302];
figoffset = 0;
figure(30)
tiledlayout(1, 3, 'TileSpacing', 'compact', 'Padding', 'compact');
for p = 1:numel(pamlvls)
nexttile;
for w = 1:numel(wlengths)
sgtitle(['Lambda: ',num2str(wlengths),' nm'])
hold on
pamlvl = pamlvls(p);
wlength = wlengths(w);
db = DBHandler("pathToDB",[basePath,'silas_labor.db']);
if useGui
filterParams = db.promptFilterParameters();
selectedFields = db.promptSelectFields();
else
filterParams = db.tables;
filterParams.Configurations = struct( ...
'bitrate', [], ...
'db_mode', [], ...
'fiber_length', 10, ...
'interference_attenuation', [], ...
'interference_path_length', [], ...
'is_mpi', 0, ...
'pam_level', pamlvl, ...
'precomp_amp', [], ...
'rop_attenuation', 0, ...
'symbolrate', [], ...
'v_awg', [], ...
'v_bias', [], ...
'wavelength', wlength ...
);
selectedFields = {'Runs.run_id','BERs.ber_id','Equalizer.eq_id','Equalizer.eq_type','BERs.ber','BERs.occurrence',...
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp',...
'Measurements.power_rop','Measurements.power_laser','Measurements.power_pd_in'};
end
% Get data table from DB
[dataTable,~] = db.queryDB(filterParams, selectedFields);
% Grouping variables: 'bitrate' and 'eq_type'
groupVars = {'bitrate', 'eq_type'};
% Calculate mean BER for each combination of 'bitrate' and 'eq_type'
groupedData = groupsummary(dataTable, groupVars, {'mean', 'min', @(x) meanExcludingOutliers(x)}, {'ber', 'power_rop','power_pd_in'});
% Collect the run_id values for each group
groupedRunIDs = varfun(@(x) {unique(x)}, dataTable, 'GroupingVariables', groupVars, 'InputVariables', 'run_id');
groupedRunIDs.Properties.VariableNames(end) = {'GroupedRunIDs'};
% Join the grouped data with the grouped run_id list
avgdBerTable = join(groupedData, groupedRunIDs, 'Keys', groupVars);
% Define the fields that you want to use for filtering
filterFields = {'eq_type'};
% Loop over each field you want to filter by
for f = 1:numel(filterFields)
currentField = filterFields{f};
% Determine unique values for the current field
uniqueValues = unique(avgdBerTable.(currentField));
% Loop over each unique value for the current field
for i = 1:numel(uniqueValues)
currentValue = uniqueValues(i);
% Filter joinedData for the current value
if isnumeric(currentValue)
filteredData = avgdBerTable(avgdBerTable.(currentField) == currentValue, :);
else
filteredData = avgdBerTable(strcmp(avgdBerTable.(currentField), currentValue), :);
end
cols = linspecer(8);
lst = ["-",":","--"];
a=plot(filteredData.bitrate.*1e-9,filteredData.min_ber,...
'Color',cols(i,:),'MarkerSize',4,'LineWidth',1,'LineStyle',lst(w),...
'Marker','o','MarkerFaceColor','auto','MarkerEdgeColor',cols(i,:),...
'DisplayName',[char(currentValue),'; ',num2str(wlength),' nm' ]);
a.DataTipTemplate.DataTipRows(1).Label = 'Bitrate';
a.DataTipTemplate.DataTipRows(1).Format = ['%.1f',' Gbit/s'];
a.DataTipTemplate.DataTipRows(2).Label = 'BER';
a.DataTipTemplate.DataTipRows(2).Format ='%.1e';
a.DataTipTemplate.DataTipRows(3).Label = 'P_{out}';
a.DataTipTemplate.DataTipRows(3).Value = filteredData.mean_power_rop;
a.DataTipTemplate.DataTipRows(3).Format = ['%.2f',' dBm'];
a.DataTipTemplate.DataTipRows(4).Label = 'Run ID';
a.DataTipTemplate.DataTipRows(4).Value = filteredData.GroupedRunIDs;
a.DataTipTemplate.DataTipRows(4).Format = ['%d',' '];
a.DataTipTemplate.FontSize = 9;
a.DataTipTemplate.FontName = 'arial';
%
% a=scatter(filteredData.bitrate.*1e-9,filteredData.min_ber,5,'Marker','diamond',...
% 'Color',cols(i,:),'LineWidth',1,...
% 'MarkerFaceColor','auto','MarkerEdgeColor',cols(i,:),...
% 'DisplayName',currentValue);
%
% a.DataTipTemplate.DataTipRows(1).Label = 'Bitrate';
% a.DataTipTemplate.DataTipRows(1).Format = ['%.1f',' Gbit/s'];
%
% a.DataTipTemplate.DataTipRows(2).Label = 'BER';
% a.DataTipTemplate.DataTipRows(2).Format ='%.1e';
%
% a.DataTipTemplate.DataTipRows(3).Label = 'P_{out}';
% a.DataTipTemplate.DataTipRows(3).Value = filteredData.mean_power_rop;
% a.DataTipTemplate.DataTipRows(3).Format = ['%.2f',' dBm'];
%
% a.DataTipTemplate.DataTipRows(4).Label = 'Run ID';
% a.DataTipTemplate.DataTipRows(4).Value = filteredData.GroupedRunIDs;
% a.DataTipTemplate.DataTipRows(4).Format = ['%d',' '];
%
%
% a.DataTipTemplate.FontSize = 9;
% a.DataTipTemplate.FontName = 'arial';
end
end
% Continue with the rest of your plot settings
title(sprintf('%d km | %d nm | PAM %d',unique(filterParams.Configurations.fiber_length),wlength,pamlvl));
yline(2e-2, 'DisplayName', '20% O-FEC', 'LineStyle', '--', 'HandleVisibility', 'off','LineWidth',1);
yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off','LineWidth',1);
xlabel('Bit Rate in Gbps');
ylabel('Bit Error Rate');
xlim([300, 480])
ylim([8e-4,0.5])
set(gca, 'yscale', 'log');
set(gca, 'Box', 'on');
grid on;
grid minor;
end
end
legend('Interpreter', 'none');
set(gcf, 'Units', 'pixels', 'Position', 1.0e+03 * [0.2483 0.7303 1.2093 0.3980]);
% Custom function using rmoutliers to calculate mean after removing outliers
function meanWithoutOutliers = meanExcludingOutliers(x)
% Remove outliers using rmoutliers with default method (based on median)
xWithoutOutliers = rmoutliers(x);
% Calculate the mean of the non-outliers
if isempty(xWithoutOutliers)
% Handle the case where all values are outliers
meanWithoutOutliers = NaN;
else
meanWithoutOutliers = mean(xWithoutOutliers);
end
end

View File

@@ -0,0 +1,192 @@
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
useGui = 0;
pamlvls = [6];
wlengths = [1293,1302,1310];%db.distinctValues.Configurations.wavelength
figoffset = 20;
figure(21)
tiledlayout(1, 3, 'TileSpacing', 'compact', 'Padding', 'compact');
for w = 1:numel(wlengths)
nexttile;
for p = 1:numel(pamlvls)
pamlvl = pamlvls(p);
wlength = wlengths(w);
db = DBHandler("pathToDB",[basePath,'silas_labor.db']);
if useGui
filterParams = db.promptFilterParameters();
selectedFields = db.promptSelectFields();
else
filterParams = db.tables;
filterParams.Configurations = struct( ...
'bitrate', 420e9, ...
'db_mode', [], ...
'fiber_length', [], ...
'interference_attenuation', [], ...
'interference_path_length', [], ...
'is_mpi', 0, ...
'pam_level', pamlvl, ...
'precomp_amp', [], ...
'rop_attenuation', 0, ...
'symbolrate', [], ...
'v_awg', [], ...
'v_bias', [], ...
'wavelength', wlength ...
);
% filterParams.Equalizer.eq_type = equalizer_structure.vnle;
selectedFields = {'Runs.run_id','BERs.ber_id','Equalizer.eq_id','Equalizer.eq_type','BERs.ber','BERs.occurrence',...
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp',...
'Measurements.power_rop','Measurements.power_laser','Measurements.power_pd_in'};
end
sgtitle(['Rate: ',num2str(filterParams.Configurations.bitrate),' Gbit/s'])
% Get data table from DB
[dataTable,~] = db.queryDB(filterParams, selectedFields);
% Extract unique rows from dataTable for each run_id with relevant configuration details
uniqueConfigFields = {'run_id', 'pam_level', 'bitrate','symbolrate', 'fiber_length', 'wavelength', 'precomp_amp', 'db_mode'};
[~, uniqueIdx] = unique(dataTable.run_id); % Get unique run_id indices
configDetails = dataTable(uniqueIdx, uniqueConfigFields); % Extract unique configurations for each run_id
% Calculate the mean BER for each combination of 'run_id' and 'eq_type'
groupedData = groupsummary(dataTable, {'run_id', 'eq_type'}, {'mean','min'}, {'ber', 'power_rop','power_pd_in'});
groupedData = groupsummary(dataTable, {'run_id', 'eq_type'}, {'mean', 'min', @(x) meanExcludingOutliers(x)}, {'ber', 'power_rop','power_pd_in'});
% Join groupedData with configDetails on the run_id field
joinedData = join(groupedData, configDetails, 'Keys', 'run_id');
% Define the fields that you want to use for filtering
filterFields = {'eq_type'};
% Create a cell array to store filtered data tables for each filter field
filteredDataByField = struct();
hold on
% Loop over each field you want to filter by
for f = 1:numel(filterFields)
currentField = filterFields{f};
% Determine unique values for the current field
uniqueValues = unique(joinedData.(currentField));
% Create a struct entry for the current field
filteredDataByField.(currentField) = cell(numel(uniqueValues), 1);
% Loop over each unique value for the current field
for i = 1:numel(uniqueValues)
currentValue = uniqueValues(i);
% Filter joinedData for the current value
if isnumeric(currentValue)
filteredData = joinedData(joinedData.(currentField) == currentValue, :);
else
filteredData = joinedData(strcmp(joinedData.(currentField), currentValue), :);
end
%%% workaround to average the BERs of several runs (ie in 1km case or trials)
%%% Workaround to average the BERs of several runs (e.g., in 1 km case or trials)
% Grouping variable(s)
groupVars = {'fiber_length'};
% Use groupsummary to calculate the mean and min of relevant fields
groupedDataWithMeans = groupsummary(filteredData, groupVars, {'mean', 'min'}, {'mean_ber', 'min_ber', 'fun1_ber', 'mean_power_rop', 'mean_power_pd_in'});
% Extract representative values for constant fields
[~, uniqueIdx] = unique(filteredData.(groupVars{1})); % Get the first occurrence of each bitrate value
constantFields = filteredData(uniqueIdx, {'bitrate', 'GroupCount', 'pam_level', 'symbolrate', 'fiber_length', 'wavelength', 'precomp_amp', 'db_mode'});
% Keep track of which run_id values were grouped
groupedRunIDs = varfun(@(x) {unique(x)}, filteredData, 'GroupingVariables', groupVars, 'InputVariables', 'run_id');
groupedRunIDs.Properties.VariableNames(end) = {'GroupedRunIDs'};
% Join the grouped data with the constant fields
groupedDataWithMeans = join(groupedDataWithMeans, constantFields, 'Keys', groupVars);
% Join the grouped data with the grouped run_id list
groupedDataWithMeans = join(groupedDataWithMeans, groupedRunIDs, 'Keys', groupVars);
% Update filteredData to include the grouped information
filteredData = groupedDataWithMeans;
%%% end of workaround
cols = linspecer(8);
% a=plot(filteredData.bitrate.*1e-9,filteredData.mean_mean_ber,...
% 'Color',cols(i,:),'MarkerSize',4,'LineWidth',1,'LineStyle',':',...
% 'Marker','o','MarkerFaceColor','auto','MarkerEdgeColor',cols(i,:),...
% 'DisplayName',currentValue);
lst = ["-",":","--"];
a=plot(filteredData.(groupVars{1}),filteredData.mean_fun1_ber,...
'Color',cols(i,:),'MarkerSize',4,'LineWidth',1,'LineStyle',lst(1),...
'Marker','o','MarkerFaceColor','auto','MarkerEdgeColor',cols(i,:),...
'DisplayName',[char(currentValue),'; ',num2str(wlength),' nm' ]);
%
% scatter(filteredData.symbolrate.*1e-9,filteredData.min_min_ber,5,'Marker','_',...
% 'Color',cols(i,:),'LineWidth',1,...
% 'MarkerFaceColor',cols(i,:),'MarkerEdgeColor','black',...
% 'DisplayName',currentValue);
a.DataTipTemplate.DataTipRows(1).Label = groupVars{1};
a.DataTipTemplate.DataTipRows(1).Format = ['%.1f',''];
a.DataTipTemplate.DataTipRows(2).Label = 'BER';
a.DataTipTemplate.DataTipRows(2).Format ='%.1e';
a.DataTipTemplate.DataTipRows(3).Label = 'P_{out}';
a.DataTipTemplate.DataTipRows(3).Value = filteredData.mean_mean_power_rop;
a.DataTipTemplate.DataTipRows(3).Format = ['%.2f',' dBm'];
a.DataTipTemplate.DataTipRows(4).Label = 'Baudr';
a.DataTipTemplate.DataTipRows(4).Value = filteredData.bitrate .*1e-9;
a.DataTipTemplate.DataTipRows(4).Format = ['%.1f',' GBd'];
a.DataTipTemplate.DataTipRows(5).Label = 'Run ID';
a.DataTipTemplate.DataTipRows(5).Value = filteredData.GroupedRunIDs;
a.DataTipTemplate.DataTipRows(5).Format = ['%f',' GBd'];
a.DataTipTemplate.FontSize = 9;
a.DataTipTemplate.FontName = 'arial';
end
end
% Continue with the rest of your plot settings
title(sprintf('Lambda: %f',wlength));
yline(2e-2, 'DisplayName', '20% O-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
xlabel(groupVars{1},'Interpreter','none');
ylabel('Bit Error Rate (BER)');
%xlim([300, 480])
ylim([8e-4,0.5])
set(gca, 'yscale', 'log');
set(gca, 'Box', 'on');
grid on;
grid minor;
legend('Interpreter', 'none');
end
end
% Custom function using rmoutliers to calculate mean after removing outliers
function meanWithoutOutliers = meanExcludingOutliers(x)
% Remove outliers using rmoutliers with default method (based on median)
xWithoutOutliers = rmoutliers(x);
% Calculate the mean of the non-outliers
if isempty(xWithoutOutliers)
% Handle the case where all values are outliers
meanWithoutOutliers = NaN;
else
meanWithoutOutliers = mean(xWithoutOutliers);
end
end

View File

@@ -17,18 +17,56 @@ folderNames = folderNames(~ismember(folderNames, {'.', '..'}));
% Combine folder names with paths
fullFolderPaths = flip(fullfile(folderPaths, folderNames));
only_mpi=0;
% process only MPI?
only_mpi=0;
if only_mpi
fullFolderPaths = fullFolderPaths(contains(fullFolderPaths,"mpi"));
end
relativeFolderPaths = strrep(fullFolderPaths, sioe_labor_path, '');
% Shorten folder paths to display only the folder name after the last filesep
displayFolderPaths = cellfun(@(x) x(find(x == filesep, 1, 'last') + 1 : end), fullFolderPaths, 'UniformOutput', false);
% Create checkbox settings for each folder path
numFolders = numel(fullFolderPaths);
checkboxSettings = cell(1, 2 * numFolders);
for i = 1:numFolders
checkboxSettings{2*i-1} = {displayFolderPaths{i}; sprintf('Folder_%d', i)};
checkboxSettings{2*i} = true; % Set false for unchecked by default
end
% Create settings dialog using settingsdlg
[settings, button] = settingsdlg( ...
'Description', 'Select Folders to Process:', ...
'title', 'Folder Selection', ...
checkboxSettings{:});
% Check if the user pressed OK
if strcmp(button, 'OK')
% Get all the field names from settings
allFields = fieldnames(settings);
% Determine which folders were selected
selectedFoldersIdx = cellfun(@(x) settings.(x), allFields);
% Get the list of selected folders
selectedFolders = fullFolderPaths(selectedFoldersIdx==1);
% Display the selected folders
fprintf('Selected Folders to Process:\n');
disp(selectedFolders);
else
fprintf('No folders selected.\n');
end
relativeFolderPaths = strrep(selectedFolders, sioe_labor_path, '');
disp(['Start to process ',num2str(numel(relativeFolderPaths)), ' folder in the directory']);
for f = 1:numel(fullFolderPaths)
folder = fullFolderPaths{f};
for f = 1:numel(selectedFolders)
folder = selectedFolders{n};
relfolder = relativeFolderPaths{f};
@@ -106,18 +144,18 @@ for f = 1:numel(fullFolderPaths)
params_merge = struct;
for c = 1:numel(big_wh_list)
fnames = fieldnames(big_wh_list{c}.parameter);
for f = 1:numel(fnames)
for fn = 1:numel(fnames)
% Initialize field if not already present
if ~isfield(params_merge, fnames{f})
params_merge.(fnames{f}) = [];
if ~isfield(params_merge, fnames{fn})
params_merge.(fnames{fn}) = [];
end
% Merge unique parameter values into params_merge
a = big_wh_list{c}.parameter.(fnames{f}).values;
b = params_merge.(fnames{f});
a = big_wh_list{c}.parameter.(fnames{fn}).values;
b = params_merge.(fnames{fn});
vals_to_add = setdiff(a, b); % New values in a that aren't in b
b = sort([b, vals_to_add]); % Combine and sort values
params_merge.(fnames{f}) = b;
params_merge.(fnames{fn}) = b;
end
end
@@ -157,11 +195,11 @@ for f = 1:numel(fullFolderPaths)
isMPI = isfield(measurementStruct,'i_power');
% Process record if it contains data
% Process record if it contains *any* data
if recordIsFilled
if ~isMPI
% Generate filenames with conditionally formatted parameters
% Format the L parameter value (show decimal only if non-zero)
if configStruct.lambda == floor(configStruct.lambda)
@@ -175,8 +213,13 @@ for f = 1:numel(fullFolderPaths)
configStruct.M, L_str, configStruct.bitrate, configStruct.duobinary, 0);
fbody_tx = strrep(fbody_tx, '.', '_'); % Replace decimal point with underscore
fbody_rx = sprintf('%s_PAM_%d_L_%s_R_%d_DB_%d_ROP_%d', datebody, ...
configStruct.M, L_str, configStruct.bitrate, configStruct.duobinary, configStruct.rop_atten);
if configStruct.rop_atten == round(configStruct.rop_atten)
fbody_rx = sprintf('%s_PAM_%d_L_%s_R_%d_DB_%d_ROP_%d', datebody, ...
configStruct.M, L_str, configStruct.bitrate, configStruct.duobinary, configStruct.rop_atten);
else
fbody_rx = sprintf('%s_PAM_%d_L_%s_R_%d_DB_%d_ROP_%.1f', datebody, ...
configStruct.M, L_str, configStruct.bitrate, configStruct.duobinary, configStruct.rop_atten);
end
fbody_rx = strrep(fbody_rx, '.', '_');
elseif isMPI
@@ -185,8 +228,13 @@ for f = 1:numel(fullFolderPaths)
configStruct.M, configStruct.bitrate, configStruct.duobinary, 0);
fbody_tx = strrep(fbody_tx, '.', '_'); % Replace decimal point with underscore
fbody_rx = sprintf('%s_PAM_%d_R_%d_DB_%d_I_atten_%d', datebody, ...
configStruct.M, configStruct.bitrate, configStruct.duobinary, configStruct.interference_atten);
if configStruct.interference_atten == round(configStruct.interference_atten)
fbody_rx = sprintf('%s_PAM_%d_R_%d_DB_%d_I_atten_%d', datebody, ...
configStruct.M, configStruct.bitrate, configStruct.duobinary, configStruct.interference_atten);
else
fbody_rx = sprintf('%s_PAM_%d_R_%d_DB_%d_I_atten_%.1f', datebody, ...
configStruct.M, configStruct.bitrate, configStruct.duobinary, configStruct.interference_atten);
end
fbody_rx = strrep(fbody_rx, '.', '_'); % Replace decimal point with underscore
end
@@ -223,6 +271,7 @@ for f = 1:numel(fullFolderPaths)
% SYNCHRONIZED RX SIGNAL
fn_rxtsynch = [filesep, fbody_rx, '_rx_signal.mat'];
fp_rxtsynch = fullfile([folder, fn_rxtsynch]);
fn_rxtsynch_rel = [];
if exist(fp_rxtsynch, "file") == 2
fn_rxtsynch_rel = [relfolder, fn_rxtsynch];
@@ -244,13 +293,42 @@ for f = 1:numel(fullFolderPaths)
end
end
end
elseif exist(fp_rxtsynch, "file") == 0
disp(['RX Signal not found at: ', fn_rxtsynch,' generate and save new one using symbols and raw signal']);
Scpe_sig_raw = load(fp_rxraw);
Scpe_sig_raw = Scpe_sig_raw.Scpe_sig_raw;
Symbols = load(fp_symbols);
Symbols = Symbols.Symbols;
%%%%%% Sample to 2x fsym %%%%%%
Scpe_sig_resampled = Scpe_sig_raw.resample("fs_in",Scpe_sig_raw.fs,"fs_out",2*Symbols.fs);
%%%%%% Sync Rx signal with reference (S is a cell array with all occurences) %%%%%%
[Scpe_sig_syncd,S,isFlipped] = Scpe_sig_resampled.tsynch("reference",Symbols,"fs_ref",Symbols.fs);
%%%%% Plot and Save Routines: SAVE RECEIVED SIGNALS %%%%%%%%%%%%%%%%%%%%%%%%%
save(fp_rxtsynch,"S");
if exist(fp_rxtsynch, "file") == 0
warndlg('Something still wromg... No rx file here but we just generated it from raw signal');
end
fn_rxtsynch_rel = [relfolder, fn_rxtsynch];
elseif missing_raw_flag
warning(['RX Signal not found at: ', fn_rxtsynch]);
warndlg('No RAW or RX signal found! This is bad!');
% look at measurementStruct and configStruct
end
else
disp('Record not filled?')
% look at measurementStruct and configStruct
end
% Call the duplicate check function
exists = db.checkIfRunExists('Runs', 'rx_sync_path', fn_rxtsynch_rel);
if ~isempty(fn_rxtsynch_rel)
exists = db.checkIfRunExists('Runs', 'rx_sync_path', fn_rxtsynch_rel);
end
if ~exists
@@ -335,31 +413,32 @@ for f = 1:numel(fullFolderPaths)
% Append the new row to the Measurements table
db.appendToTable('Measurements', newMeas);
% Table 4: Append to Bers
[ber, structure, settings] = getBers(configStruct,measurementStruct);
for t = 1:numel(ber)
if iscell(ber(t))
ber_ = ber(t);
ber_ = ber_{1};
else
ber_ = ber(t);
end
if ber_~=-1
newBer = struct(...
'ber_id', NaN,...
'run_id', run_id,...
'processing_structure', structure(t),...
'processing_settings', settings(t),...
'ber', jsonencode(ber_)...
);
db.appendToTable('BERs', newBer);
end
end
% % Table 4: Append to Bers
% [ber, structure, settings] = getBers(configStruct,measurementStruct);
% for t = 1:numel(ber)
%
% if iscell(ber(t))
% ber_ = ber(t);
% ber_ = ber_{1};
% else
% ber_ = ber(t);
% end
%
% if ber_~=-1
%
% newBer = struct(...
% 'ber_id', NaN,...
% 'run_id', run_id,...
% 'processing_structure', structure(t),...
% 'processing_settings', settings(t),...
% 'ber', jsonencode(ber_)...
% );
%
% db.appendToTable('BERs', newBer);
%
% end
%
% end
end

View File

@@ -0,0 +1,42 @@
% Load the Runs table from the database
db = DBHandler("pathToDB", 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\silas_labor.db');
runsTable = db.queryDB(db.tables, {'Runs.run_id', 'Runs.tx_bits_path', 'Runs.tx_symbols_path', 'Runs.rx_sync_path', 'Runs.rx_raw_path', 'Runs.filename'});
% Initialize an array to store the result of existence check
fileExistenceResults = false(height(runsTable), 4); % 4 columns for the paths: tx_bits, tx_symbols, rx_sync, rx_raw
% Main file path
sioe_labor_path = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor';
% Loop through all rows in the table and check paths
for i = 1:height(runsTable)
fileExistenceResults(i, 1) = exist([sioe_labor_path, runsTable.tx_bits_path{i}], 'file') == 2;
fileExistenceResults(i, 2) = exist([sioe_labor_path, runsTable.tx_symbols_path{i}], 'file') == 2;
fileExistenceResults(i, 3) = exist([sioe_labor_path, runsTable.rx_sync_path{i}], 'file') == 2;
fileExistenceResults(i, 4) = exist([sioe_labor_path, runsTable.rx_raw_path{i}], 'file') == 2;
end
% Identify corrupted run_ids (where any path does not exist)
corruptedRunIds = runsTable.run_id(~all(fileExistenceResults, 2));
% Delete entries in all tables related to corrupted run_ids
for i = 1:numel(corruptedRunIds)
run_id = corruptedRunIds(i);
% Delete from BERs table
db.executeSQL(sprintf('DELETE FROM BERs WHERE run_id = %d;', run_id));
% Delete from Equalizer table (if applicable)
db.executeSQL(sprintf('DELETE FROM Equalizer WHERE eq_id IN (SELECT eq_id FROM BERs WHERE run_id = %d);', run_id));
% Delete from Measurements table
db.executeSQL(sprintf('DELETE FROM Measurements WHERE run_id = %d;', run_id));
% Delete from Configurations table
db.executeSQL(sprintf('DELETE FROM Configurations WHERE run_id = %d;', run_id));
% Delete from Runs table
db.executeSQL(sprintf('DELETE FROM Runs WHERE run_id = %d;', run_id));
end
%
% disp('Entries for corrupted run_ids have been removed from the database.');

View File

@@ -0,0 +1,32 @@
function [berTable, foundBerFlag] = getBerForRunId(db, run_id)
% getBerForRunId Queries the BER data for the specified run_id.
% Inputs:
% db - The database handler object.
% run_id - The run ID for which to get the BER data.
% Outputs:
% berData - A table containing BER results for the given run ID.
% Set up filter parameters to query the BER data for the specific run_id
filterParams = db.tables;
filterParams.Runs.run_id = run_id; % Filter by specific run_id
% Define the fields to be retrieved from the database
selectedFields = {'Runs.run_id', 'BERs.ber_id', 'Equalizer.eq_id', 'Equalizer.eq_type', ...
'BERs.ber', 'BERs.occurrence', 'Configurations.db_mode', ...
'Configurations.pam_level', 'Configurations.bitrate', 'Configurations.symbolrate', ...
'Configurations.fiber_length', 'Configurations.wavelength', ...
'Configurations.precomp_amp', 'Measurements.power_rop', 'Measurements.power_laser', ...
'Measurements.power_pd_in'};
% Query the database for the specified run_id
[berTable, ~] = db.queryDB(filterParams, selectedFields);
if ~isnumeric(berTable.ber)
foundBerFlag = ~isnan(str2num(berTable.ber));
else
foundBerFlag = 1;
end
% Display information about the found BER entries
% fprintf('Found %d BER entries for run_id %d.\n', size(berTable, 1), run_id);
end

View File

@@ -0,0 +1,85 @@
precomp_path = "C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\precomp";
precomp_fn = "lab_high_speed";
precomp_mode = 2; %0=do nothing ; 1= measure; 2=precomp active
db_precode = 1;
db_coding_approach = 1;
fsym = 224e9;
fdac = 256e9;
random_key = 0;
M = 4;
if (db_precode==1)&&(db_coding_approach==0)
if M == 4
pulsef=1;
precomp_amp_max = -50;
elseif M == 6
pulsef=0;
precomp_amp_max = -50;
elseif M == 8
pulsef=0;
precomp_amp_max = -50;
end
elseif (db_precode==1)&&(db_coding_approach==1)
if M == 4
pulsef=1;
precomp_amp_max = -38;
pulsef = 1;
elseif M == 6
pulsef=0;
precomp_amp_max = -38;
pulsef = 1;
elseif M == 8
pulsef=0;
precomp_amp_max = -38;
pulsef = 1;
end
elseif (db_precode==0)&&(db_coding_approach==0)
if M == 4
pulsef=1;
precomp_amp_max = -37;
pulsef = 1;
elseif M == 6
pulsef=0;
precomp_amp_max = -34;
pulsef = 1;
elseif M == 8
pulsef=0;
precomp_amp_max = -34;
pulsef = 0;
end
end
rcalpha = 0.05;
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"rrcalpha",rcalpha);
Pamsource = PAMsource(...
"fsym",fsym,"M",M,"order",19,"useprbs",1,...
"fs_out",fdac,...
"applyclipping",0,"clipfactor",1.2,...
"applypulseform",pulsef,"pulseformer",Pform,...
"randkey",random_key,...
"db_precode",db_precode,"db_encode",db_coding_approach,...
"mrds_code",0,"mrds_blocklength",512);
[Digi_sig,Symbols,Bits] = Pamsource.process();
Digi_sig.spectrum("displayname","TX with precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0);
precomp_est = ChannelFreqResp("Nacq",2048,"Navg",100,"Ncp",63,'f_ref',Digi_sig.fs);
Digi_sig = precomp_est.precomp(Digi_sig,'maxampdb',precomp_amp_max,'loadPath',precomp_path,'fileName',precomp_fn);
Digi_sig = Digi_sig.resample("fs_out",fdac);
Digi_sig= Digi_sig.normalize("mode","rms");
Digi_sig.spectrum("displayname","TX After precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0);

View File

@@ -1,23 +1,25 @@
tic
basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
useGui = 0;
db = DBHandler("pathToDB",[basePath,'silas_labor.db']);
toc
if useGui
filterParams = db.promptFilterParameters();
selectedFields = db.promptSelectFields();
else
filterParams = db.tables;
filterParams.Configurations = struct( ...
'bitrate', [], ...
'db_mode', [], ...
'fiber_length', 10, ...
'bitrate', 300e9, ...
'db_mode', 0, ...
'fiber_length', 1, ...
'interference_attenuation', [], ...
'interference_path_length', [], ...
'is_mpi', 0, ...
'pam_level', [], ...
'pam_level', 4, ...
'precomp_amp', [], ...
'rop_attenuation', 0, ...
'rop_attenuation', [], ...
'symbolrate', [], ...
'v_awg', [], ...
'v_bias', [], ...
@@ -26,15 +28,30 @@ else
% filterParams.Runs.run_id = 3303;
%filterParams.Equalizer.eq_id = equalizer_structure.vnle;
selectedFields = {'Runs.run_id','Runs.tx_bits_path', 'Runs.tx_symbols_path', 'Runs.rx_sync_path','Runs.rx_raw_path',...
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp'};
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp','BERs.ber'};
end
[dataTable,sql_query] = db.queryDB(filterParams, selectedFields);
fprintf('Found %d entries for requested Configuration. IDs are: %s \n',size(dataTable,1),jsonencode(dataTable.run_id));
toc
[dataTable,sql_query] = db.queryDB(filterParams, selectedFields);
[~, uniqueIdx] = unique(dataTable.run_id); % Get unique run_id indices
dataTable = dataTable(uniqueIdx,:); % Extract unique configurations for each run_id
fprintf('Found %d entries for requested Configuration. IDs are: %s \n \n',size(dataTable,1),jsonencode(dataTable.run_id(1:min(size(dataTable,1),100))));
toc
fprintf('Processing: %d%%', 0);
%2) Process Measurement Config
for i = 1:size(dataTable,1)
fprintf('\n%s CURRENT ID: %d == %d KM == %s PAM %d == %d Gbit/s == %d nm %s \n \n', repmat('=', 1, 10), dataTable.run_id(i), dataTable.fiber_length(i) ,db_mode(dataTable.db_mode(i)), dataTable.pam_level(i) ,dataTable.bitrate(i).*1e-9,dataTable.wavelength(i), repmat('=', 1, 10)); % Print a blank line, then a thick line of 80 '=' characters, then another blank line
fprintf('\b\b\b\b%4d', i); % Backspace 3 characters, then overwrite
[~, foundBerFlag] = getBerForRunId(db, dataTable.run_id(i));
if foundBerFlag
continue
end
fprintf('\n%s T: %f CURRENT ID: %d == %d KM == %s PAM %d == %d Gbit/s == %d nm %s \n \n', repmat('=', 1, 10), toc/60, dataTable.run_id(i), dataTable.fiber_length(i) ,db_mode(dataTable.db_mode(i)), dataTable.pam_level(i) ,dataTable.bitrate(i).*1e-9,dataTable.wavelength(i), repmat('=', 1, 10)); % Print a blank line, then a thick line of 80 '=' characters, then another blank line
% FROM NOW ON, ONE Run_id IS CHOSEN AND WILL BE DSP'd
@@ -74,13 +91,13 @@ for i = 1:size(dataTable,1)
%VNLE
eq_vnle(o) = EQ("Ne",vnle_order,"Nb",dfe_order,"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
[eq_sig,eq_noise,ber_vnle(o),totalErrors] = vnle(eq_vnle(o),M,rx_sig,tx_symbols, tx_bits);
%VNLE + PF + MLSE
eq_mlse(o) = EQ("Ne",vnle_order,"Nb",dfe_order,"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
pf_(o) = Postfilter("ncoeff",2);
mlse_(o) = MLSE("DIR",[0,0],"duobinary_output",0,"M",[],"trellis_states",[]);
[eq_sig,eq_noise,ber_mlse(o),totalErrors] = vnle_postfilter_mlse(eq_mlse(o) , pf_(o), mlse_(o),M, rx_sig,tx_symbols, tx_bits);
case db_mode.db_precoded
%EQ targets DB => less precompensation; pre-coded
@@ -141,7 +158,8 @@ for i = 1:size(dataTable,1)
end
end
fprintf('\n%s SIMULATION COMPLETE %s \n \n', repmat('=', 1, 35), repmat('=', 1, 35)); % Print a blank line, then a thick line of 80 '=' characters, then another blank line
fprintf('\n%s SIMULATION COMPLETE AFTER %f MINUTES %s \n \n', repmat('=', 1, 35), toc/60 ,repmat('=', 1, 35)); % Print a blank line, then a thick line of 80 '=' characters, then another blank line