Files
imdd_silas/projects/Lab_2024/lab_modulator_tf_sweep.m
Silas Labor Zizou 1b554f2d25 Adapt AWG to work with M8199B
Minor changes in Scope
Measurement Codes for OFC 2025
2024-10-20 17:23:35 +02:00

137 lines
4.7 KiB
Matlab

measurement_name = 'MZM_SD40';
% Initialize a structure to hold parameters
params = struct;
% Define the bias voltage range from 1.2V to 2.8V with 0.01V increments
params.v_bias = 0:0.1:6;
% Create a DataStorage object with the defined parameters
wh = DataStorage(params);
% Add a storage field for output power measurements
wh.addStorage("p_out");
wh.addStorage("i_draw");
wh.addStorage("v_set");
% Display the total number of measurement loops to be executed
disp(['Start Measurement of ', num2str(prod(wh.dim)), ' loops...']);
% Initialize the Optical Attenuator (VOA) with specified settings
voa = OptAtten(...
"active", [0, 1, 0, 0], ... % Activate only the first channel
"value", [0, 0, 0, 0], ... % Set attenuation values to 0 dB
"wavelength", [1310, 1310, 1310, 1310]); % Set the wavelength for each channel
% Set the VOA active channels and attenuation values
voa.set('active', [0, 1, 0, 0], 'value', [0, 0, 0, 0]);
% Initialize the DC Power Supply with specified settings
v_bias_init = wh.parameter.v_bias.values(1);
dcs = DC_supply(...
"active", [1, 0], ... % Activate the first two channels
"voltage", [v_bias_init, 0]); % Set initial voltages for channels
% Loop over each bias voltage value to perform measurements
for v_bias = wh.parameter.v_bias.values
%%%%% SET Voltages %%%%%%
% Update the DC supply voltage for the current bias voltage
dcs.set("voltage", [v_bias, 0]);
%%%%% Measure Voltages %%%%%%
[v,c] = dcs.readVals();
% assert(v(1)==v_bias,['Desired voltage is ', num2str(v_bias),'V but currently is ', num2str(v(1)), ' V ']);
%%%%% Measure VOA %%%%%%
% Read the current values from the VOA
voa.readvals();
% Store the measured output power in the DataStorage object
wh.addValueToStorage(voa.power_state(2), 'p_out', v_bias);
wh.addValueToStorage(c(1), 'i_draw', v_bias);
wh.addValueToStorage(v(1), 'v_set', v_bias);
% Retrieve all stored output power measurements up to the current point
p_opt_out = wh.getStoValue('p_out', wh.parameter.v_bias.values);
% Plot the measured output power in dBm versus the negative bias voltage
% Plot the output power converted from dBm to linear scale (Watts)
figure(91);
clf
hold on
plot(wh.parameter.v_bias.values(1:numel(p_opt_out)), db2pow(p_opt_out), 'DisplayName', 'Measured Output Power in Watts','LineWidth',2);
xlim([min(params.v_bias), max(params.v_bias)]); % Set x-axis limits
grid on; % Enable grid for better readability
xlabel('applied voltage in V')
ylabel('measured optical power in dB')
end
save(['C:\Users\sioe\Nextcloud\Dokumente\02_Ablage_Office\HighSpeedMeasurement_2024\Messreihe_TFLN_MZM\',measurement_name],'wh');
p_opt_in = 0; %dbm
% After completing the measurements, retrieve all output power data
p_opt_out = wh.getStoValue('p_out', wh.parameter.v_bias.values);
transmission = p_opt_out;
i_draw = wh.getStoValue('i_draw', wh.parameter.v_bias.values);
v_set = wh.getStoValue('v_set', wh.parameter.v_bias.values);
power_draw = i_draw .* v_set .* 1e3; %watt
resistance = v_set ./ i_draw;
i_draw = i_draw.* 1e3;
% Plot the output power converted from dBm to linear scale (Watts)
cols = linspecer(4);
c = 1;
linstyle = '-';
figure(91);
hold on
subplot(2,2,1)
hold on
plot(power_draw, transmission, 'DisplayName', measurement_name,'LineWidth',1,'Marker','none','Color',cols(c,:),'LineStyle',linstyle);
title('MZM Attenuation')
xlim([min(power_draw), max(power_draw)]); % Set x-axis limits
grid on; % Enable grid for better readability
xlabel('DUT Power (mW)');
ylabel('Transmission in dB');
legend
subplot(2,2,2)
hold on
plot(v_set, i_draw, 'DisplayName', measurement_name,'LineWidth',1,'Marker','none','Color',cols(c,:),'LineStyle',linstyle);
title('Voltage vs. Current')
xlim([min(v_set), max(v_set)]); % Set x-axis limits
grid on; % Enable grid for better readability
xlabel('Voltage (mA)');
ylabel('Current (mA)');
legend
subplot(2,2,3)
hold on
plot(power_draw, db2pow(transmission), 'DisplayName', measurement_name,'LineWidth',1,'Marker','none','Color',cols(c,:),'LineStyle',linstyle);
title('Measured Output Power in Watt')
xlim([min(power_draw), max(power_draw)]); % Set x-axis limits
grid on; % Enable grid for better readability
xlabel('DUT Power (mW)');
ylabel('Trabnsmission in %');
legend
subplot(2,2,4)
hold on
plot(power_draw, resistance, 'DisplayName', measurement_name,'LineWidth',1,'Marker','none','Color',cols(c,:),'LineStyle',linstyle);
title('Heater Resistance = U/I')
xlim([min(power_draw), max(power_draw)]); % Set x-axis limits
grid on; % Enable grid for better readability
xlabel('DUT Power (mW)');
ylabel('Resistance in Ohm');
ylim([455, 470])
legend
disp('Measurement Complete!')