Theory stuff from sials work pc; minor stuff here and there
This commit is contained in:
@@ -78,7 +78,7 @@ for i = 1:length(fsym)
|
||||
|
||||
%%%%% Pulseforming %%%%%%
|
||||
rrca=0.3;
|
||||
X = Pulseformer("fsym",fsym(i),"fdac",256e9,"pulse","rrc","pulselength",16,"rrcalpha",rrca).process(digimod_out);
|
||||
X = Pulseformer("fsym",fsym(i),"fdac",256e9,"pulse","rc","pulselength",16,"alpha",rrca).process(digimod_out);
|
||||
|
||||
% % %%%%% Clip to PAM range %%%%%%
|
||||
min_ = min(digimod_out.signal).*1.3;
|
||||
@@ -89,7 +89,7 @@ for i = 1:length(fsym)
|
||||
|
||||
X2 = M8199A("kover",kover).process(X);
|
||||
|
||||
X = Pulseformer("fsym",fsym(i),"fdac",92e9,"pulse","rrc","pulselength",16,"rrcalpha",rrca).process(digimod_out);
|
||||
X = Pulseformer("fsym",fsym(i),"fdac",92e9,"pulse","rc","pulselength",16,"alpha",rrca).process(digimod_out);
|
||||
|
||||
% % %%%%% Clip to PAM range %%%%%%
|
||||
min_ = min(digimod_out.signal).*1.3;
|
||||
@@ -117,7 +117,7 @@ for i = 1:length(fsym)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
%%
|
||||
cols = linspecer(3);
|
||||
|
||||
figure(6)
|
||||
@@ -130,7 +130,7 @@ xlabel("Baudrate in GBaud");
|
||||
ylabel("Vpp in V")
|
||||
legend
|
||||
ylim([0.3 1.4])
|
||||
thickenfigure;
|
||||
|
||||
|
||||
figure(7)
|
||||
hold on
|
||||
@@ -142,7 +142,7 @@ xlabel("Baudrate in GBaud");
|
||||
ylabel("Output Power in dBm")
|
||||
legend
|
||||
ylim([-12 4])
|
||||
thickenfigure;
|
||||
|
||||
|
||||
figure(8)
|
||||
hold on
|
||||
@@ -154,7 +154,7 @@ xlabel("Baudrate in GBaud");
|
||||
ylabel("PAPR linear")
|
||||
legend
|
||||
ylim([3 10])
|
||||
thickenfigure;
|
||||
|
||||
|
||||
|
||||
figure(9)
|
||||
@@ -167,7 +167,7 @@ xlabel("Baudrate in GBaud");
|
||||
ylabel("Vpp in V")
|
||||
legend
|
||||
ylim([0.3 1.4])
|
||||
thickenfigure;
|
||||
|
||||
|
||||
figure(10)
|
||||
hold on
|
||||
@@ -179,7 +179,7 @@ xlabel("Baudrate in GBaud");
|
||||
ylabel("Output Power in dBm")
|
||||
legend
|
||||
ylim([-12 4])
|
||||
thickenfigure;
|
||||
|
||||
|
||||
figure(11)
|
||||
hold on
|
||||
@@ -191,6 +191,6 @@ xlabel("Baudrate in GBaud");
|
||||
ylabel("PAPR linear")
|
||||
legend
|
||||
ylim([3 10])
|
||||
thickenfigure;
|
||||
|
||||
|
||||
autoArrangeFigures
|
||||
|
||||
@@ -2,7 +2,7 @@ dsp_options.storage_path = 'Z:\2024\sioe_labor\';
|
||||
dsp_options.max_occurences = 1;
|
||||
database = DBHandler("dataBase", 'labor_highspeed', "type", 'mysql' );
|
||||
|
||||
rates = [300e9];
|
||||
rates = [420e9];
|
||||
cols = cbrewer2('BuPu',25);
|
||||
cols = [cols(end-10:2:end,:)];
|
||||
cols = cbrewer2('Set1',6);
|
||||
@@ -10,7 +10,7 @@ cols = cbrewer2('Set1',6);
|
||||
fignum = 200;
|
||||
fig=figure(fignum);clf;
|
||||
|
||||
for dbmode = 0:1%length(rates)
|
||||
for dbmode = 1%length(rates)
|
||||
|
||||
|
||||
if 0
|
||||
@@ -59,8 +59,8 @@ for dbmode = 0:1%length(rates)
|
||||
M = 4;
|
||||
fp.where('Runs', 'pam_level','EQUALS', M);
|
||||
fp.where('Runs', 'bitrate','EQUALS', rates);%360,390
|
||||
fp.where('Runs', 'fiber_length','EQUALS', 10);
|
||||
fp.where('Runs', 'wavelength','EQUALS', 1322.7); %1327.4
|
||||
fp.where('Runs', 'fiber_length','EQUALS', 2);
|
||||
fp.where('Runs', 'wavelength','EQUALS', 1310); %1327.4
|
||||
fp.where('Runs', 'db_mode','EQUALS', dbmode);
|
||||
fp.where('Runs', 'rop_attenuation','EQUAL', 0);
|
||||
|
||||
@@ -85,7 +85,7 @@ for dbmode = 0:1%length(rates)
|
||||
|
||||
%%% 4) Plot RX Signal
|
||||
Scpe_sig.spectrum("fignum",fignum+dbmode,"normalizeTo0dB",1,"displayname",'Rx','addDCoffset',1,'color',[0,0,0],'normalizeToNyquist',0,'linestyle',':');
|
||||
Scpe_sig.eye(fsym,M,"fignum",47,"displayname",' Eye of AVG Signal');
|
||||
Scpe_sig.eye(fsym,M,"fignum",47,"displayname",' Eye of AVG Signal');
|
||||
% xline(Symbols.fs/2.*1e-9,'Color',cols(r,:),'HandleVisibility','off');
|
||||
|
||||
average_signals = 1;
|
||||
@@ -98,7 +98,10 @@ Scpe_sig.eye(fsym,M,"fignum",47,"displayname",' Eye of AVG Signal');
|
||||
scope_mean = scope_mean ./ n;
|
||||
Scpe_sig_avg.signal = scope_mean;
|
||||
|
||||
Scpe_sig_avg.spectrum("displayname","Scope PSD","fignum",20,"normalizeTo0dB",1);
|
||||
figure(20);hold on
|
||||
Symbols.spectrum("fignum",20,"normalizeTo0dB",1,"displayname",'Full Response','addDCoffset',0,'color',clr.Set1.red,'normalizeToNyquist',0,'linestyle','--');
|
||||
DB_Symbols.spectrum("fignum",20,"normalizeTo0dB",1,"displayname",'DB-Response','addDCoffset',0,'color',clr.Set1.blue,'normalizeToNyquist',0,'linestyle','--');
|
||||
Scpe_sig_avg.spectrum("displayname","Scope PSD","fignum",20,"normalizeTo0dB",1,"addDCoffset",5);
|
||||
Scpe_sig_avg.plot("displayname","Scope raw signal","fignum",27,"clear",1);
|
||||
Scpe_sig_avg.eye(fsym,M,"fignum",48,"displayname",' Eye of AVG Signal');
|
||||
end
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
%% Main Script: Compare Bibliographies
|
||||
% This script loads two .bbl files, parses them into tables, and compares
|
||||
% them to find missing citations and duplicates.
|
||||
|
||||
clc; clear; close all;
|
||||
|
||||
% --- STEP 0: Create Dummy Files for Demonstration ---
|
||||
% (You can remove this step if you have actual files on disk)
|
||||
|
||||
file1 = 'C:\Users\Silas\Documents\latex\JLT_400G_submission\Advanced_DSP_for_400G_IMDD.bbl'; % The file based on your input
|
||||
file2 = 'C:\Users\Silas\Documents\latex\JLT_400G_submission\Advanced_DSP_for_400G_IMDD_v1.bbl'; % A modified version to show differences
|
||||
|
||||
% --- STEP 1: Load and Parse Files ---
|
||||
fprintf('Loading files...\n');
|
||||
try
|
||||
tab1 = parse_bbl_file(file1);
|
||||
tab2 = parse_bbl_file(file2);
|
||||
catch ME
|
||||
error('Error loading files: %s', ME.message);
|
||||
end
|
||||
|
||||
fprintf('File 1 (%s): %d citations found.\n', file1, height(tab1));
|
||||
fprintf('File 2 (%s): %d citations found.\n', file2, height(tab2));
|
||||
disp('------------------------------------------------------------');
|
||||
|
||||
% --- STEP 2: Check for Duplicates within files ---
|
||||
check_duplicates(tab1, file1);
|
||||
check_duplicates(tab2, file2);
|
||||
disp('------------------------------------------------------------');
|
||||
|
||||
% --- STEP 3: Compare Files (Set Differences) ---
|
||||
% Find keys in A that are NOT in B
|
||||
[~, idx1] = setdiff(tab1.Key, tab2.Key);
|
||||
missing_in_B = tab1(idx1, :);
|
||||
|
||||
% Find keys in B that are NOT in A
|
||||
[~, idx2] = setdiff(tab2.Key, tab1.Key);
|
||||
missing_in_A = tab2(idx2, :);
|
||||
|
||||
% --- STEP 4: Display Comparison Results ---
|
||||
|
||||
if isempty(missing_in_B)
|
||||
fprintf('All citations from %s are present in %s.\n', file1, file2);
|
||||
else
|
||||
fprintf('Citations in %s but MISSING in %s (%d):\n', file1, file2, height(missing_in_B));
|
||||
disp(missing_in_B.Key);
|
||||
end
|
||||
fprintf('\n');
|
||||
|
||||
if isempty(missing_in_A)
|
||||
fprintf('All citations from %s are present in %s.\n', file2, file1);
|
||||
else
|
||||
fprintf('Citations in %s but MISSING in %s (%d):\n', file2, file1, height(missing_in_A));
|
||||
disp(missing_in_A.Key);
|
||||
end
|
||||
|
||||
%% ---------------------------------------------------------
|
||||
% HELPER FUNCTIONS
|
||||
% ---------------------------------------------------------
|
||||
|
||||
function check_duplicates(T, filename)
|
||||
% Checks if the 'Key' column has non-unique entries
|
||||
[uKeys, ~, idx] = unique(T.Key);
|
||||
counts = accumarray(idx, 1);
|
||||
|
||||
dup_indices = find(counts > 1);
|
||||
|
||||
if isempty(dup_indices)
|
||||
fprintf('No duplicates found in %s.\n', filename);
|
||||
else
|
||||
fprintf('** WARNING: Duplicates found in %s! **\n', filename);
|
||||
for i = 1:length(dup_indices)
|
||||
key_idx = dup_indices(i);
|
||||
fprintf(' Key "%s" appears %d times.\n', uKeys{key_idx}, counts(key_idx));
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function bibTable = parse_bbl_file(filename)
|
||||
% PARSE_BBL_FILE Loads a .bbl file and extracts citations using Regex.
|
||||
%
|
||||
% bibTable = PARSE_BBL_FILE(filename) returns a table with columns:
|
||||
% - Key: The citation key (e.g., 'dambrosiaAug2025Progress')
|
||||
% - RawContent: The full text of the citation entry
|
||||
% - Line: Approximate line number where it starts
|
||||
|
||||
% 1. Read the file content
|
||||
if ~isfile(filename)
|
||||
error('File "%s" not found.', filename);
|
||||
end
|
||||
str = fileread(filename);
|
||||
|
||||
% 2. Define Regex Structure
|
||||
% Explanation:
|
||||
% \\bibitem\{ -> Match literal "\bibitem{"
|
||||
% (?<Key>[^}]+) -> Capture Group 'Key': match anything except '}'
|
||||
% \} -> Match literal "}"
|
||||
% \s* -> Match optional whitespace
|
||||
% (?<Content>.*?) -> Capture Group 'Content': match any character lazily...
|
||||
% (?=(\\bibitem|\\end\{thebibliography\})) -> ...until looking ahead sees "\bibitem" or end of env.
|
||||
|
||||
% Note: 'dotexceptnewline' is usually default, but we need dot to match newlines
|
||||
% for multi-line citations. We handle this using the '(?s)' flag or explicit loop.
|
||||
% Here we use standard pattern matching.
|
||||
|
||||
pattern = '\\bibitem\{(?<Key>[^}]+)\}\s*(?<Content>.*?)(?=(\\bibitem|\\end\{thebibliography\}))';
|
||||
|
||||
% 3. Execute Regex
|
||||
% 'warnings' turned off for empty matches if file is malformed
|
||||
[matches] = regexp(str, pattern, 'names');
|
||||
|
||||
% 4. Convert to Table
|
||||
if isempty(matches)
|
||||
warning('No citations found in %s using standard regex.', filename);
|
||||
bibTable = table({}, {}, 'VariableNames', {'Key', 'RawContent'});
|
||||
return;
|
||||
end
|
||||
|
||||
% Clean up content (remove leading/trailing spaces/newlines)
|
||||
keys = {matches.Key}';
|
||||
content = {matches.Content}';
|
||||
content = strtrim(content);
|
||||
|
||||
bibTable = table(keys, content, 'VariableNames', {'Key', 'RawContent'});
|
||||
|
||||
end
|
||||
@@ -1,14 +1,14 @@
|
||||
% minimal example IM/DD
|
||||
|
||||
M = 4;
|
||||
fsym = 180e9;
|
||||
fsym = 112e9;
|
||||
|
||||
apply_pulsef = 1;
|
||||
fdac = 256e9;
|
||||
fadc = 256e9;
|
||||
random_key = 1;
|
||||
|
||||
rcalpha = 0.6;
|
||||
rcalpha = 0.05;
|
||||
kover = 16;
|
||||
|
||||
duob_mode = db_mode.no_db;
|
||||
@@ -63,9 +63,11 @@ Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"al
|
||||
"mrds_code",0,"mrds_blocklength",512).process();
|
||||
|
||||
%%%%% AWG
|
||||
El_sig = M8199A("kover",kover).process(Digi_sig);
|
||||
% El_sig = AWG("fdac",fdac,"f_cutoff",fsym,"lpf_active",0,"kover",kover,"bit_resolution",12,"upsampling_method","samplehold","precomp_sinc_rolloff",1).process(Digi_sig);
|
||||
% El_sig = M8199A("kover",kover).process(Digi_sig);
|
||||
El_sig = AWG("fdac",fdac,"f_cutoff",fsym,"lpf_active",0,"kover",kover,"bit_resolution",12,"upsampling_method","samplehold","precomp_sinc_rolloff",1).process(Digi_sig);
|
||||
El_sig.spectrum("displayname",'Digi Spectrum','fignum',1,'normalizeTo0dB',1);
|
||||
xlim([0,130]);
|
||||
ylim([-30,5]);
|
||||
% El_sig = El_sig.setPower(0,"dBm");
|
||||
|
||||
%%%%% Electrical Driver Amplifier %%%%%%
|
||||
|
||||
Reference in New Issue
Block a user