Add new minimal example (+ a ton of other, not so important, changes)
This commit is contained in:
@@ -8,84 +8,115 @@ db_coding_approach = 0;
|
||||
fsym = 160e9;
|
||||
fdac = 256e9;
|
||||
random_key = 0;
|
||||
M = 4;
|
||||
pams = [4];
|
||||
|
||||
if (db_precode==1)&&(db_coding_approach==0)
|
||||
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;
|
||||
elseif M == 6
|
||||
pulsef=0;
|
||||
precomp_amp_max = -50;
|
||||
elseif M == 8
|
||||
pulsef=0;
|
||||
precomp_amp_max = -50;
|
||||
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
|
||||
|
||||
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;
|
||||
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
|
||||
|
||||
elseif (db_precode==0)&&(db_coding_approach==0)
|
||||
Digi_sig.spectrum("displayname","No Precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0,"color",cols(2*i,:),"linestyle",'-','addDCoffset',27);
|
||||
|
||||
if M == 4
|
||||
pulsef=1;
|
||||
precomp_amp_max = -37;
|
||||
pulsef = 1;
|
||||
elseif M == 6
|
||||
pulsef=0;
|
||||
precomp_amp_max = -34;
|
||||
pulsef = 1;
|
||||
elseif M == 8
|
||||
pulsef=0;
|
||||
precomp_amp_max = -34;
|
||||
pulsef = 0;
|
||||
end
|
||||
end
|
||||
|
||||
ylim([-25,10]);
|
||||
xlim([0,105]);
|
||||
xticks(0:20:110);
|
||||
yticks(-30:10:10);
|
||||
|
||||
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");
|
||||
|
||||
Digi_sig.spectrum("displayname","No Precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0);
|
||||
|
||||
precomp_est = ChannelFreqResp("Nacq",2048,"Navg",100,"Ncp",63,'f_ref',Digi_sig.fs);
|
||||
|
||||
Digi_sig = precomp_est.precomp(Digi_sig,'maxampdb',precomp_amp_max,'loadPath',precomp_path,'fileName',precomp_fn);
|
||||
|
||||
Digi_sig = Digi_sig.normalize("mode","rms");
|
||||
|
||||
Digi_sig = Digi_sig.resample("fs_out",fdac);
|
||||
|
||||
Digi_sig= Digi_sig.normalize("mode","rms");
|
||||
|
||||
Digi_sig.spectrum("displayname","Strong Precomp","fignum",2223,"normalizeToNyquist",0,"normalizeTo0dB",0);
|
||||
|
||||
ylim([-30,3]);
|
||||
xlim([-5,100]);
|
||||
fig = gcf;
|
||||
pos = [536.3333 879 450 222];
|
||||
set(fig, 'Position', pos);
|
||||
Reference in New Issue
Block a user