Merge branch 'main' of https://cau-git.rz.uni-kiel.de/nt/mitarbeiter/silas/imdd_simulation
This commit is contained in:
@@ -355,7 +355,7 @@ classdef Signal
|
|||||||
end
|
end
|
||||||
|
|
||||||
if isempty(options.fft_length)
|
if isempty(options.fft_length)
|
||||||
options.fft_length = 2^(nextpow2(length(obj.signal))-6);
|
options.fft_length = 2^(nextpow2(length(obj.signal))-9);
|
||||||
end
|
end
|
||||||
|
|
||||||
if options.normalizeToNyquist == 0
|
if options.normalizeToNyquist == 0
|
||||||
@@ -844,9 +844,9 @@ classdef Signal
|
|||||||
|
|
||||||
mode = 1;
|
mode = 1;
|
||||||
|
|
||||||
histpoints = 1024*2; %% verticale resolution
|
histpoints = 2048; %% verticale resolution
|
||||||
histpoints = floor(histpoints/2)*2+1; %% to have the eye digram centered around one point make the vertical resolution uneven
|
histpoints = floor(histpoints/2)*2+1; %% to have the eye digram centered around one point make the vertical resolution uneven
|
||||||
histpoints_horizontal = 512*2; %% horizontal resolution
|
histpoints_horizontal = 2048; %% horizontal resolution
|
||||||
hist_data=zeros(histpoints,histpoints_horizontal ); %% initilize eye diagram
|
hist_data=zeros(histpoints,histpoints_horizontal ); %% initilize eye diagram
|
||||||
|
|
||||||
if isa(obj,'Opticalsignal')
|
if isa(obj,'Opticalsignal')
|
||||||
@@ -905,16 +905,22 @@ classdef Signal
|
|||||||
hist_data(:,n)=flip(nn.'); %without flip, the eye is upside down :-(
|
hist_data(:,n)=flip(nn.'); %without flip, the eye is upside down :-(
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ax = gca;
|
||||||
|
|
||||||
plot_data = 20*log10(hist_data);
|
plot_data = 20*log10(hist_data);
|
||||||
plot_data(plot_data==-Inf) = 0;
|
plot_data(plot_data==-Inf) = 0;
|
||||||
|
|
||||||
imagesc(plot_data);
|
imagesc(plot_data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
% beautify
|
% beautify
|
||||||
colormap(cbrewer2("Blues",4096));
|
cm=flip(cbrewer2("RdYlBu",4096));
|
||||||
|
% cm=flip(cbrewer2("RdBu",4096));
|
||||||
|
cm(1,:) = [1,1,1];
|
||||||
|
cm(1,:) = [0,0,0];
|
||||||
|
colormap(cm);
|
||||||
|
% colormap('turbo');
|
||||||
|
ax.Colormap(1,:) = [1,1,1];
|
||||||
|
% ax.CLim = [0 50];
|
||||||
if isa(obj,'Opticalsignal')
|
if isa(obj,'Opticalsignal')
|
||||||
title(['Optical Eye ',options.displayname])
|
title(['Optical Eye ',options.displayname])
|
||||||
ylabel("Power in mW");
|
ylabel("Power in mW");
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ classdef PAMsource
|
|||||||
options.mrds_blocklength = 512;
|
options.mrds_blocklength = 512;
|
||||||
|
|
||||||
options.applypulseform = 1;
|
options.applypulseform = 1;
|
||||||
options.pulseformer Pulseformer;
|
options.pulseformer;
|
||||||
|
|
||||||
options.fs_out ;
|
options.fs_out ;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ classdef AwgKeysight
|
|||||||
% AWG.upload("Signal4",Signal);
|
% AWG.upload("Signal4",Signal);
|
||||||
|
|
||||||
|
|
||||||
properties(Access=protected)
|
properties(Access=public)
|
||||||
model awg_model
|
model awg_model
|
||||||
%fdac double
|
%fdac double
|
||||||
skews double
|
skews double
|
||||||
@@ -209,8 +209,7 @@ classdef AwgKeysight
|
|||||||
% read/write lock file to our ntserver/scratch
|
% read/write lock file to our ntserver/scratch
|
||||||
try
|
try
|
||||||
obj.check_lock(char(obj.model),1);
|
obj.check_lock(char(obj.model),1);
|
||||||
obj.lock_device(char(obj.model));
|
obj.lock_device(char(obj.model));
|
||||||
|
|
||||||
catch
|
catch
|
||||||
warning('Could not reach ntserver to write lock!')
|
warning('Could not reach ntserver to write lock!')
|
||||||
end
|
end
|
||||||
@@ -221,9 +220,14 @@ classdef AwgKeysight
|
|||||||
v = visadev('TCPIP0::zizou.tf.uni-kiel.de::hislip0::INSTR');
|
v = visadev('TCPIP0::zizou.tf.uni-kiel.de::hislip0::INSTR');
|
||||||
case awg_model.M8199B
|
case awg_model.M8199B
|
||||||
v = visadev('TCPIP0::localhost::hislip0::INSTR');
|
v = visadev('TCPIP0::localhost::hislip0::INSTR');
|
||||||
|
case awg_model.M8199A_ILV
|
||||||
|
v = visadev('TCPIP0::Zizou::hislip0::INSTR');
|
||||||
|
case awg_model.M8199A_ILV
|
||||||
|
v = visadev('TCPIP0::Zizou::hislip0::INSTR');
|
||||||
end
|
end
|
||||||
|
|
||||||
debug = 0;
|
debug = 0;
|
||||||
|
|
||||||
if debug
|
if debug
|
||||||
disp(['Connected to Instrument: ',char(v.Vendor),' ',char(v.Model),' SerNo:',char(v.SerialNumber)]);
|
disp(['Connected to Instrument: ',char(v.Vendor),' ',char(v.Model),' SerNo:',char(v.SerialNumber)]);
|
||||||
end
|
end
|
||||||
@@ -233,16 +237,17 @@ classdef AwgKeysight
|
|||||||
% aw=readline(v);
|
% aw=readline(v);
|
||||||
% assert(obj.numChannels==sscanf(aw, '%f'),['Wrong Channel config. AWG response: ',num2str(sscanf(aw, '%f')), ' Channels']);
|
% assert(obj.numChannels==sscanf(aw, '%f'),['Wrong Channel config. AWG response: ',num2str(sscanf(aw, '%f')), ' Channels']);
|
||||||
|
|
||||||
switch obj.model
|
|
||||||
case awg_model.M8196A
|
|
||||||
|
|
||||||
obj.writeNcheck(v,':INST:DACM FOUR');
|
if obj.model == awg_model.M8196A
|
||||||
obj.writeNcheck(v,':ABORt');
|
|
||||||
obj.writeNcheck(v,sprintf(':FREQuency:RASTer %.15g;', obj.fdac));
|
|
||||||
|
|
||||||
case awg_model.M8199B
|
obj.writeNcheck(v,':INST:DACM FOUR');
|
||||||
obj.writeNcheck(v,':ABORt ''M2''');
|
obj.writeNcheck(v,':ABORt');
|
||||||
obj.writeNcheck(v,sprintf(':FREQ ''M1.ClkGen'', %.15g;', obj.fdac));
|
obj.writeNcheck(v,sprintf(':FREQuency:RASTer %.15g;', obj.fdac));
|
||||||
|
|
||||||
|
elseif obj.model == awg_model.M8199B || obj.model == awg_model.M8199A || obj.model == awg_model.M8199A_ILV
|
||||||
|
|
||||||
|
obj.writeNcheck(v,':ABORt ''M2''');
|
||||||
|
obj.writeNcheck(v,sprintf(':FREQ ''M1.ClkGen'', %.15g;', obj.fdac));
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -257,8 +262,7 @@ classdef AwgKeysight
|
|||||||
|
|
||||||
if segm_len > 0
|
if segm_len > 0
|
||||||
|
|
||||||
switch obj.model
|
if obj.model == awg_model.M8196A
|
||||||
case awg_model.M8196A
|
|
||||||
|
|
||||||
% 1) TRAC DEl - delete the previous waveform
|
% 1) TRAC DEl - delete the previous waveform
|
||||||
obj.writeNcheck(v,sprintf(':TRACe%d:DELete %d', chan, segm_num));
|
obj.writeNcheck(v,sprintf(':TRACe%d:DELete %d', chan, segm_num));
|
||||||
@@ -278,7 +282,7 @@ classdef AwgKeysight
|
|||||||
% 5) SET OUTPUTS ON/ OFF (generation not started at this point)
|
% 5) SET OUTPUTS ON/ OFF (generation not started at this point)
|
||||||
obj.writeNcheck(v, sprintf(':OUTPut%d ON', chan));
|
obj.writeNcheck(v, sprintf(':OUTPut%d ON', chan));
|
||||||
|
|
||||||
case awg_model.M8199B
|
elseif obj.model == awg_model.M8199B || obj.model == awg_model.M8199A || obj.model == awg_model.M8199A_ILV
|
||||||
|
|
||||||
% 1) TRAC DEl - delete the previous ch waveform
|
% 1) TRAC DEl - delete the previous ch waveform
|
||||||
obj.writeNcheck(v,sprintf(':TRAC:DEL ''M2.DataOut%d'', %d', chan, segm_num));
|
obj.writeNcheck(v,sprintf(':TRAC:DEL ''M2.DataOut%d'', %d', chan, segm_num));
|
||||||
@@ -308,8 +312,7 @@ classdef AwgKeysight
|
|||||||
|
|
||||||
else
|
else
|
||||||
% If no signal defined, turn off channel
|
% If no signal defined, turn off channel
|
||||||
switch obj.model
|
if obj.model == awg_model.M8199B || obj.model == awg_model.M8199A || obj.model == awg_model.M8199A_ILV
|
||||||
case awg_model.M8199B
|
|
||||||
obj.writeNcheck(v, sprintf(':OUTP ''M2.DataOut%d'', OFF',chan));
|
obj.writeNcheck(v, sprintf(':OUTP ''M2.DataOut%d'', OFF',chan));
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -318,12 +321,11 @@ classdef AwgKeysight
|
|||||||
end
|
end
|
||||||
|
|
||||||
% Set global output on/ off to start generation
|
% Set global output on/ off to start generation
|
||||||
switch obj.model
|
if obj.model==awg_model.M8196A
|
||||||
case awg_model.M8196A
|
|
||||||
|
|
||||||
obj.writeNcheck(v,':INIT:IMMediate');
|
obj.writeNcheck(v,':INIT:IMMediate');
|
||||||
|
|
||||||
case awg_model.M8199B
|
elseif obj.model == awg_model.M8199B || obj.model == awg_model.M8199A || obj.model == awg_model.M8199A_ILV
|
||||||
|
|
||||||
% SET Ref clock out (which is conn. to scope) to 10 MHz
|
% SET Ref clock out (which is conn. to scope) to 10 MHz
|
||||||
obj.writeNcheck(v, ':OUTPut:FREQuency ''M1.RefClkOut'',10000000');
|
obj.writeNcheck(v, ':OUTPut:FREQuency ''M1.RefClkOut'',10000000');
|
||||||
@@ -331,7 +333,7 @@ classdef AwgKeysight
|
|||||||
% :OUTP:GLOB 'M1.System', OFF
|
% :OUTP:GLOB 'M1.System', OFF
|
||||||
obj.writeNcheck(v, ':OUTP:GLOB ''M1.System'', ON');
|
obj.writeNcheck(v, ':OUTP:GLOB ''M1.System'', ON');
|
||||||
obj.writeNcheck(v, ':OUTP:GLOB ''M2.System'', ON');
|
obj.writeNcheck(v, ':OUTP:GLOB ''M2.System'', ON');
|
||||||
obj.writeNcheck(v,':INIT:IMMediate ''M2''');
|
%obj.writeNcheck(v,':INIT:IMMediate ''M2''');
|
||||||
end
|
end
|
||||||
|
|
||||||
% operation ceomplete (opc)
|
% operation ceomplete (opc)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ classdef DC_supply < handle
|
|||||||
properties(Access=public)
|
properties(Access=public)
|
||||||
active
|
active
|
||||||
voltage
|
voltage
|
||||||
|
|
||||||
|
|
||||||
meas_voltage
|
meas_voltage
|
||||||
meas_current
|
meas_current
|
||||||
@@ -18,7 +17,6 @@ classdef DC_supply < handle
|
|||||||
|
|
||||||
function obj = DC_supply(options)
|
function obj = DC_supply(options)
|
||||||
|
|
||||||
|
|
||||||
arguments
|
arguments
|
||||||
options.active logical = true
|
options.active logical = true
|
||||||
options.voltage double = [0,0];
|
options.voltage double = [0,0];
|
||||||
@@ -35,10 +33,14 @@ classdef DC_supply < handle
|
|||||||
assert(size(obj.voltage,1)==1,'Set Voltage for CH1 and CH2 must be given as vector [V1, V2]');
|
assert(size(obj.voltage,1)==1,'Set Voltage for CH1 and CH2 must be given as vector [V1, V2]');
|
||||||
assert(size(obj.voltage,2)==2,'Set Voltage for CH1 and CH2 must be given as vector [V1, V2]');
|
assert(size(obj.voltage,2)==2,'Set Voltage for CH1 and CH2 must be given as vector [V1, V2]');
|
||||||
|
|
||||||
|
v = obj.connectDevice();
|
||||||
|
|
||||||
|
disp(['Connected to: ', char(v.Vendor),' ', char(v.Model),' :-)']);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function v = connectDevice(obj)
|
function v = connectDevice(obj)
|
||||||
v = visadev("GPIB1::19::INSTR");
|
v = visadev("GPIB0::19::INSTR");
|
||||||
end
|
end
|
||||||
|
|
||||||
function success = set(obj,options)
|
function success = set(obj,options)
|
||||||
@@ -51,15 +53,7 @@ classdef DC_supply < handle
|
|||||||
|
|
||||||
success = [0,0];
|
success = [0,0];
|
||||||
|
|
||||||
% %connect to device
|
v = obj.connectDevice();
|
||||||
% if exist('v','var')
|
|
||||||
% %v = visadev("GPIB1::19::INSTR");
|
|
||||||
% v = obj.connectDevice();
|
|
||||||
% else
|
|
||||||
%
|
|
||||||
% end
|
|
||||||
|
|
||||||
v = visadev("GPIB1::19::INSTR");
|
|
||||||
|
|
||||||
debug = 0;
|
debug = 0;
|
||||||
if debug
|
if debug
|
||||||
@@ -133,58 +127,55 @@ classdef DC_supply < handle
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function [voltage,current] = readVals(obj)
|
function [voltage,current] = readVals(obj)
|
||||||
|
|
||||||
try
|
|
||||||
%connect to device
|
|
||||||
v = visadev("GPIB1::19::INSTR");
|
|
||||||
|
|
||||||
debug = 0;
|
%connect to device
|
||||||
if debug
|
v = obj.connectDevice;
|
||||||
disp(['Connected to Instrument: ',char(v.Vendor),' ',char(v.Model),' SerNo:',char(v.SerialNumber)]);
|
|
||||||
end
|
|
||||||
|
|
||||||
cmd = 'INST:SEL?';
|
debug = 0;
|
||||||
writeline(v, cmd);
|
if debug
|
||||||
prev_selected_channel = readline(v);
|
disp(['Connected to Instrument: ',char(v.Vendor),' ',char(v.Model),' SerNo:',char(v.SerialNumber)]);
|
||||||
|
|
||||||
for ch = 1:2
|
|
||||||
|
|
||||||
% choose channel
|
|
||||||
cmd = ['INST:SEL OUT',num2str(ch)];
|
|
||||||
writeline(v, cmd);
|
|
||||||
|
|
||||||
% get current voltage level
|
|
||||||
cmd = 'VOLT?';
|
|
||||||
writeline(v, cmd);
|
|
||||||
voltage(ch) = str2num(readline(v));
|
|
||||||
|
|
||||||
% get current voltage level
|
|
||||||
cmd = 'MEAS:CURR?';
|
|
||||||
writeline(v, cmd);
|
|
||||||
current(ch) = str2num(readline(v));
|
|
||||||
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
% set channel back to prev. selected one
|
|
||||||
cmd = ['INST:SEL ',char(strtrim(prev_selected_channel))];
|
|
||||||
writeline(v, cmd);
|
|
||||||
|
|
||||||
obj.meas_voltage = voltage;
|
|
||||||
obj.meas_current = current;
|
|
||||||
|
|
||||||
%disconnect
|
|
||||||
delete(v);
|
|
||||||
|
|
||||||
catch
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
cmd = 'INST:SEL?';
|
||||||
|
writeline(v, cmd);
|
||||||
|
prev_selected_channel = readline(v);
|
||||||
|
|
||||||
|
for ch = 1:2
|
||||||
|
|
||||||
|
% choose channel
|
||||||
|
cmd = ['INST:SEL OUT',num2str(ch)];
|
||||||
|
writeline(v, cmd);
|
||||||
|
|
||||||
|
% get current voltage level
|
||||||
|
cmd = 'VOLT?';
|
||||||
|
writeline(v, cmd);
|
||||||
|
voltage(ch) = str2num(readline(v));
|
||||||
|
|
||||||
|
% get current voltage level
|
||||||
|
cmd = 'MEAS:CURR?';
|
||||||
|
writeline(v, cmd);
|
||||||
|
current(ch) = str2num(readline(v));
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
% set channel back to prev. selected one
|
||||||
|
cmd = ['INST:SEL ',char(strtrim(prev_selected_channel))];
|
||||||
|
writeline(v, cmd);
|
||||||
|
|
||||||
|
obj.meas_voltage = voltage;
|
||||||
|
obj.meas_current = current;
|
||||||
|
|
||||||
|
%disconnect
|
||||||
|
delete(v);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
classdef Exfo_laser < handle
|
classdef Exfo_laser < handle
|
||||||
|
|
||||||
properties(Access=private)
|
properties(Access=private)
|
||||||
serialport_number
|
connection_id
|
||||||
|
lab_interface
|
||||||
mainframe_channel
|
mainframe_channel
|
||||||
end
|
end
|
||||||
properties(Access=public)
|
properties(Access=public)
|
||||||
@@ -15,11 +16,11 @@ classdef Exfo_laser < handle
|
|||||||
|
|
||||||
function obj = Exfo_laser(options)
|
function obj = Exfo_laser(options)
|
||||||
|
|
||||||
|
|
||||||
arguments
|
arguments
|
||||||
options.safety_mode = 1;
|
options.safety_mode = 1;
|
||||||
options.serialport_number = 'COM8';
|
options.lab_interface lab_interface = lab_interface.gbib;
|
||||||
options.mainframe_channel = 1;
|
options.connection_id = '8';
|
||||||
|
options.mainframe_channel = 1;
|
||||||
end
|
end
|
||||||
|
|
||||||
%
|
%
|
||||||
@@ -30,29 +31,19 @@ classdef Exfo_laser < handle
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
v = obj.connectLaser_();
|
||||||
|
|
||||||
% Connect to the laser
|
|
||||||
o = serialport(obj.serialport_number, 9600);
|
|
||||||
configureTerminator(o, "CR", "CR"); % Set the terminator to carriage return (CR)
|
|
||||||
flush(o);
|
|
||||||
writeline(o, "*IDN?");
|
|
||||||
answ = readline(o);
|
|
||||||
|
|
||||||
if obj.safety_mode
|
|
||||||
disp(['Yay! We can talk to Instrument: ',char(answ)]);
|
|
||||||
end
|
|
||||||
|
|
||||||
% Read states the first time
|
% Read states the first time
|
||||||
obj.cur_state = obj.getLaserStatus_(o,obj.mainframe_channel);
|
obj.cur_state = obj.getLaserStatus_(v,obj.mainframe_channel);
|
||||||
obj.cur_wavelength = obj.getLaserWavelength_(o,obj.mainframe_channel);
|
obj.cur_wavelength = obj.getLaserWavelength_(v,obj.mainframe_channel);
|
||||||
obj.cur_power = obj.getLaserPower_(o,obj.mainframe_channel);
|
obj.cur_power = obj.getLaserPower_(v,obj.mainframe_channel);
|
||||||
|
|
||||||
clear o;
|
clear v;
|
||||||
|
|
||||||
if obj.safety_mode
|
if obj.safety_mode
|
||||||
warning("Safety_mode ON: Display all information. Ask when switching laser. Turn safety_mode off in class instance or during initialization Exfo_laser(...,'safety_mode',0)");
|
warning("Safety_mode ON: Display all information. Ask when switching laser. Turn safety_mode off in class instance or during initialization Exfo_laser(...,'safety_mode',0)");
|
||||||
else
|
else
|
||||||
warning("safety_mode OFF: EVERYTHING IS EXECUTED WITHOUT ASKING :-) BE SURE WHAT YOU DO");
|
disp("safety_mode OFF: EVERYTHING IS EXECUTED WITHOUT ASKING :-) BE SURE WHAT YOU DO");
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -171,20 +162,34 @@ classdef Exfo_laser < handle
|
|||||||
% Abort the operation
|
% Abort the operation
|
||||||
disp('Operation aborted. Laser remains at wavelength.');
|
disp('Operation aborted. Laser remains at wavelength.');
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end %public mehtods
|
end %public mehtods
|
||||||
methods (Access=private)
|
methods (Access=private)
|
||||||
|
|
||||||
function serialobj = connectLaser_(obj)
|
function v = connectLaser_(obj)
|
||||||
% Connect to the laser
|
% Connect to the laser
|
||||||
serialobj = serialport(obj.serialport_number, 9600);
|
|
||||||
configureTerminator(serialobj, "CR", "CR"); % Set the terminator to carriage return (CR)
|
if obj.lab_interface == lab_interface.serial
|
||||||
flush(serialobj);
|
% Connect to the laser via SERIAL (USB)
|
||||||
writeline(serialobj, "*IDN?");
|
v = serialport(obj.connection_id, 9600);
|
||||||
answ = readline(serialobj);
|
configureTerminator(v, "CR", "CR"); % Set the terminator to carriage return (CR)
|
||||||
|
elseif obj.lab_interface == lab_interface.gpib
|
||||||
|
% Connect via GPIB adress
|
||||||
|
visastring = ['GPIB0::',obj.connection_id,'::INSTR'];
|
||||||
|
v = visadev(visastring);
|
||||||
|
else
|
||||||
|
error('Interface not supported');
|
||||||
|
end
|
||||||
|
|
||||||
if obj.safety_mode
|
if obj.safety_mode
|
||||||
|
flush(v);
|
||||||
|
writeline(v, "*IDN?");
|
||||||
|
answ = readline(v);
|
||||||
disp(['Yay! We can talk to Instrument: ',char(answ)]);
|
disp(['Yay! We can talk to Instrument: ',char(answ)]);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -192,12 +197,16 @@ classdef Exfo_laser < handle
|
|||||||
% Function to GET the STATE of the laser
|
% Function to GET the STATE of the laser
|
||||||
function isEnabled = getLaserStatus_(obj,serialObj, channel)
|
function isEnabled = getLaserStatus_(obj,serialObj, channel)
|
||||||
|
|
||||||
writeline(serialObj, ['CH', num2str(channel), ':ENABLE?']); % Query current wavelength
|
writeline(serialObj, ['CH', num2str(channel), ':ENABLE?']); % Query current wavelength
|
||||||
|
|
||||||
manual_flush = 1;
|
if serialObj.Type == visalib.InterfaceType.serial
|
||||||
while manual_flush
|
manual_flush = 1;
|
||||||
|
while manual_flush
|
||||||
|
response = readline(serialObj);
|
||||||
|
manual_flush = contains(response, {'OK'});
|
||||||
|
end
|
||||||
|
else
|
||||||
response = readline(serialObj);
|
response = readline(serialObj);
|
||||||
manual_flush = contains(response, {'OK'});
|
|
||||||
end
|
end
|
||||||
|
|
||||||
isEnabled = 0;
|
isEnabled = 0;
|
||||||
@@ -211,14 +220,14 @@ classdef Exfo_laser < handle
|
|||||||
elseif ~isEnabled && isDisabled
|
elseif ~isEnabled && isDisabled
|
||||||
obj.cur_state = isEnabled;
|
obj.cur_state = isEnabled;
|
||||||
else
|
else
|
||||||
error(['Unknown Laser State ->', char(response)]);
|
error(['Quantum Laser State; your laser is ON and OFF ->', char(response)]);
|
||||||
end
|
end
|
||||||
|
|
||||||
if obj.safety_mode
|
if obj.safety_mode
|
||||||
if isEnabled
|
if isEnabled
|
||||||
disp(['Laser ', num2str(channel) ,' is currently ON -> ', char(response)]);
|
disp(['Laser ', num2str(channel) ,' is currently ON -> ', char(response)]);
|
||||||
elseif isDisabled
|
elseif isDisabled
|
||||||
disp(['Laser ', num2str(channel) ,' is currently OFF ->', char(response)]);
|
disp(['Laser ', num2str(channel) ,' is currently OFF -> ', char(response)]);
|
||||||
else
|
else
|
||||||
error(['Unknown Laser State ->', char(response)]);
|
error(['Unknown Laser State ->', char(response)]);
|
||||||
end
|
end
|
||||||
@@ -269,8 +278,11 @@ classdef Exfo_laser < handle
|
|||||||
isEnabled = obj.getLaserStatus_(serialObj,obj.mainframe_channel);
|
isEnabled = obj.getLaserStatus_(serialObj,obj.mainframe_channel);
|
||||||
|
|
||||||
writeline(serialObj, ['CH',num2str(channel),':ENABLE']);
|
writeline(serialObj, ['CH',num2str(channel),':ENABLE']);
|
||||||
response = readline(serialObj);
|
|
||||||
isok = contains(response, {'OK'});
|
if serialObj.Type == visalib.InterfaceType.serial
|
||||||
|
response = readline(serialObj);
|
||||||
|
isok = contains(response, {'OK'});
|
||||||
|
end
|
||||||
|
|
||||||
cnt=0;
|
cnt=0;
|
||||||
while ~isEnabled || cnt>10
|
while ~isEnabled || cnt>10
|
||||||
@@ -292,25 +304,30 @@ classdef Exfo_laser < handle
|
|||||||
isEnabled = obj.getLaserStatus_(serialObj,obj.mainframe_channel);
|
isEnabled = obj.getLaserStatus_(serialObj,obj.mainframe_channel);
|
||||||
|
|
||||||
writeline(serialObj, ['CH',num2str(channel),':DISABLE']);
|
writeline(serialObj, ['CH',num2str(channel),':DISABLE']);
|
||||||
response = readline(serialObj);
|
|
||||||
isok = contains(response, {'OK'});
|
|
||||||
|
|
||||||
|
if serialObj.Type == visalib.InterfaceType.serial
|
||||||
|
response = readline(serialObj);
|
||||||
|
isok = contains(response, {'OK'});
|
||||||
|
end
|
||||||
|
|
||||||
cnt=0;
|
cnt=0;
|
||||||
while isEnabled || cnt>10
|
while isEnabled || cnt>10
|
||||||
isEnabled = obj.getLaserStatus_(serialObj,obj.mainframe_channel);
|
isEnabled = obj.getLaserStatus_(serialObj,obj.mainframe_channel);
|
||||||
pause(0.2);
|
pause(0.5);
|
||||||
cnt = cnt+1;
|
cnt = cnt+1;
|
||||||
end
|
end
|
||||||
|
|
||||||
if isEnabled
|
if serialObj.Type == visalib.InterfaceType.serial
|
||||||
error('Laser not enabled but command was send')
|
if isEnabled
|
||||||
else
|
error('Laser not enabled but command was send')
|
||||||
success = 1;
|
else
|
||||||
|
success = 1;
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
% Function to SET the wavelength of the laser
|
% Function to SET the wavelength of the laser
|
||||||
function success = setLaserWavelength_(~,serialObj, channel, desiredWavelength_nm)
|
function success = setLaserWavelength_(obj,serialObj, channel, desiredWavelength_nm)
|
||||||
success = 0;
|
success = 0;
|
||||||
|
|
||||||
writeline(serialObj, ['CH',num2str(channel),':NM?']);
|
writeline(serialObj, ['CH',num2str(channel),':NM?']);
|
||||||
@@ -325,15 +342,18 @@ classdef Exfo_laser < handle
|
|||||||
command = ['CH', num2str(channel), ':L=', num2str(desiredWavelength_nm)];
|
command = ['CH', num2str(channel), ':L=', num2str(desiredWavelength_nm)];
|
||||||
writeline(serialObj, command);
|
writeline(serialObj, command);
|
||||||
|
|
||||||
pause(0.2);
|
if serialObj.Type == visalib.InterfaceType.serial
|
||||||
|
pause(0.2);
|
||||||
response = readline(serialObj);
|
response = readline(serialObj);
|
||||||
success = contains(response, 'OK');
|
success = contains(response, 'OK');
|
||||||
|
end
|
||||||
|
|
||||||
|
success = desiredWavelength_nm == obj.getLaserWavelength_(serialObj, channel);
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
% Function to SET the laser power
|
% Function to SET the laser power
|
||||||
function success = setLaserPower_(~,serialObj, channel, desiredPower_dBm)
|
function success = setLaserPower_(obj,serialObj, channel, desiredPower_dBm)
|
||||||
success = 0;
|
success = 0;
|
||||||
|
|
||||||
writeline(serialObj, ['CH',num2str(channel),':MW?']);
|
writeline(serialObj, ['CH',num2str(channel),':MW?']);
|
||||||
@@ -348,11 +368,13 @@ classdef Exfo_laser < handle
|
|||||||
command = ['CH', num2str(channel), ':P=', num2str(desiredPower_dBm)];
|
command = ['CH', num2str(channel), ':P=', num2str(desiredPower_dBm)];
|
||||||
writeline(serialObj, command);
|
writeline(serialObj, command);
|
||||||
|
|
||||||
pause(0.2);
|
if serialObj.Type == visalib.InterfaceType.serial
|
||||||
|
pause(0.2);
|
||||||
response = readline(serialObj);
|
response = readline(serialObj);
|
||||||
success = contains(response, 'OK');
|
success = contains(response, 'OK');
|
||||||
|
end
|
||||||
|
|
||||||
|
success = desiredPower_dBm == obj.getLaserPower_(serialObj, channel);
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -53,11 +53,8 @@ classdef OptAtten < handle
|
|||||||
|
|
||||||
try
|
try
|
||||||
%connect to device
|
%connect to device
|
||||||
|
|
||||||
|
|
||||||
v = visadev('TCPIP::134.245.243.248::INSTR');
|
v = visadev('TCPIP::134.245.243.248::INSTR');
|
||||||
|
|
||||||
|
|
||||||
debug = 0;
|
debug = 0;
|
||||||
if debug
|
if debug
|
||||||
disp(['Connected to Instrument: ',char(v.Vendor),' ',char(v.Model),' SerNo:',char(v.SerialNumber)]);
|
disp(['Connected to Instrument: ',char(v.Vendor),' ',char(v.Model),' SerNo:',char(v.SerialNumber)]);
|
||||||
@@ -279,6 +276,10 @@ classdef OptAtten < handle
|
|||||||
cnt = cnt+1;
|
cnt = cnt+1;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
fprintf("\n SET: CH1 %.2f dB | CH2: %.2f dB | CH3: %.2f dB | CH4: %.2f dB\n",obj.value_state(1), obj.value_state(2), obj.value_state(3), obj.value_state(4));
|
||||||
|
fprintf(" ATT: CH1 %.2f dB | CH2: %.2f dB | CH3: %.2f dB | CH4: %.2f dB\n",obj.atten_state(1), obj.atten_state(2), obj.atten_state(3), obj.atten_state(4));
|
||||||
|
fprintf(" POW: CH1 %.2f dBm | CH2: %.2f dBm | CH3: %.2f dBm | CH4: %.2f dBm \n \n",obj.power_state(1), obj.power_state(2), obj.power_state(3), obj.power_state(4));
|
||||||
|
|
||||||
delete(v);
|
delete(v);
|
||||||
|
|
||||||
catch error
|
catch error
|
||||||
@@ -292,7 +293,12 @@ classdef OptAtten < handle
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function [p1,p2,p3,p4]=readPower(obj)
|
function [p1,p2,p3,p4]=readPower(obj, options)
|
||||||
|
|
||||||
|
arguments
|
||||||
|
obj
|
||||||
|
options.silent = 0
|
||||||
|
end
|
||||||
|
|
||||||
v = visadev('TCPIP::134.245.243.248::INSTR');
|
v = visadev('TCPIP::134.245.243.248::INSTR');
|
||||||
cnt = 1;
|
cnt = 1;
|
||||||
@@ -309,6 +315,9 @@ classdef OptAtten < handle
|
|||||||
p3 = obj.power_state(3);
|
p3 = obj.power_state(3);
|
||||||
p4 = obj.power_state(4);
|
p4 = obj.power_state(4);
|
||||||
|
|
||||||
|
if options.silent == 0
|
||||||
|
fprintf("\n CH1: %.2f dB | CH2: %.2f dB | CH3: %.2f dB | CH4: %.2f dB\n \n",p1, p2, p3, p4);
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -43,13 +43,6 @@ classdef ScopeKeysight
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
switch obj.model
|
|
||||||
case scope_model.DSAZ634A
|
|
||||||
|
|
||||||
case scope_model.UXR1102A
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -68,7 +61,7 @@ classdef ScopeKeysight
|
|||||||
if isempty(obj.IPaddress)
|
if isempty(obj.IPaddress)
|
||||||
switch obj.model
|
switch obj.model
|
||||||
case scope_model.DSAZ634A
|
case scope_model.DSAZ634A
|
||||||
v=visadev('TCPIP0::keysight.tf.uni-kiel.de::inst0::INSTR');% TCPIP0::127.0.0.1::inst0::INSTR
|
v=visadev('TCPIP0::134.245.243.195::inst0::INSTR');% TCPIP0::127.0.0.1::inst0::INSTR
|
||||||
case scope_model.UXR1102A
|
case scope_model.UXR1102A
|
||||||
v=visadev('TCPIP0::testscope.tf.uni-kiel.de::inst0::INSTR');% TCPIP0::127.0.0.1::inst0::INSTR
|
v=visadev('TCPIP0::testscope.tf.uni-kiel.de::inst0::INSTR');% TCPIP0::127.0.0.1::inst0::INSTR
|
||||||
case scope_model.UXR1104B
|
case scope_model.UXR1104B
|
||||||
|
|||||||
9
Datatypes/lab_interface.m
Normal file
9
Datatypes/lab_interface.m
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
classdef lab_interface < int32
|
||||||
|
|
||||||
|
enumeration
|
||||||
|
gpib (1)
|
||||||
|
serial (2)
|
||||||
|
lan (3)
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -26,6 +26,10 @@ function [eq_package] = vnle(eq_,M,rx_signal,tx_symbols,tx_bits,options)
|
|||||||
end
|
end
|
||||||
|
|
||||||
%FFE or VNLE
|
%FFE or VNLE
|
||||||
|
if length(rx_signal)/2 == length(tx_symbols)+0.5
|
||||||
|
rx_signal.signal = rx_signal.signal(1:end-1);
|
||||||
|
elseif length(rx_signal)/2 == length(tx_symbols)-1
|
||||||
|
end
|
||||||
[eq_signal_sd,eq_noise] = eq_.process(rx_signal,tx_symbols);
|
[eq_signal_sd,eq_noise] = eq_.process(rx_signal,tx_symbols);
|
||||||
|
|
||||||
eq_signal_hd = PAMmapper(M,0).quantize(eq_signal_sd);
|
eq_signal_hd = PAMmapper(M,0).quantize(eq_signal_sd);
|
||||||
@@ -78,9 +82,12 @@ function [eq_package] = vnle(eq_,M,rx_signal,tx_symbols,tx_bits,options)
|
|||||||
eq_package.evm_lvl = evm_lvl;
|
eq_package.evm_lvl = evm_lvl;
|
||||||
eq_package.inf_rate_vnle = inf_rate;
|
eq_package.inf_rate_vnle = inf_rate;
|
||||||
|
|
||||||
|
eq_package.snr = snr(eq_signal_sd.signal,eq_noise.signal);
|
||||||
|
|
||||||
|
|
||||||
if options.showAnalysis
|
if options.showAnalysis
|
||||||
|
|
||||||
|
snr(eq_signal_sd.signal,eq_noise.signal);
|
||||||
fprintf(['VNLE EVM lvl: ',repmat('%.3f ',1,numel(evm_lvl)),' \n'],evm_lvl);
|
fprintf(['VNLE EVM lvl: ',repmat('%.3f ',1,numel(evm_lvl)),' \n'],evm_lvl);
|
||||||
|
|
||||||
fprintf('VNLE BER: %.2e \n',ber);
|
fprintf('VNLE BER: %.2e \n',ber);
|
||||||
|
|||||||
51
Functions/Theory/Neuer Ordner/duobinary_histogram.m
Normal file
51
Functions/Theory/Neuer Ordner/duobinary_histogram.m
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
figure(2)
|
||||||
|
tiledlayout(1,3)
|
||||||
|
cols = linspecer(5);
|
||||||
|
cnt = 1;
|
||||||
|
for m = [4,6,8]
|
||||||
|
|
||||||
|
M = m;
|
||||||
|
fsym = 112e9;
|
||||||
|
fdac = 256e9;
|
||||||
|
|
||||||
|
[Digi_sig,Symbols,Tx_bits] = PAMsource(...
|
||||||
|
"fsym",fsym,"M",M,"order",19,"useprbs",1,...
|
||||||
|
"fs_out",fdac,...
|
||||||
|
"applyclipping",0,"clipfactor",1.5,...
|
||||||
|
"applypulseform",0,"pulseformer",NaN,...
|
||||||
|
"randkey",33,...
|
||||||
|
"db_precode",1,"db_encode",0,...
|
||||||
|
"mrds_code",0,"mrds_blocklength",512).process();
|
||||||
|
|
||||||
|
Symbols_pre = Duobinary().precode(Symbols);
|
||||||
|
|
||||||
|
Symbols_db = Duobinary().encode(Symbols_pre);
|
||||||
|
|
||||||
|
if M == 4
|
||||||
|
Symbols_db.signal = Symbols_db.signal .*sqrt(2.5);
|
||||||
|
elseif M == 6
|
||||||
|
Symbols_db.signal = Symbols_db.signal .*sqrt(5.8);
|
||||||
|
elseif M == 8
|
||||||
|
Symbols_db.signal = Symbols_db.signal .*sqrt(10.5);
|
||||||
|
end
|
||||||
|
|
||||||
|
% figure(1)
|
||||||
|
% hold on
|
||||||
|
% histogram(Symbols_db.signal,"EdgeAlpha",0.3,"Normalization","probability");
|
||||||
|
|
||||||
|
|
||||||
|
% figure(1)
|
||||||
|
nexttile
|
||||||
|
hold on
|
||||||
|
bar(unique(Symbols_db.signal),histcounts(int32(Symbols_db.signal),"Normalization","probability"),"FaceColor",cols(cnt,:),"FaceAlpha",0.6,"BarWidth",1-(0.2*cnt),"LineWidth",0.5,"EdgeColor",'black','DisplayName',['Duobinary PAM-',num2str(M)]);
|
||||||
|
xticks(unique(Symbols_db.signal));
|
||||||
|
ylim([0 0.26]);
|
||||||
|
xlabel("Symbol")
|
||||||
|
|
||||||
|
|
||||||
|
cnt = cnt+1,
|
||||||
|
|
||||||
|
end
|
||||||
18
Functions/Theory/Neuer Ordner/duobinary_transferfunction.m
Normal file
18
Functions/Theory/Neuer Ordner/duobinary_transferfunction.m
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
% Define the filter taps
|
||||||
|
h_ = {[1],[1 1],[1 2 1],[1 3 3 1]};
|
||||||
|
|
||||||
|
for i = 1:length(h_)
|
||||||
|
h = h_{i};
|
||||||
|
|
||||||
|
[H, w] = freqz(h, 1, 1024, 1);
|
||||||
|
|
||||||
|
figure(1);
|
||||||
|
hold on
|
||||||
|
plot(w, 10*log10(abs(H)), 'LineWidth', 2,'DisplayName',['$(1+D)^2$']); %todo
|
||||||
|
xlabel('Normalized Frequency');
|
||||||
|
ylabel('Amplitude in dB');
|
||||||
|
grid on;
|
||||||
|
ylim([-20,10])
|
||||||
|
end
|
||||||
@@ -4,9 +4,9 @@ params = struct;
|
|||||||
|
|
||||||
params.M = [4];
|
params.M = [4];
|
||||||
params.datarate = [184];
|
params.datarate = [184];
|
||||||
params.rop = [-12:-5];
|
params.rop = [-5];
|
||||||
|
|
||||||
precomp_mode = 0; %0=do nothing ; 1= measure; 2=precomp active
|
precomp_mode = 1; %0=do nothing ; 1= measure; 2=precomp active
|
||||||
postfilter = 0; % noise whiten. approach -> Postfilter + MLSE
|
postfilter = 0; % noise whiten. approach -> Postfilter + MLSE
|
||||||
|
|
||||||
db_precode = 0;
|
db_precode = 0;
|
||||||
@@ -124,7 +124,7 @@ for M = wh.parameter.M.values
|
|||||||
Opt_sig = Fiber("fsimu",Opt_sig.fs,"fiber_length",link_length/1000,"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.07).process(Opt_sig);
|
Opt_sig = Fiber("fsimu",Opt_sig.fs,"fiber_length",link_length/1000,"alpha",0.3,"D",0,"lambda0",1310,"gamma",0,"Dslope",0.07).process(Opt_sig);
|
||||||
|
|
||||||
% Receiver ROP curve
|
% Receiver ROP curve
|
||||||
parfor i = 1:i_
|
for i = 1:i_
|
||||||
|
|
||||||
rop=wh.parameter.rop.values(i);
|
rop=wh.parameter.rop.values(i);
|
||||||
|
|
||||||
|
|||||||
@@ -6,15 +6,20 @@ if 1
|
|||||||
uloops.precomp = [0];
|
uloops.precomp = [0];
|
||||||
uloops.db_precode = [0];
|
uloops.db_precode = [0];
|
||||||
uloops.bitrate = [330].*1e9; %[300,330,360,390,420,450,480]
|
uloops.bitrate = [330].*1e9; %[300,330,360,390,420,450,480]
|
||||||
|
uloops.precomp = [1];
|
||||||
|
uloops.db_precode = [0];
|
||||||
|
uloops.bitrate = [300,330,360,390,420,450,480].*1e9; %[300,330,360,390,420,450,480]
|
||||||
% uloops.bitrate = 390e9;
|
% uloops.bitrate = 390e9;
|
||||||
% uloops.laser_wavelength = [1293,1297.5,1302,1306.5,1310,1313.4,1318,1322.7,1327.4];
|
% uloops.laser_wavelength = [1293,1297.5,1302,1306.5,1310,1313.4,1318,1322.7,1327.4];
|
||||||
uloops.laser_wavelength = [1293];
|
uloops.laser_wavelength = [1293];
|
||||||
uloops.M = [4];
|
uloops.M = [4];
|
||||||
|
uloops.laser_wavelength = [1310];
|
||||||
|
uloops.M = [6];
|
||||||
uloops.link_length = [2]; % 1,2,3,5,6,8,10
|
uloops.link_length = [2]; % 1,2,3,5,6,8,10
|
||||||
wh = DataStorage(uloops);
|
wh = DataStorage(uloops);
|
||||||
wh.addStorage("ber");
|
wh.addStorage("ber");
|
||||||
|
|
||||||
wh = submit_simulations(wh,"parallel",0,"simulation_mode",1);
|
wh = submit_simulations(wh,"parallel",0,"simulation_mode",0);
|
||||||
end
|
end
|
||||||
|
|
||||||
wh_ana = wh;
|
wh_ana = wh;
|
||||||
@@ -30,7 +35,7 @@ alpha = {};
|
|||||||
ber_dfe = {};
|
ber_dfe = {};
|
||||||
ngmi = [];
|
ngmi = [];
|
||||||
|
|
||||||
wavelength=1293;
|
wavelength=uloops.laser_wavelength;
|
||||||
for m = [4,6,8]
|
for m = [4,6,8]
|
||||||
%1302
|
%1302
|
||||||
%VNLE
|
%VNLE
|
||||||
@@ -40,14 +45,14 @@ for m = [4,6,8]
|
|||||||
ber_vnle = cellfun(@(x) x.vnle_pf_package{1,1}.ber_vnle, a);
|
ber_vnle = cellfun(@(x) x.vnle_pf_package{1,1}.ber_vnle, a);
|
||||||
|
|
||||||
%MLSE
|
%MLSE
|
||||||
precomp = 0;
|
% precomp = 0;
|
||||||
precode = 1;
|
% precode = 1;
|
||||||
a = wh_ana.getStoValue('ber',precomp, precode, uloops.bitrate , wavelength, m, uloops.link_length);
|
a = wh_ana.getStoValue('ber',precomp, precode, uloops.bitrate , wavelength, m, uloops.link_length);
|
||||||
ber_mlse = cellfun(@(x) x.vnle_pf_package{1,1}.ber_mlse, a);
|
ber_mlse = cellfun(@(x) x.vnle_pf_package{1,1}.ber_mlse, a);
|
||||||
|
|
||||||
%DB
|
%DB
|
||||||
precomp = 0;
|
% precomp = 0;
|
||||||
precode = 1;
|
% precode = 1;
|
||||||
a = wh_ana.getStoValue('ber',precomp, precode, uloops.bitrate , wavelength, m, uloops.link_length);
|
a = wh_ana.getStoValue('ber',precomp, precode, uloops.bitrate , wavelength, m, uloops.link_length);
|
||||||
ber_dbtgt = cellfun(@(x) x.dbtgt_package{1,1}.ber, a);
|
ber_dbtgt = cellfun(@(x) x.dbtgt_package{1,1}.ber, a);
|
||||||
|
|
||||||
|
|||||||
@@ -240,10 +240,11 @@ else
|
|||||||
%
|
%
|
||||||
% Raw_signal = Filter('filtdegree',4,"f_cutoff",Symbols.fs.*0.55,"fs",Raw_signal.fs,"filterType",filtertypes.gaussian,"active",true).process(Raw_signal);
|
% Raw_signal = Filter('filtdegree',4,"f_cutoff",Symbols.fs.*0.55,"fs",Raw_signal.fs,"filterType",filtertypes.gaussian,"active",true).process(Raw_signal);
|
||||||
%
|
%
|
||||||
% Scpe_cell{1}.eye(fsym,M,"displayname",'eye','fignum',227);
|
Scpe_cell{1}.eye(fsym,M,"displayname",'eye','fignum',227);
|
||||||
%
|
%
|
||||||
% Raw_signal.spectrum("normalizeTo0dB",0,"fignum",336,"fft_length",2^12);
|
% Raw_signal.spectrum("normalizeTo0dB",0,"fignum",336,"fft_length",2^12);
|
||||||
% Raw_signal.move_it_spectrum("fignum",334);
|
% Raw_signal.move_it_spectrum("fignum",334);
|
||||||
|
% Raw_signal.move_it_spectrum("fignum",334);
|
||||||
|
|
||||||
fsym = Symbols.fs;
|
fsym = Symbols.fs;
|
||||||
|
|
||||||
@@ -259,7 +260,7 @@ vnle_dfe_package = {};
|
|||||||
dbtgt_package = {};
|
dbtgt_package = {};
|
||||||
|
|
||||||
|
|
||||||
proc_occ = min(8,length(Scpe_cell));
|
proc_occ = min(1,length(Scpe_cell));
|
||||||
for occ = 1:proc_occ
|
for occ = 1:proc_occ
|
||||||
|
|
||||||
Scpe_sig = Scpe_cell{occ};
|
Scpe_sig = Scpe_cell{occ};
|
||||||
@@ -289,7 +290,7 @@ for occ = 1:proc_occ
|
|||||||
|
|
||||||
[result] = vnle(eq_vnle_dfe,M,Scpe_sig,Symbols,Tx_bits,"precode_mode",doub_mode,"showAnalysis",1);
|
[result] = vnle(eq_vnle_dfe,M,Scpe_sig,Symbols,Tx_bits,"precode_mode",doub_mode,"showAnalysis",1);
|
||||||
vnle_dfe_package{occ} = result;
|
vnle_dfe_package{occ} = result;
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
%%%%% VNLE + PF + MLSE %%%%
|
%%%%% VNLE + PF + MLSE %%%%
|
||||||
|
|||||||
44
projects/Lab_base_system/test_device_control.m
Normal file
44
projects/Lab_base_system/test_device_control.m
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
|
||||||
|
%% DC Source
|
||||||
|
desired_voltage = 2.1;
|
||||||
|
dcs = DC_supply("active",[1,0],"voltage",[desired_voltage, 0]);
|
||||||
|
dcs.set("voltage",[desired_voltage, 0]);
|
||||||
|
[v,i]=dcs.readVals();
|
||||||
|
|
||||||
|
%% Laser
|
||||||
|
laser = Exfo_laser("mainframe_channel",1,"safety_mode",0,"connection_id",'10','lab_interface','gpib');
|
||||||
|
laser.setWavelength(1311);
|
||||||
|
laser.setPower(0);
|
||||||
|
laser.enableLaser();
|
||||||
|
|
||||||
|
%% Optical Attenuator
|
||||||
|
voa = OptAtten("active",[2,0,0,0],"value",[-5,0,0,0],"wavelength",[1310,1310,1310,1310]);
|
||||||
|
voa.set('value',[-5,0,0,0]);
|
||||||
|
voa.readvals();
|
||||||
|
|
||||||
|
%% Construct AWG and Scope Modules %%%%%%
|
||||||
|
fdac = 256e9;
|
||||||
|
fadc = 160e9;
|
||||||
|
Scp = ScopeKeysight("model","DSAZ634A",'autoscale',1,"fadc","GSa_160","channel",[0,0,1,0],"recordLen",4000000,"removeDC",1,"extRef",0);
|
||||||
|
Awg = AwgKeysight("model","M8199A_ILV","fdac",fdac,"scaletodac",[1,1],"skews",[0,0],"voltages",[0,0.1]);
|
||||||
|
A2S = Awg2Scope(Awg,Scp,[0,3,0,0],"waitUntilClick",0); %
|
||||||
|
|
||||||
|
%%%%% Symbol Generation %%%%%%
|
||||||
|
fsym = 56e9;
|
||||||
|
M = 4;
|
||||||
|
rcalpha = 0.05;
|
||||||
|
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"rrcalpha",rcalpha);
|
||||||
|
|
||||||
|
Pamsource = PAMsource(...
|
||||||
|
"fsym",fsym,"M",M,"order",17,"useprbs",0,...
|
||||||
|
"fs_out",fdac,...
|
||||||
|
"applyclipping",0,"clipfactor",1.5,...
|
||||||
|
"applypulseform",0,"pulseformer",Pform,...
|
||||||
|
"randkey",1,...
|
||||||
|
"db_precode",0,"db_encode",0,...
|
||||||
|
"mrds_code",0,"mrds_blocklength",512);
|
||||||
|
|
||||||
|
tx_signal = Pamsource.process();
|
||||||
|
|
||||||
|
A2S.process("signal2",tx_signal);
|
||||||
|
|
||||||
Reference in New Issue
Block a user