WIP
This commit is contained in:
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