halfway merged and pulled?!

This commit is contained in:
Silas Labor Zizou
2025-12-15 15:41:02 +01:00
parent 7d0a634b87
commit b8cecae895
145 changed files with 19835 additions and 0 deletions

View File

@@ -0,0 +1,60 @@
load("ffe_debug_snapshot.mat");
dc_buffer_len = logspace(0,3,12);
dc_buffer_len = 1024;
mu_dc = logspace(-3,0,24);
parfor d = 1:length(mu_dc)
eq_lin = FFE_DCremoval_adaptive_mu("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
0.0002,"mu_tr",0,"order",25,"sps",2,"decide",0,...
"mu_dc",mu_dc(d),...
"dc_buffer_len",1024, ...
"ffe_buffer_len",1,...
"smoothing_buffer_length",0,...
"smoothing_buffer_update",1,...
"adaptive_mu_mode",0);
%
% eq_lin = FFE("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
% 0.0002,"mu_tr",0,"order",25,"sps",2,"decide",0);
ffe_results = ffe(eq_lin,M,Scpe_sig,Symbols,Tx_bits,...
"precode_mode",duob_mode,...
'showAnalysis',0,...
"postFFE",[],...
"eth_style_symbol_mapping",0);
ffe_results.metrics.print
% % eq_lin = FFE_DFE("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"ffe_mu_dd",1e-4,"dfe_mu_dd",5e-4,"ffe_mu_tr",0,"dfe_mu_tr",0,"ffe_order",21,"dfe_order",2,"sps",2,"decide",0);
%
% eq_lin = FFE("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
% 0.0002,"mu_tr",0,"order",25,"sps",2,"decide",0);
% pf_ = Postfilter("ncoeff",2,"useBurg",1);
% mlse_ = MLSE_viterbi("duobinary_output",0,'M',4,'trellis_states',PAMmapper(4,0).levels);
%
% [ffe_results2, mlse_results] = vnle_postfilter_mlse(eq_lin, pf_, mlse_, M, Scpe_sig, Symbols, Tx_bits, ...
% "precode_mode", duob_mode,...
% 'showAnalysis', 1, ...
% "postFFE", [],...
% "eth_style_symbol_mapping", 0);
ber(d) = ffe_results.metrics.BER;
end
figure(10)
hold on
plot(mu_dc,ber,'LineWidth',1,'DisplayName',sprintf('DC buffer len = 1024'),'Marker','.','MarkerSize',10);
xlabel('BER');
xlabel('MU DC');
title('BER Optimization over dc\_buffer\_len');
yline([4.85e-3,2e-2],'HandleVisibility', 'off','LineWidth',1,'LineStyle','--');
ylim([9e-4, 0.5]);
set(gca, 'YScale', 'log'); % BER is usually plotted log-scale
legend('show', 'Location', 'best');
grid on;

View File

@@ -0,0 +1,118 @@
% === SETTINGS ===
dsp_options.append_to_db = 0;
dsp_options.max_occurences = 15;
dsp_options.database_path = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\';
dsp_options.database_name = 'silas_labor_newdsp_newstructure.db';
dsp_options.storage_path = 'Z:\2024\sioe_labor\';
dsp_options.parameters = struct();
dsp_options.parameters.mu_dc = [0.005];
% === Get Run ID's ===
db = DBHandler("pathToDB", [dsp_options.database_path, dsp_options.database_name], "type", "sqlite");
fp = QueryFilter();
% fp.where('Runs', 'run_id','EQUALS', 5108);
fp.where('Runs', 'is_mpi','EQUALS', 0);
fp.where('Runs', 'fiber_length','EQUALS', 1);
fp.where('Runs', 'wavelength','EQUALS', 1310);
fp.where('Runs', 'db_mode','EQUALS', 1);
fp.where('Runs', 'rop_attenuation','EQUALS', 0);
fp.where('Runs', 'pam_level','EQUALS', 4);
fp.where('Runs', 'bitrate','EQUALS', 360e9);
% fp.where('Runs', 'power_pd_in','GREATER_THAN', 7);
[dataTable,~] = db.queryDB(fp, db.getTableFieldNames('Runs'));
% === Initialize DataStorage ===
wh = DataStorage(dsp_options.parameters);
wh.addStorage("ffe_package");
wh.addStorage("mlse_package");
wh.addStorage("vnle_package");
wh.addStorage("dbtgt_package");
wh.addStorage("dbenc_package");
% === RUN IT ===
% [results,wh] = submitJobs(dataTable.run_id(:), dsp_options, "serial", 'wh', wh, 'waitbar', true);
% wh.getStoValue('ffe_package',0.005);
% wh.getStoValue('mlse_package',0.005);
[dataTable,~] = db.queryDB(fp, [db.getTableFieldNames('Runs');db.getTableFieldNames('Results');db.getTableFieldNames('Equalizer')]);
dataTable = cleanUpTable(dataTable);
% === Look at it ===
y_var = 'BER_precoded';
x_var = 'bitrate';
fixedVars = {'equalizer_structure', x_var};
[dataTableClean, outliersTable] = removeGroupOutliers(dataTable, fixedVars, y_var);
% --- Group and aggregate ---
dataTableGrpd_mean = groupIt(fixedVars, dataTableClean, @mean);
dataTableGrpd_min = groupIt(fixedVars, dataTableClean, @min);
dataTableGrpd_max = groupIt(fixedVars, dataTableClean, @max);
% Choose a color map
cols = linspecer(numel(unique(dataTableGrpd_mean.equalizer_structure)));
figure;
hold on;
% Get unique equalizer structures for grouping
unique_eq = unique(dataTableGrpd_mean.equalizer_structure);
for i = 1:numel(unique_eq)
eq_val = unique_eq(i);
% Filter grouped data for this equalizer structure
filt = dataTableGrpd_mean.equalizer_structure == eq_val;
x = dataTableGrpd_mean.(x_var)(filt);
y_mean = dataTableGrpd_mean.(y_var)(filt);
y_min = dataTableGrpd_min.(y_var)(filt);
y_max = dataTableGrpd_max.(y_var)(filt);
% Bounds for boundedline (distance from mean)
y_lower = y_mean - y_min;
y_upper = y_max - y_mean;
y_bounds = [y_lower, y_upper];
% --- Bounded line (mean ± min/max) ---
if exist('boundedline', 'file')
[hl, hp] = boundedline(x, y_mean, y_bounds, ...
'alpha', 'transparency', 0.1, ...
'cmap', cols(i,:), ...
'nan', 'fill', ...
'orientation', 'vert');
set(hl, 'LineWidth', 1.2, 'DisplayName', sprintf('Eq %s', eq_val));
set(hp, 'HandleVisibility', 'off');
else
% If boundedline is not available, use errorbar
errorbar(x, y_mean, y_lower, y_upper, ...
'o-', 'Color', cols(i,:), 'LineWidth', 1.2, ...
'DisplayName', sprintf('Eq %d', eq_val),'HandleVisibility', 'off');
end
% --- Normal line (mean only) ---
plot(x, y_mean, '-', 'Color', cols(i,:), 'LineWidth', 1.5, ...
'DisplayName', sprintf('Mean Eq %s', eq_val),'HandleVisibility', 'off');
% --- Scatter plot for individual points (from original data) ---
% Filter original data for this group
orig_filt = dataTableClean.equalizer_structure == eq_val;
x_scatter = dataTableClean.(x_var)(orig_filt);
y_scatter = dataTableClean.(y_var)(orig_filt);
scatter(x_scatter, y_scatter, 10,cols(i,:), 'filled', ...
'MarkerFaceAlpha', 0.5, 'DisplayName', sprintf('Scatter Eq %s', eq_val),'HandleVisibility', 'off');
end
yline([2.2e-4,4.85e-3,2e-2],'HandleVisibility', 'off','LineWidth',1,'LineStyle','--');
set(gca, 'YScale', 'log'); % BER is usually plotted log-scale
xlabel(x_var, 'Interpreter', 'none');
ylabel(y_var, 'Interpreter', 'none');
legend('show', 'Location', 'best');
grid on;
title(sprintf('%s vs. %s', y_var, x_var), 'Interpreter', 'none');
hold off;

View File

@@ -0,0 +1,63 @@
savePath = 'Z:\2025\ECOC Silas\ecoc_2025\';
databasePath = 'C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
database_name = 'ecoc2025_loops.db';
db = DBHandler("type","mysql");
% db = DBHandler("pathToDB", [databasePath, database_name],"type","sqlite");
filterParams = db.tables;
% filterParams.Configurations = struct('run_id', run_id);
filterParams.Configurations = struct( ...
'symbolrate', 112e9, ... %[224,336,360,390,420,448]
'fiber_length', 0, ...
'db_mode', '"no_db"', ...
'interference_attenuation', [], ...
'interference_path_length', 0, ...
'is_mpi', 1, ...
'pam_level', 4, ...
'wavelength', 1310, ...
'precomp_amp', [], ...
'signal_attenuation', [], ...
'v_awg', [], ...
'v_bias', 2.65 ...
);
selectedFields = {'Runs.run_id','Runs.loop_id','Runs.tx_bits_path','Runs.tx_signal_path','Runs.tx_symbols_path','Runs.rx_sync_path','Runs.rx_raw_path',...
'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp','Measurements.power_rop','Configurations.v_bias',...
'Configurations.interference_attenuation', 'Configurations.interference_path_length'};
[dataTable,sql_query] = db.queryDB(filterParams, selectedFields);
dataTable(dataTable.loop_id~=217,:) = [];
num_occ = 10;
run_par = true;
run_id = dataTable.run_id;
params.dc_buffer_len = 224;
params.ffe_buffer_len = 1;
params.smoothing_buffer_length = 0;
params.smoothing_buffer_update = 0;
params.mu_dc = 0.005;
futures_list = parallel.FevalFuture.empty();
for id = 1:length(dataTable.run_id)
run_id = dataTable.run_id(id);
[out, futures_list(id)] = submit_dsp(run_id, databasePath, database_name, savePath,"parallel",run_par,'max_occurences',num_occ,'paramstruct',params);
end
% Extract all ber_mlse values from the vnle_pf_package using cellfun
ber_mlse = cellfun(@(pkg) pkg.ber_mlse, future.OutputArguments{1,1}.vnle_pf_package);
ber_vnle = cellfun(@(pkg) pkg.ber_vnle, future.OutputArguments{1,1}.vnle_pf_package);
figure(101)
hold on;
scatter(1:num_occ,ber_mlse,15,'Marker','*');
scatter(1:num_occ,ber_vnle,15,'Marker','*');
legend('Interpreter', 'latex');
xlabel('Occurences');
ylabel('BER');
grid on;
beautifyBERplot;

View File

@@ -0,0 +1,58 @@
Scpe_sig = load("imdd_simulation\projects\ECOC_2025\dsp_test\pam4_scopesignal.mat");Scpe_sig = Scpe_sig.Scpe_sig;
Tx_bits = load("imdd_simulation\projects\ECOC_2025\dsp_test\pam4_bits.mat");Tx_bits = Tx_bits.Tx_bits;
Symbols = load("imdd_simulation\projects\ECOC_2025\dsp_test\pam4_symbols.mat");Symbols = Symbols.Symbols;
eq_ = FFE_DCremoval("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",1e-5,"mu_tr",0,"order",50,"sps",2,"decide",0,"mu_dc",0.005,"dc_buffer_len",1);
% savePath = 'Z:\2025\ECOC Silas\ecoc_2025\';
% databasePath = 'C:\Users\Silas\Documents\MATLAB\imdd_simulation\projects\ECOC_2025\';
% database_name = 'ecoc2025_loops.db';
% db = DBHandler("type","mysql");
params = (logspace(-6,-2,20));
params = floor((logspace(2,3,20)));
params = 224;
for i = 1:length(params)
eq_ = FFE_DCremoval_adaptive_mu("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
0.0002,"mu_tr",0,"order",25,"sps",2,"decide",0,...
"mu_dc",0.005,"dc_buffer_len",1, ...
"ffe_buffer_len",1,...
"smoothing_buffer_length",0,...
"smoothing_buffer_update",1);
result = ffe(eq_,4,Scpe_sig,Symbols,Tx_bits,"precode_mode",db_mode.no_db,'showAnalysis',1,"postFFE",[],"eth_style_symbol_mapping",0);
ber_ffe(i) = result.metrics;
fprintf(" FFE Results: %.2e\n", ber_ffe(i));
% db.addProcessingResult(run_id, result.resultsVNLE, result.equalizerConfigVNLE);
% eq_ = FFE_adaptive_decision("epochs_tr",5,"epochs_dd",3,"len_tr",4096*2,"mu_dd",...
% 0.0003,"mu_tr",0,"order",50,"sps",2,"decide",1,"buffer_length",params(i));
%
% result = vnle(eq_,4,Scpe_sig,Symbols,Tx_bits,"precode_mode",db_mode.no_db,'showAnalysis',1,"postFFE",[],"eth_style_symbol_mapping",0);
% ber_dc(i) = result.ber_vnle;
%
% fprintf(" FFE+dc tr. Results: %.2e\n", ber_dc(i));
end
figure(103435)
hold on;
% scatter(params,ber_dc,15,'Marker','o','LineWidth',1,'DisplayName','DC tracking');
% [a,b]=min(ber_dc);
% scatter(params(b),a,45,'Marker','x','MarkerEdgeColor','r','LineWidth',1);
scatter(params,ber_ffe,15,'Marker','square','LineWidth',1);
[a,b]=min(ber_ffe);
scatter(params(b),a,45,'Marker','x','MarkerEdgeColor','r','LineWidth',1,'DisplayName','FFE');
legend('Interpreter', 'latex');
xlabel('Occurences');
ylabel('BER');
grid on;
beautifyBERplot;
ylim([1e-4,0.1 ])

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,163 @@
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "Configurations" (
"configuration_id" INTEGER,
"run_id" INTEGER,
"unique_elab_id" TEXT,
"bitrate" REAL,
"symbolrate" REAL,
"pam_level" INTEGER,
"db_mode" TEXT,
"pulsef_alpha" INTEGER,
"v_bias" REAL,
"v_awg" REAL,
"precomp_amp" REAL,
"rop_attenuation" REAL,
"wavelength" REAL,
"laser_power" REAL,
"fiber_length" REAL,
"pd_in_desired" REAL,
"is_mpi" BIT,
"signal_attenuation" REAL,
"interference_path_length" REAL,
"interference_attenuation" REAL,
"pam_source" TEXT,
PRIMARY KEY("configuration_id" AUTOINCREMENT),
FOREIGN KEY("run_id") REFERENCES "Runs"("run_id")
);
CREATE TABLE IF NOT EXISTS "EqualizerParameters" (
"eq_id" INTEGER,
"equalizer_structure" REAL,
"M" INTEGER,
"target_constellation" TEXT,
"db_target" INTEGER,
"diff_precode" INTEGER,
"postFFE" INTEGER,
"NpostFFE" INTEGER,
"Ne1" INTEGER,
"Ne2" INTEGER,
"Ne3" INTEGER,
"Nb1" INTEGER,
"Nb2" INTEGER,
"Nb3" INTEGER,
"K" INTEGER,
"DCmu" REAL,
"ideal_dfe" INTEGER,
"training_length" INTEGER,
"training_loops" INTEGER,
"TRmu1" REAL,
"TRmu2" REAL,
"TRmu3" REAL,
"TRmuDFE" REAL,
"dd_loops" INTEGER,
"DDmu1" REAL,
"DDmu2" REAL,
"DDmu3" REAL,
"DDmuDFE" REAL,
"MLSE_mode" TEXT,
"MLSE_trellis_states" TEXT,
"comment" TEXT,
"config_hash" TEXT,
UNIQUE("config_hash"),
PRIMARY KEY("eq_id" AUTOINCREMENT)
);
CREATE TABLE IF NOT EXISTS "Measurements" (
"measurement_id" INTEGER,
"run_id" INTEGER,
"power_laser" REAL,
"power_rop" REAL,
"power_pd_in" REAL,
"power_mpi_interference" REAL,
"power_mpi_signal" REAL,
"voa_class" TEXT,
"pdfa_class" TEXT,
"laser_class" TEXT,
PRIMARY KEY("measurement_id" AUTOINCREMENT),
FOREIGN KEY("run_id") REFERENCES "Runs"("run_id")
);
CREATE TABLE IF NOT EXISTS "Results" (
"result_id" INTEGER,
"run_id" INTEGER,
"eqParam_id" INTEGER,
"date_of_processing" DATETIME DEFAULT (datetime('now', 'localtime')),
"numBits" INTEGER,
"numBitErr" INTEGER,
"BER" REAL,
"numBitErr_precoded" REAL,
"BER_precoded" REAL,
"SNR" REAL,
"SNR_level" TEXT,
"GMI" REAL,
"AIR" REAL,
"EVM" REAL,
"EVM_level" TEXT,
"Alpha" REAL,
"result_hash" TEXT UNIQUE,
"MLSE_dir" INTEGER,
PRIMARY KEY("result_id" AUTOINCREMENT),
FOREIGN KEY("eqParam_id") REFERENCES "EqualizerParameters"("eq_id"),
FOREIGN KEY("run_id") REFERENCES "Runs"("run_id")
);
CREATE TABLE IF NOT EXISTS "Runs" (
"run_id" INTEGER,
"date_of_run" DATETIME DEFAULT (datetime('now', 'localtime')),
"tx_bits_path" TEXT,
"tx_symbols_path" TEXT,
"rx_sync_path" TEXT,
"rx_raw_path" TEXT,
"filename" TEXT,
"tx_signal_path" TEXT,
PRIMARY KEY("run_id" AUTOINCREMENT)
);
CREATE VIEW "View_ResultOverview" AS
SELECT
-- Run info
Runs.run_id,
Runs.date_of_run,
Results.BER,
Results.SNR,
Results.GMI,
Results.AIR,
Results.EVM,
Results.Alpha,
-- Configurations
Configurations.symbolrate,
Configurations.pam_level,
Configurations.db_mode,
Configurations.pulsef_alpha,
Configurations.v_bias,
Configurations.v_awg,
Configurations.precomp_amp,
Configurations.is_mpi,
Configurations.signal_attenuation,
Configurations.interference_path_length,
Configurations.interference_attenuation,
-- Measurement data
Measurements.power_laser,
Measurements.power_rop,
Measurements.power_pd_in,
Measurements.power_mpi_interference,
Measurements.power_mpi_signal,
-- Equalizer parameters
EqualizerParameters.equalizer_structure,
EqualizerParameters.db_target,
EqualizerParameters.diff_precode
FROM Results
-- Join related tables
LEFT JOIN Runs ON Results.run_id = Runs.run_id
LEFT JOIN Configurations ON Configurations.run_id = Runs.run_id
LEFT JOIN Measurements ON Measurements.run_id = Runs.run_id
LEFT JOIN EqualizerParameters ON Results.eqParam_id = EqualizerParameters.eq_id;
CREATE INDEX IF NOT EXISTS "idx_run_id_on_Configurations" ON "Configurations" (
"run_id"
);
CREATE INDEX IF NOT EXISTS "idx_run_id_on_Measurements" ON "Measurements" (
"run_id"
);
COMMIT;

View File

@@ -0,0 +1,85 @@
% This script is used to evaluate Fig. 1b) in the paper "Adaptive Removal of Multipath Interference in Short Reach 112 GBd PAM-4 IM/DD Systems"
%% Parameters
df = 1e6; % Laser linewidth [Hz]
SIR_dB = 20; % Interference attenuation [dB]
alpha = 10^(-SIR_dB/20); % Interference attenuation [linear]
n_fiber = 1.467; % Refractive index
c = physconst('lightspeed'); % [m/s]
L = linspace(0,250,50); % Interference delay [m]
tau = n_fiber./c.*L; % Interference time (= tau) [s]
tau_c = 1/(pi*df); % laser coherence time [s]
L_c = (c/n_fiber)*tau_c; % laser coherence length [m]
var_sat = 2*alpha^2; % Analytical saturation of variance
%% MonteCarlo Simulation
fs = 100e9; % sampling rate [Hz]
Tsim = 50e-6; % sim duration [s]
N = round(Tsim*fs); % number of samples for each realization
max_delay_samples = round(max(tau)*fs); % largest delay that is evaluated (based on max. Interference delay)
phase_noise_std = sqrt(2*pi*df/fs); % standard dev. phase noise
num_realizations = 50; % number of parallel runs
monte_carlo_variance = zeros(num_realizations, length(L));
parfor r = 1:num_realizations
% generate a realization of phase noise random walk
dphi = phase_noise_std * randn(1, N + max_delay_samples); % matlab randn process has std = 1
phi = cumsum(dphi);
phi_direct = phi(max_delay_samples+1 : max_delay_samples+N);
var_k = zeros(1, length(L));
for t = 1:length(tau)
nd = round( tau(t)*fs ); % delay in samples for current interference time
phi_delayed = phi(max_delay_samples+1-nd : max_delay_samples+N-nd); %cut out interfering signal part (was earlier)
E = exp(1j*phi_direct) + alpha*exp(1j*phi_delayed); % E-fields combined
I = abs(E).^2; % photo current as magnitude square of E-field
var_k(t) = var(I);
end
monte_carlo_variance(r, :) = var_k;
end
avg_of_mc_variances = mean(monte_carlo_variance, 1);
std_of_mc_variances = std(monte_carlo_variance, 0, 1);
%% Analytic variance
L_ = linspace(0,250,500); % Interference delay [m]
tau_ = n_fiber./c.*L_;
analytic_variance = 2*alpha^2 * (1 - exp(-2*pi*df.*tau_)).^2;
%% Plot
cols = [0.3467 0.5360 0.6907
0.9153 0.2816 0.2878
0.4416 0.7490 0.4322];
coherence_length_multiples = 0.5:0.5:ceil(L(end)/L_c);
figure();
hold on;
plot(L, avg_of_mc_variances, 'LineWidth',2, 'DisplayName','Simulation','Color',cols(1,:),'LineStyle','-');
errorbar(L, avg_of_mc_variances,std_of_mc_variances, 'LineWidth',0.7,'LineStyle','none', 'DisplayName','Simulation','Color',cols(1,:),'HandleVisibility','off');
plot(L_, analytic_variance, 'LineWidth',2, 'DisplayName','Analytic','Color',cols(2,:),'LineStyle','-');
xticks(coherence_length_multiples.*L_c);
xticklabels(round(coherence_length_multiples.*L_c,1));
norm_to_coherence_len = 1;
if norm_to_coherence_len
xticklabels(coherence_length_multiples);
xlabel('$n \cdot L_c$', 'FontSize',12);
else
xlabel('Interference Delay [m]', 'FontSize',12);
end
xline(L_c.*coherence_length_multiples, 'LineWidth',1.5, 'DisplayName','Coh. Length','HandleVisibility','off','Color',[0.7,0.7,0.7],'LineStyle','-');
xlim([0,L(end)]);
yline(var_sat, '-.k','LineWidth',1.5, 'DisplayName','Saturation: 2$\alpha ^2$');
grid on;
ylabel('Intensity Variance', 'FontSize',12);
title(sprintf('MPI Variance; %d MHz; SIR: %d dB',df.*1e-6,SIR_dB), 'FontSize',14);
legend('Location','southeast');

View File

@@ -0,0 +1,32 @@
%% Parameters
df = linspace(1,50e6,10000); % Laser FWHM linewidth [Hz]
n_fiber = 1.467; % Fiber group index
c = 3e8; % Speed of light [m/s]
% Compute coherence length (1/e of mean-fringe decay)
tau_c = 1./(pi*df);
L_c = (c.* tau_c/n_fiber) ; % Coherence length [m]
%% Plot
figure('Color','w');
loglog(df/1e6, L_c, 'LineWidth',2,'LineStyle','-'); % linewidth in MHz
% xticks([0.1, 1, 10, 50]);
% yticks([1, 10, 100, 1000]);
% yticklabels({'1','10','100','1000'})
grid on; box on;
xlabel('Laser linewidth [MHz]','FontSize',12,'Interpreter','latex');
ylabel('Coherence length [m]','FontSize',12,'Interpreter','latex');
title('Coherence Length vs. Laser Linewidth','FontSize',14,'Interpreter','latex');
%% Annotate some key points
% hold on;
% freqs = [150e3, 1e6, 10e6, 50e6]; % [Hz]
% for f = freqs
% x = f/1e6;
% y = (c/n_fiber) * (1/(pi*f));
% scatter(x,y,'Marker','x','LineWidth',1,'MarkerEdgeColor','black');
%
% text(x*1.1,y, sprintf('%.2f MHz', f/1e6), ...
% 'FontSize',10,'HorizontalAlignment','left');
%
% end