WIP
This commit is contained in:
@@ -57,7 +57,7 @@ classdef AWG
|
||||
obj.dac_max = 0.5;
|
||||
obj.dac_min = -.5;
|
||||
obj.lowpass = 1; %LP
|
||||
obj.f_cutoff = 32e9;
|
||||
obj.f_cutoff = 50e9;
|
||||
elseif options.preset == "M8199B"
|
||||
%https://www.keysight.com/us/en/assets/3120-1465/data-sheets/M8199A-128-256-GSa-s-Arbitrary-Waveform-Generator.pdf
|
||||
end
|
||||
|
||||
@@ -46,9 +46,6 @@ classdef Fiber
|
||||
obj.b3 = ((obj.lambda0.^2/(2*pi*Constant.LightSpeed)).^2*obj.Dslope);
|
||||
obj.alpha_lin = obj.alpha/10*log(10)/1000;
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
function signalclass_out = process(obj,signalclass_in)
|
||||
@@ -57,7 +54,7 @@ classdef Fiber
|
||||
signalclass_in.signal = obj.process_(signalclass_in.signal);
|
||||
|
||||
% append to logbook
|
||||
lbdesc = ['Fiber '];
|
||||
lbdesc = 'Fiber ';
|
||||
signalclass_in = signalclass_in.logbookentry(lbdesc);
|
||||
|
||||
% write to output
|
||||
@@ -149,13 +146,7 @@ classdef Fiber
|
||||
|
||||
end
|
||||
|
||||
function yout = process_nonlinstep(xin,stepsize)
|
||||
|
||||
end
|
||||
|
||||
function yout = process_linstep(xin,stepsize)
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ classdef Signal
|
||||
if isa(obj,'Electricalsignal')
|
||||
|
||||
%convert to optical
|
||||
disp("Convert signal: elec. -> info.!");
|
||||
varargout{1} = obj.fs;
|
||||
i_sig = Informationsignal(obj.signal);
|
||||
|
||||
@@ -54,7 +53,6 @@ classdef Signal
|
||||
if isa(obj,'Opticalsignal')
|
||||
|
||||
%convert to electrical
|
||||
disp("Convert signal: opt. -> elec. Fetch all properties (e.g. nase)!");
|
||||
varargout{1} = obj.nase;
|
||||
varargout{2} = obj.lambda;
|
||||
e_sig = Electricalsignal(obj.signal,"fs",obj.fs,"logbook",obj.logbook);
|
||||
|
||||
BIN
Functions/.DS_Store
vendored
BIN
Functions/.DS_Store
vendored
Binary file not shown.
25
comm_tb.m
25
comm_tb.m
@@ -1,6 +1,6 @@
|
||||
clear all
|
||||
|
||||
O = 17; %order of prbs
|
||||
O = 15; %order of prbs
|
||||
N = 2^(O-1); %length of prbs
|
||||
[~,seed] = prbs(O,1); %initialize first seed of prbs
|
||||
|
||||
@@ -19,28 +19,17 @@ fadc = 256e9;
|
||||
% Simulation frequency in "analog domain"
|
||||
fsimu = kover * fdac ;
|
||||
|
||||
[settings, button] = settingsdlg(...
|
||||
'Description' , ['This dialog will set the ', ...
|
||||
'parameters used by FMINCON()'], ...
|
||||
'title' , 'FMINCON() options', ...
|
||||
'separator' , 'Unconstrained/General', ...
|
||||
{'This is a checkbox'; 'Check'} , [false, false],...
|
||||
{'Tolerance X';'TolX'} , 1e-6, ...
|
||||
{'Tolerance on Function';'TolFun'} , 1e-6, ...
|
||||
'Algorithm' , {'active-set','interior-point'}, ...
|
||||
'separator' , 'Constrained', ...
|
||||
{'Tolerance on Constraints';'TolCon'}, 1e-6);
|
||||
|
||||
%CONSTRUCTION
|
||||
pam_mapper = PAMmapper(M,0);
|
||||
|
||||
awg = AWG('preset','M8196A','fdac',fdac,'kover',kover,'lpf_active',0);
|
||||
awg = AWG('preset','M8196A','fdac',fdac,'kover',kover,'lpf_active',0,'f_cutoff',80e9,'lpf_type',filtertypes.bessel_bilin);
|
||||
|
||||
%fil_tx = Filter('filtdegree',1,"f_cutoff",80e9,"fsamp",fdac,"filterType",filtertypes.bessel_bilin);
|
||||
fil_tx = Filter('filtdegree',1,"f_cutoff",50e9,"fsamp",fdac,"filterType",filtertypes.bessel_bilin);
|
||||
|
||||
u_pi = 3.5;
|
||||
vbias = (0.5*u_pi)-u_pi;
|
||||
extmodlaser = EML("mode",emlmodes.im_cosinus,"power",10,"fsimu",fsimu,"lambda",1550,"bias",vbias,"u_pi",u_pi,"linewidth",0);
|
||||
extmodlaser = EML("mode",emlmodes.im_cosinus,"power",10,"fsimu",fsimu,"lambda",1550,"bias",vbias,"u_pi",u_pi,"linewidth",1000);
|
||||
|
||||
amp = Amplifier("amplification_db",10,"amp_mode","gain","type","ideal","saturation_mode",0,'saturation_power',10);
|
||||
|
||||
@@ -69,6 +58,8 @@ X = Informationsignal(bitpattern);
|
||||
|
||||
PAMSIG = pam_mapper.map(X);
|
||||
|
||||
X = PAMSIG;
|
||||
|
||||
X.signal = applyPulseShaping(PAMSIG.signal,fsym,fdac);
|
||||
|
||||
% ELECTRICAL DOMAIN
|
||||
@@ -92,16 +83,16 @@ X = scp.process(X);
|
||||
|
||||
X = X.resample("fs_out",2*fsym,"fs_in",fadc);
|
||||
|
||||
|
||||
% INFORMATION SIGNAL
|
||||
X = eq.process(X,PAMSIG);
|
||||
|
||||
X = pam_mapper.demap(X);
|
||||
|
||||
% BER
|
||||
[bits,errors,BER] = calc_ber(X.signal(:,10000:end-20),bitpattern(10000:end-20,:)',0);
|
||||
[bits,errors,BER] = calc_ber(X.signal(:,10000:end-21),bitpattern(10000:end-20,:)',0);
|
||||
|
||||
disp(['BER: ', sprintf('%2E',BER)]);
|
||||
|
||||
disp(X.logbook);
|
||||
|
||||
function yout = applyPulseShaping(xin,fsym,fdac)
|
||||
|
||||
Reference in New Issue
Block a user