Many changes for 400G DSP

Minimal Example
...
This commit is contained in:
sioe
2024-12-17 16:17:58 +01:00
parent 397cfa61dd
commit e47a4dbbbe
68 changed files with 2749 additions and 2948 deletions

View File

@@ -1,10 +1,9 @@
classdef Duobinary
%Duobinary Coding
% should work
% should work
properties(Access=public)
end
methods (Access=public)
@@ -12,6 +11,7 @@ classdef Duobinary
function obj = Duobinary()
%NAME Construct an instance of this class
end
function signal = precode(~,signal)
@@ -52,7 +52,7 @@ classdef Duobinary
% end
for k = 2:numel(data)
bk(k) =mod(data(k)-bk(k-1),M);
bk(k) = mod(data(k)-bk(k-1),M);
end
%make bipolar
@@ -80,6 +80,11 @@ classdef Duobinary
function signal = encode(~,signal)
arguments
~
signal
end
if isa(signal,'Signal')
data = signal.signal;
else
@@ -138,6 +143,8 @@ classdef Duobinary
data = data ./ sqrt(5.8);
elseif M == 8
data = data ./ sqrt(10.5); % 15-level constellation weighted with probability after DB code i.e.
else
errormsg("Error in: Duobinary encode > scale unipolar to bipolar > The data is not PAM4, PAM6 or PAM 8? ")
end
if isa(signal,'Signal')
@@ -169,13 +176,9 @@ classdef Duobinary
if I == 7
data = data .* sqrt(2.5);
elseif I == 11
%todo
data = data .* sqrt(5.8);
warning('Check db decode implementation, mapping and scaling is correct!')
elseif I == 15
data = data .* sqrt(10.5);
elseif I == 16
warning('Check db decode implementation, mapping and scaling is correct!')
end
data = round(data);
@@ -196,6 +199,8 @@ classdef Duobinary
data = data ./ sqrt(10);
elseif M == 8
data = data ./ sqrt(21);
else
errormsg("Error in: Duobinary decode > scale unipolar to bipolar > The data is not PAM4, PAM6 or PAM 8? ")
end
signalclass.signal = data;