This commit is contained in:
Silas Oettinghaus
2026-04-29 10:17:09 +02:00
parent 910486f536
commit 56b48095db
8 changed files with 142 additions and 84 deletions

View File

@@ -191,8 +191,9 @@ classdef Signalgenerator
% PAMsource behavior. If length is omitted, it sets the
% output length. Internally it is converted to the PRMS
% order per stream.
% Default output length is 2^(order-1), except for
% PAM-6-style dimension = 5 where it is 2^(order-2).
% Default output length is 2^(order-1) for all mapper
% shapes. PAM-6 still reduces the internal PRMS order
% to keep the register length manageable.
% skip Number of PRMS symbols to advance before output. This
% is useful when different blocks should use shifted
% sections of the same deterministic sequence.
@@ -275,6 +276,10 @@ classdef Signalgenerator
switch obj.form
case {signalform.random, signalform.prms}
if obj.is_pam6_shape()
% PAM-6 consumes 5 input bits for 2 output symbols.
% To keep the symbol count aligned with the other
% PAM formats, reduce the number of generated rows
% before flattening to the mapper-ready bit vector.
length = 2^max(0, obj.order - 2);
else
length = 2^max(0, obj.order - 1);
@@ -291,19 +296,16 @@ classdef Signalgenerator
end
function prms_order = internal_prms_order(obj)
bits_per_symbol = obj.prms_bits_per_symbol();
bits_per_symbol = obj.prms_parallel_width();
prms_order = max(1, floor(obj.order / bits_per_symbol));
end
function bits_per_symbol = prms_bits_per_symbol(obj)
if (~isempty(obj.M) && obj.M == 6) || (isempty(obj.M) && obj.dimension == 5)
% PAM-6 mapping in this repo consumes 5 bits for 2 symbols.
bits_per_symbol = 2.5;
elseif ~isempty(obj.M)
bits_per_symbol = log2(obj.M);
function width = prms_parallel_width(obj)
if ~isempty(obj.M)
width = obj.mapper_bit_dimension();
else
bits_per_symbol = obj.dimension;
width = obj.dimension;
end
end