mainly tests (empty) and some theroy plots

This commit is contained in:
Silas Oettinghaus
2026-03-12 17:26:13 +01:00
parent 2a724b833f
commit 4c78a1e0b1
90 changed files with 1507 additions and 404 deletions

View File

@@ -1,6 +1,6 @@
M = 6;
M = 4;
apply_precode = 1;
bitpattern = [];
@@ -27,6 +27,10 @@ if apply_precode
else
symbols_tx = symbols;
end
disp(['Tx Sequenz: -- RMS:',sprintf('%.1f',rms(symbols_rx.signal)),' - - Levels -',num2str(numel(unique(symbols_rx.signal)))]);
unique(symbols_tx.signal)
disp('- - - - - - - - - -');
show2Dconstellation(symbols_tx,symbols_tx,"displayname",'VNLE Out','fignum',2241);
@@ -34,6 +38,10 @@ show2Dconstellation(symbols_tx,symbols_tx,"displayname",'VNLE Out','fignum',2241
if apply_precode
% Entschiedene Symbole codieren: d_DB(n) = d(n) + d(n-1) (im Fall von PAM4 7 level [0 1 2 3 4 5 6])
symbols_db = Duobinary().encode(symbols_tx);
disp(['DB encoded -- RMS:',sprintf('%.1f',rms(symbols_db.signal)),' - - Levels -',num2str(numel(unique(symbols_db.signal)))]);
unique(symbols_db.signal)
disp('- - - - - - - - - -');
% Entschiedene codierte Symbole decodieren: d_dec(n) = d_DB(n) mod4
symbols_rx = Duobinary().decode(symbols_db);
@@ -43,18 +51,18 @@ end
% Vergleichen von b(n) und d_dec(n)
bits_rx = PAMmapper(M,0).demap(symbols_rx);
disp(['Wieder normal -- RMS:',sprintf('%.1f',rms(symbols_rx.signal)),' - - Levels -',num2str(numel(unique(symbols_rx.signal)))]);
unique(symbols_rx.signal)
disp('- - - - - - - - - -');
[~,~,ber,~] = calc_ber(bits.signal,bits_rx.signal,"skip_front",10,"skip_end",10,"returnErrorLocation",1);
disp(['BER: ',sprintf('%.1E',ber),' - - PAM-',num2str(M)]);
figure()
subplot(1,2,1)
histogram(symbols_tx.signal,100,'Normalization','count')
figure(200)
clf
hold on
idxs = start-10:start+burstwidth+10;
scatter(idxs,d.signal(idxs),'DisplayName',['Orig Signal'],'Marker','o');
scatter(idxs,d_burst.signal(idxs),'DisplayName',['Error Signal'],'Marker','x');
scatter(idxs,d_dec.signal(idxs),'DisplayName',['EQ Signal'],'Marker','x');
yline(PAMmapper(M,0).thresholds,'HandleVisibility','off');
legend
ylim([-2 2])
subplot(1,2,2)
histogram(symbols_db.signal,100,'Normalization','count')