Many changes for 400G DSP
Minimal Example ...
This commit is contained in:
@@ -1,43 +1,55 @@
|
||||
useprbs = 1;
|
||||
M = 6;
|
||||
M = 4;
|
||||
randkey = 1;
|
||||
datarate = 448e9;
|
||||
fsym = round(datarate / log2(M)) ;
|
||||
|
||||
%%%%% PRBS Generation in correct shape for Modulation Format %%%%%%
|
||||
O = 17; %order of prbs
|
||||
O = 15; %O of prbs
|
||||
N = 2^(O); %length of prbs
|
||||
[~,seed] = prbs(O,1); %initialize first seed of prbs
|
||||
bitpattern=[];
|
||||
|
||||
if useprbs
|
||||
for i = 1:log2(M)
|
||||
[bitpattern(:,i),seed] = prbs(O,N,seed);
|
||||
end
|
||||
else
|
||||
s = RandStream('twister','Seed',randkey);
|
||||
for i = 1:log2(M)
|
||||
bitpattern(:,i) = randi(s,[0 1], N, 1);
|
||||
end
|
||||
end
|
||||
state = struct();
|
||||
|
||||
para = struct();
|
||||
|
||||
if M == 6
|
||||
bitpattern = reshape(bitpattern,[],1);
|
||||
bitpattern = bitpattern(1:end-mod(length(bitpattern),5));
|
||||
para.bl = 2^(O-2);
|
||||
para.dimension = 5;
|
||||
else
|
||||
para.bl = 2^(O-1);
|
||||
para.dimension = log2(M); %2.5bits/sym -> 2 bit/sym
|
||||
end
|
||||
|
||||
para.rand = 0;
|
||||
|
||||
para.order = floor(O / log2(M));
|
||||
para.skip =0;
|
||||
para.bruijn = 0;
|
||||
para.reset_prms = 0;
|
||||
para.method = 1;
|
||||
|
||||
data_in = [];
|
||||
global loop;
|
||||
loop = 0;
|
||||
[data_out,state_] = prms(data_in, state, para);
|
||||
loop = 1;
|
||||
[data_out,state_out] = prms(data_in, state_, para);
|
||||
bitpattern = data_out';
|
||||
|
||||
Tx_bits = Informationsignal(bitpattern);
|
||||
|
||||
Symbols_tx = PAMmapper(M,0).map(Tx_bits);
|
||||
Symbols_tx.fs = fsym;
|
||||
|
||||
Symbols = Duobinary().precode(Symbols_tx);
|
||||
Symbols1 = Duobinary().precode(Symbols_tx);
|
||||
|
||||
Symbols = Duobinary().encode(Symbols);
|
||||
Symbols2 = Duobinary().encode(Symbols1);
|
||||
|
||||
Symbols = Duobinary().decode(Symbols);
|
||||
Symbols3 = Duobinary().decode(Symbols2);
|
||||
|
||||
Rx_bits = PAMmapper(M,0).demap(Symbols);
|
||||
Rx_bits = PAMmapper(M,0).demap(Symbols3);
|
||||
|
||||
[~,error_num,ber,error_pos] = calc_ber(Tx_bits.signal,Rx_bits.signal,"skip_front",0,"skip_end",0,"returnErrorLocation",1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user