57 lines
1.5 KiB
Matlab
57 lines
1.5 KiB
Matlab
|
|
|
|
|
|
Scope_sig = load("projects/MPI_August/scpe_sig.mat","Scpe_sig");
|
|
Scope_sig = Scope_sig.Scpe_sig;
|
|
Symbols = load("projects/MPI_August/symbols.mat","Symbols");
|
|
Symbols = Symbols.Symbols;
|
|
Bits = load("projects/MPI_August/bits.mat","Bits");
|
|
Bits = Bits.Bits;
|
|
|
|
|
|
lenbuff = [80];
|
|
|
|
for m = 1:numel(lenbuff)
|
|
|
|
Eq = FFE_adaptive_decision("epochs_tr",5,"epochs_dd",5,"len_tr",4096*2,"mu_dd",1e-4,"mu_tr",0,"order",25,"sps",2,"decide",0,"buffer_length",lenbuff(m));
|
|
|
|
[EQ_sig] = Eq.process(Scope_sig,Symbols);
|
|
|
|
%%%%% DEMAP %%%%%%
|
|
Rx_bits = PAMmapper(4,0).demap(EQ_sig);
|
|
|
|
% BER
|
|
[~,errors_bm,ber,errors] = calc_ber(Rx_bits.signal,Bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1);
|
|
|
|
disp(['BER: ',sprintf('%.1E',ber)]);
|
|
|
|
end
|
|
|
|
% fs = 2*112e9;
|
|
% N = 2^(nextpow2(length(Eq.error(1,:)))-6);
|
|
% [p_lin,w] = pwelch(Eq.error(1,:),hanning(N),N/2,N,fs,"centered","power","mean");
|
|
% p_dbm = 10*log10(p_lin)+30; %dB to dBm in case of "power"
|
|
|
|
% figure(123); % If figure does not exist, create new figure
|
|
% hold on
|
|
% plot(w.*1e-9,p_dbm,'DisplayName',['bla'],'LineWidth',1);
|
|
% xlabel("Frequency in GHz");
|
|
% %ylabel("Power/frequency (dB/Hz)");
|
|
% ylabel("Power (dBm)");
|
|
% xlim([-fs/2 fs/2].*1e-9)
|
|
% edgetick = 2^(nextpow2(fs*1e-9));
|
|
% xticks([-edgetick:16:edgetick]);
|
|
% xlim([-244, 244])
|
|
% ylim([-120,-0]);
|
|
% yticks([-200:10:10]);
|
|
% legend
|
|
|
|
|
|
%%%% Look at Pam levels %%%%%
|
|
if 1
|
|
a = PAMmapper(4,0).separate_pamlevels(EQ_sig);
|
|
figure(15);hold on;scatter(1:EQ_sig.length,a,1,'.');
|
|
end
|
|
|
|
|