homeoffice push
This commit is contained in:
@@ -74,7 +74,7 @@ classdef AWG
|
|||||||
|
|
||||||
% normalize to 0dBm before applying the lowpass
|
% normalize to 0dBm before applying the lowpass
|
||||||
%signalclass_in = signalclass_in.normalize("mode","milliwatt");
|
%signalclass_in = signalclass_in.normalize("mode","milliwatt");
|
||||||
signalclass_in = signalclass_in.setPower(12,"dBm");
|
signalclass_in = signalclass_in.setPower(6,"dBm");
|
||||||
|
|
||||||
% 4. Apply LPF on the signal
|
% 4. Apply LPF on the signal
|
||||||
if obj.lpf_active
|
if obj.lpf_active
|
||||||
@@ -89,7 +89,7 @@ classdef AWG
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
signalclass_in.power
|
||||||
|
|
||||||
% append to logbook
|
% append to logbook
|
||||||
current_class = class(obj);
|
current_class = class(obj);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
|
|
||||||
datarate = 112e9;
|
% datarate = 128e9;
|
||||||
M = 6;
|
M = 4;
|
||||||
laser_linewidth = 0;
|
laser_linewidth = 0;
|
||||||
kover = 32;
|
kover = 32;
|
||||||
fsym = round(datarate*1e-9 / log2(M))*1e9;
|
fsym = 92e9;%round(datarate*1e-9 / log2(M))*1e9;
|
||||||
fdac = 256e9;
|
fdac = 256e9;
|
||||||
|
|
||||||
% 1) PRBS Generation
|
% 1) PRBS Generation
|
||||||
@@ -15,87 +15,73 @@ bitpattern=[];
|
|||||||
for i = 1:log2(M)
|
for i = 1:log2(M)
|
||||||
[bitpattern(:,i),seed] = prbs(O,N,seed);
|
[bitpattern(:,i),seed] = prbs(O,N,seed);
|
||||||
end
|
end
|
||||||
|
|
||||||
if M == 6
|
if M == 6
|
||||||
bitpattern = reshape(bitpattern,[],1);
|
bitpattern = reshape(bitpattern,[],1);
|
||||||
bitpattern = bitpattern(1:end-mod(length(bitpattern),5));
|
bitpattern = bitpattern(1:end-mod(length(bitpattern),5));
|
||||||
end
|
end
|
||||||
|
|
||||||
% 2 ) Build Inf. signal class
|
|
||||||
bits = Informationsignal(bitpattern);
|
bits = Informationsignal(bitpattern);
|
||||||
|
|
||||||
|
% 2) Digi modulation -> PAM-M signal
|
||||||
alphas = flip([0.01,0.05,0.1,0.2,0.3,0.4]);
|
|
||||||
LP_awg = Filter('filtdegree',5,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.butterworth);
|
|
||||||
AWG_=AWG("fdac",fdac,"dac_min",-1,"dac_max",1,"H_lpf",LP_awg,"kover",kover,"bit_resolution",16,"lpf_active",1,"normalize2dac",1,"upsampling_method","samplehold");
|
|
||||||
|
|
||||||
|
|
||||||
% 3) Digi modulation -> PAM-M signal
|
|
||||||
digimod_out = PAMmapper(M,0).map(bits);
|
digimod_out = PAMmapper(M,0).map(bits);
|
||||||
digimod_out.fs = fsym;
|
digimod_out.fs = fsym;
|
||||||
|
|
||||||
X = Pulseformer("fsym",fsym,"fdac",fdac,"pulse","rrc","pulselength",16,"rrcalpha",alphas(a)).process(digimod_out);
|
% 3) Pulseform Raised Cosine
|
||||||
|
X = Pulseformer("fsym",fsym,"fdac",fdac,"pulse","rrc","pulselength",16,"rrcalpha",0.2).process(digimod_out);
|
||||||
|
|
||||||
% plot_eye(X.signal,X.fs,fsym);
|
% Implememt Precompensation
|
||||||
% 5) AWG (lowpass, quantization, sample and hold)
|
|
||||||
|
% Implement Precoding
|
||||||
|
|
||||||
|
% 4) AWG (lowpass, quantization, sample and hold)
|
||||||
|
LP_awg = Filter('filtdegree',5,"f_cutoff",64e9,"fs",fdac*kover,"filterType",filtertypes.butterworth);
|
||||||
|
AWG_=AWG("fdac",fdac,"dac_min",-1,"dac_max",1,"H_lpf",LP_awg,"kover",kover,"bit_resolution",16,"lpf_active",1,"normalize2dac",1,"upsampling_method","samplehold");
|
||||||
X = AWG_.process(X);
|
X = AWG_.process(X);
|
||||||
|
plot_eye(X.signal,X.fs,fsym);
|
||||||
f=figure(12);
|
|
||||||
f.Name = 'spectrum';
|
|
||||||
spectrum_plot(X.signal,X.fs,'spectrum');
|
|
||||||
|
|
||||||
figure(4)
|
|
||||||
LP_awg.showHere();
|
|
||||||
|
|
||||||
disp(['El. power: ',num2str(X.power),' dBm (into 50 Ohm)']);
|
disp(['El. power: ',num2str(X.power),' dBm (into 50 Ohm)']);
|
||||||
disp(['El. RMS voltage: ',num2str(sqrt(mean(X.signal.^2))),' V']);
|
disp(['El. RMS voltage: ',num2str(sqrt(mean(X.signal.^2))),' V']);
|
||||||
disp(['max voltage: ',num2str(max(X.signal)),' V']);
|
disp(['max voltage: ',num2str(max(X.signal)),' V']);
|
||||||
|
|
||||||
rms_ = rms(X.signal);
|
% 5) Lowpass behavior before laser
|
||||||
max_ = max(X.signal);
|
|
||||||
min_ = min(X.signal);
|
|
||||||
figure(1);
|
|
||||||
hold on
|
|
||||||
plot(X.signal,'LineWidth',0.1);
|
|
||||||
yline([max_, min_],'LineWidth',2,'LineStyle','--');
|
|
||||||
yline([rms_, -rms_],'LineWidth',2,'LineStyle',':');
|
|
||||||
ylim([-3 3]);
|
|
||||||
title(['AWG output: ',num2str(X.power), 'dBm']);
|
|
||||||
|
|
||||||
f=figure(12);
|
|
||||||
f.Name = 'spectrum';
|
|
||||||
spectrum_plot(X.signal,X.fs,'spectrum');
|
|
||||||
|
|
||||||
% 6) Lowpass behavior before laser
|
|
||||||
LP_modulator= Filter('filtdegree',4,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.butterworth);
|
LP_modulator= Filter('filtdegree',4,"f_cutoff",70e9,"fs",fdac*kover,"filterType",filtertypes.butterworth);
|
||||||
X = LP_modulator.process(X);
|
X = LP_modulator.process(X);
|
||||||
|
|
||||||
|
% 6) Laser; Modulation -> OPTICAL DOMAIN
|
||||||
% 7) Normalize signal to 0dB rms
|
u_pi = 4;
|
||||||
figure(1);subplot(1,2,1);plot(X.signal,'LineWidth',0.1);ylim([-3 3]);title(['AWG output: ',num2str(X.power), 'dBm into 50 Ohm']);
|
vbias = -1.8;
|
||||||
|
|
||||||
% 1) Laser; Modulation -> OPTICAL DOMAIN
|
|
||||||
u_pi = 2;
|
|
||||||
vbias = -1;
|
|
||||||
extmodlaser = EML("mode",eml_mode.im_cosinus,"power",0,"fsimu",X.fs,"lambda",1290,"bias",vbias,"u_pi",u_pi,"linewidth",laser_linewidth,"randomkey",5);
|
extmodlaser = EML("mode",eml_mode.im_cosinus,"power",0,"fsimu",X.fs,"lambda",1290,"bias",vbias,"u_pi",u_pi,"linewidth",laser_linewidth,"randomkey",5);
|
||||||
|
[Opt,extmodlaser] = extmodlaser.process(X);
|
||||||
|
|
||||||
E = X.normalize("mode","oneone");
|
if 1
|
||||||
figure(1);subplot(1,2,2);plot(E.signal,'LineWidth',0.1);ylim([-3 3]);title(['scaled to modulator; ',num2str(E.power), 'dBm']);
|
f = figure(22);
|
||||||
disp(['El. power: ',num2str(E.power),' dBm (into 50 Ohm)']);
|
tiledlayout(2,2);
|
||||||
|
nexttile
|
||||||
|
hold on
|
||||||
|
scatter(X.signal(1:100000),(abs(Opt.signal(1:100000)).^2)*1e3,0.1,'.','DisplayName','Modulator TF')
|
||||||
|
xlabel('Input in V')
|
||||||
|
ylabel('Output in mW')
|
||||||
|
|
||||||
[Opt,extmodlaser] = extmodlaser.process(E);
|
nexttile
|
||||||
|
hold on
|
||||||
|
plot(X.signal,'LineWidth',0.1);
|
||||||
|
yline([max_, min_],'LineWidth',2,'LineStyle','--');
|
||||||
|
yline([rms_, -rms_],'LineWidth',2,'LineStyle',':');
|
||||||
|
ylim([-3 3]);
|
||||||
|
title(['AWG output: ',num2str(X.power), 'dBm']);
|
||||||
|
|
||||||
|
|
||||||
|
nexttile
|
||||||
|
spectrum_plot(Opt.signal,Opt.fs);
|
||||||
|
|
||||||
|
|
||||||
|
rms_ = rms(X.signal);
|
||||||
|
max_ = max(X.signal);
|
||||||
|
min_ = min(X.signal);
|
||||||
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
f=figure(12);
|
|
||||||
f.Name = 'spectrum';
|
|
||||||
spectrum_plot(X.signal,X.fs,'spectrum');
|
|
||||||
|
|
||||||
plot_eye(E.signal,E.fs,fsym);
|
|
||||||
|
|
||||||
figure(111)
|
|
||||||
hold on
|
|
||||||
scatter(E.signal(1:100000),(abs(Opt.signal(1:100000)).^2)*1e3,0.1,'.','DisplayName','Modulator TF')
|
|
||||||
xlabel('Input in V')
|
|
||||||
ylabel('Output in mW')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user