Many changes

This commit is contained in:
Silas Oettinghaus
2025-02-14 14:54:03 +01:00
parent 2be1254611
commit becaf3f6c9
26 changed files with 1507 additions and 1052 deletions

View File

@@ -1,5 +1,5 @@
useprbs = 1;
M = 4;
M = 6;
randkey = 1;
datarate = 448e9;
fsym = round(datarate / log2(M)) ;
@@ -38,19 +38,33 @@ loop = 1;
[data_out,state_out] = prms(data_in, state_, para);
bitpattern = data_out';
if M == 6
bitpattern = reshape(bitpattern',[],1);
bitpattern = bitpattern(1:end-mod(length(bitpattern),5));
end
Tx_bits = Informationsignal(bitpattern);
%%%%% Duobinary %%%%%%
close all
Symbols_tx = PAMmapper(M,0).map(Tx_bits);
Symbols_tx.fs = fsym;
Symbols1 = Duobinary().precode(Symbols_tx);
figure;histogram(Symbols1.signal);
Symbols2 = Duobinary().encode(Symbols1);
figure;histogram(Symbols2.signal);
Symbols3 = Duobinary().decode(Symbols2);
figure;histogram(Symbols3.signal);
autoArrangeFigures;
Rx_bits = PAMmapper(M,0).demap(Symbols3);
%%%%% Check BER of Bit Sequence %%%%%%
[~,error_num,ber,error_pos] = calc_ber(Tx_bits.signal,Rx_bits.signal,"skip_front",0,"skip_end",0,"returnErrorLocation",1);
disp(['BER: ',sprintf('%.1E',ber),' - - PAM-',num2str(M)]);