122 lines
3.3 KiB
Matlab
122 lines
3.3 KiB
Matlab
|
|
precomp_path = "C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\precomp";
|
|
precomp_fn = "lab_high_speed";
|
|
precomp_mode = 2; %0=do nothing ; 1= measure; 2=precomp active
|
|
db_precode = 0;
|
|
db_coding_approach = 0;
|
|
|
|
fsym = 160e9;
|
|
fdac = 256e9;
|
|
random_key = 0;
|
|
pams = [4];
|
|
|
|
cols = cbrewer2('Paired',6);
|
|
for i = 1:length(pams)
|
|
M = pams(i);
|
|
if (db_precode==1)&&(db_coding_approach==0)
|
|
|
|
if M == 4
|
|
pulsef=1;
|
|
precomp_amp_max = -50;
|
|
fsym = 196e9;
|
|
elseif M == 6
|
|
pulsef=0;
|
|
precomp_amp_max = -50;
|
|
fsym = 180e9;
|
|
elseif M == 8
|
|
pulsef=0;
|
|
precomp_amp_max = -50;
|
|
fsym = 160e9;
|
|
end
|
|
|
|
elseif (db_precode==1)&&(db_coding_approach==1)
|
|
|
|
if M == 4
|
|
pulsef=1;
|
|
precomp_amp_max = -38;
|
|
pulsef = 1;
|
|
elseif M == 6
|
|
pulsef=0;
|
|
precomp_amp_max = -38;
|
|
pulsef = 1;
|
|
elseif M == 8
|
|
pulsef=0;
|
|
precomp_amp_max = -38;
|
|
pulsef = 1;
|
|
end
|
|
|
|
elseif (db_precode==0)&&(db_coding_approach==0)
|
|
|
|
if M == 4
|
|
pulsef=1;
|
|
precomp_amp_max = -37;
|
|
pulsef = 1;
|
|
fsym = 196e9;
|
|
elseif M == 6
|
|
pulsef=0;
|
|
precomp_amp_max = -34;
|
|
pulsef = 1;
|
|
fsym = 180e9;
|
|
elseif M == 8
|
|
pulsef=0;
|
|
precomp_amp_max = -34;
|
|
pulsef = 0;
|
|
fsym = 160e9;
|
|
end
|
|
end
|
|
|
|
|
|
rcalpha = 0.05;
|
|
Pform = Pulseformer("fsym",fsym,"fdac",4*fsym,"pulse","rrc","pulselength",16,"alpha",rcalpha);
|
|
|
|
Pamsource = PAMsource(...
|
|
"fsym",fsym,"M",M,"order",19,"useprbs",0,...
|
|
"fs_out",fdac,...
|
|
"applyclipping",0,"clipfactor",1.2,...
|
|
"applypulseform",pulsef,"pulseformer",Pform,...
|
|
"randkey",random_key,...
|
|
"db_precode",db_precode,"db_encode",db_coding_approach,...
|
|
"mrds_code",0,"mrds_blocklength",512);
|
|
|
|
[Digi_sig,Symbols,Bits] = Pamsource.process();
|
|
|
|
Digi_sig = Digi_sig.normalize("mode","rms");
|
|
|
|
precomp_est = ChannelFreqResp("Nacq",2048,"Navg",100,"Ncp",63,'f_ref',Digi_sig.fs);
|
|
|
|
% maxampdb = [-30:-3:-50,precomp_amp_max];
|
|
maxampdb = precomp_amp_max;%sort(maxampdb);
|
|
cols_ = cbrewer2('spectral',15);
|
|
|
|
for j = 1:length(maxampdb)
|
|
|
|
if maxampdb(j) == precomp_amp_max
|
|
color=clr.Set1.green;
|
|
else
|
|
color=cols_(j,:);
|
|
end
|
|
|
|
Digi_sig_pre = precomp_est.precomp(Digi_sig,'maxampdb',maxampdb(j),'loadPath',precomp_path,'fileName',precomp_fn);
|
|
|
|
% Digi_sig_pre = Digi_sig_pre.normalize("mode","rms");
|
|
|
|
Digi_sig_pre = Digi_sig_pre.resample("fs_out",fdac);
|
|
|
|
Digi_sig_pre= Digi_sig_pre.normalize("mode","rms");
|
|
|
|
Digi_sig_pre.spectrum("displayname","Strong Precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0,"color",color,"linestyle",'-','addDCoffset',27);
|
|
|
|
end
|
|
|
|
Digi_sig.spectrum("displayname","No Precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0,"color",cols(2*i,:),"linestyle",'-','addDCoffset',27);
|
|
|
|
end
|
|
|
|
ylim([-25,10]);
|
|
xlim([0,105]);
|
|
xticks(0:20:110);
|
|
yticks(-30:10:10);
|
|
|
|
fig = gcf;
|
|
pos = [536.3333 879 450 222];
|
|
set(fig, 'Position', pos); |