Many changes for 400G DSP
Minimal Example ...
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -45,14 +45,14 @@ classdef Postfilter < handle
|
||||
|
||||
function showFilter(obj,noiseclass_in)
|
||||
|
||||
noiseclass_in.spectrum('displayname','Noise PSD shifted to 0dBm','fignum',123,'normalizeTo0dB',1);
|
||||
noiseclass_in.spectrum('displayname','Noise PSD shifted to 0dBm','fignum',121,'normalizeTo0dB',1);
|
||||
|
||||
[h,w] = freqz(1,obj.burg_coeff,length(noiseclass_in),"whole",noiseclass_in.fs);
|
||||
h = h/max(abs(h));
|
||||
hold on
|
||||
w_ = (w - noiseclass_in.fs/2);
|
||||
plot(w_.*1e-9,20*log10(fftshift(h)),'DisplayName',['Burg Coeffs: ', num2str(obj.burg_coeff), ' ']);
|
||||
|
||||
plot(w_.*1e-9,20*log10(fftshift(abs(h))),'DisplayName',['Burg Coeffs: ', num2str(obj.burg_coeff), ' ']);
|
||||
ylim([-30,2]);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user