98 lines
3.6 KiB
Matlab
98 lines
3.6 KiB
Matlab
|
|
% Set your folder path here
|
|
folderPath = 'C:\Users\sioe\Documents\High_Speed_Measurement_2024\mpi_measurement\';
|
|
|
|
fileTimeStmp = 'testen20241028_163511';
|
|
fileBody = [fileTimeStmp,'_PAM_4_R_336000000000_DB_1_I_atten_'];
|
|
|
|
fileBits = [folderPath,fileBody,'0_bits'];
|
|
fileSymbols = [folderPath,fileBody,'0_symbols'];
|
|
fileWareHouse = [folderPath,fileTimeStmp,'_wh'];
|
|
|
|
Bits = load(fileBits,"Bits");Bits = Bits.Bits;
|
|
Symbols = load(fileSymbols);Symbols = Symbols.Symbols;
|
|
wh = load(fileWareHouse);wh = wh.obj;
|
|
M = wh.parameter.M.values(1);
|
|
|
|
cnt = 1;
|
|
for i_atten = 24%flip([0:3:30,45])
|
|
|
|
fileRx = [folderPath,fileBody,num2str(i_atten),'_rx_signal'];
|
|
S = load(fileRx);S = S.S;
|
|
|
|
Scpe_sig_raw = load([folderPath,fileBody,num2str(i_atten),'_raw_signal']);
|
|
Scpe_sig_raw = Scpe_sig_raw.Scpe_sig_raw;
|
|
|
|
Scpe_sig_raw.spectrum("displayname",'Raw signal','fignum',80,'normalizeTo0dB',1);
|
|
|
|
eq_values = min(numel(S),8);
|
|
Noi = cell(eq_values,1);
|
|
EQ_vnle= cell(eq_values,1);
|
|
EQ_ffe= cell(eq_values,1);
|
|
|
|
%ffe = EQ("Ne",[50,0,0],"Nb",[0,0,0],"training_length",4096*2,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[0.0004 0.0004 0.0004 0.0004 ],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
|
vnle = EQ("Ne",[50,0,0],"Nb",[0,0,0],"training_length",4096*2,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.0,"DDmu",[0.0004 0.0004 0.0004 0.0004 ],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1);
|
|
|
|
parfor s = 1:eq_values
|
|
if 1
|
|
%VNLE
|
|
Scpe_sig_syncd = S{s};
|
|
[EQ_vnle{s}] = vnle.process(Scpe_sig_syncd,Symbols);
|
|
Noi{s} = EQ_vnle{s}-Symbols;
|
|
Rx_bits = PAMmapper(M,0).demap(EQ_vnle{s});
|
|
[~,~,ber_vnle(s),~] = calc_ber(Rx_bits.signal,Bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
|
end
|
|
|
|
%VNLE + MLSE
|
|
if 1
|
|
Noi{s}.signal = Noi{s}.signal - mean(Noi{s}.signal);
|
|
nc = 2;
|
|
burg_coeff = arburg(Noi{s}.signal,nc);
|
|
EQ_mlse = EQ_vnle{s}.filter(burg_coeff,1);
|
|
|
|
EQ_mlse = MLSE("DIR",burg_coeff,"duobinary_output",0,"M",M,"trellis_states",PAMmapper(M,0).levels).process(EQ_mlse);
|
|
Rx_bits = PAMmapper(M,0).demap(EQ_mlse);
|
|
[~,~,ber_vnle_mlse(s),~] = calc_ber(Rx_bits.signal,Bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
|
end
|
|
end
|
|
|
|
if 1
|
|
[~,s]=min(ber_vnle_mlse);
|
|
nc = 2;
|
|
burg_coeff = arburg(Noi{s}.signal,nc);
|
|
Noi{s}.spectrum('displayname','Noise PSD','fignum',123);
|
|
[h,w] = freqz(1,burg_coeff,length(Noi{s}),"whole",Noi{s}.fs);
|
|
h = h/max(abs(h));
|
|
hold on
|
|
w_ = (w - Noi{s}.fs/2);
|
|
plot(w_.*1e-9,20*log10(fftshift(h)),'DisplayName',['', num2str(nc), ' coefficients for burg alg.']);
|
|
end
|
|
|
|
disp(['VNLE EQ: BEST BER: ',sprintf('%.1E',min(ber_vnle)),' AVG BER: ',sprintf('%.1E',mean(ber_vnle)),' WORST:',sprintf('%.1E',max(ber_vnle)),'. Out of ',num2str(numel(ber_vnle))]);
|
|
disp(['VNLE+MLSE EQ: BEST BER: ',sprintf('%.1E',min(ber_vnle_mlse)),' AVG BER: ',sprintf('%.1E',mean(ber_vnle_mlse)),' WORST:',sprintf('%.1E',max(ber_vnle_mlse)),'. Out of ',num2str(numel(ber_vnle_mlse))]);
|
|
|
|
vnle_result(cnt) = min(ber_vnle);
|
|
mlse_result(cnt) = min(ber_vnle_mlse);
|
|
cnt=cnt+1;
|
|
end
|
|
|
|
|
|
|
|
i_atten = flip([0:3:30,45]);
|
|
figure(90)
|
|
plot(i_atten,mlse_result);
|
|
% Continue with the rest of your plot settings
|
|
title('MPI')
|
|
yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off');
|
|
xlabel('Bit Rate in GBps');
|
|
ylabel('Attenuation of I Branch');
|
|
set(gca, 'yscale', 'log');
|
|
set(gca, 'Box', 'on');
|
|
grid on;
|
|
grid minor;
|
|
legend('Interpreter', 'none');
|
|
|
|
|
|
|
|
|