PR stuff
This commit is contained in:
@@ -2,16 +2,21 @@ classdef Partialresponse
|
||||
%PARTIALRESPONSE Generalized symbol-domain partial-response coding.
|
||||
|
||||
properties
|
||||
M = []
|
||||
order = 1
|
||||
end
|
||||
|
||||
methods
|
||||
function obj = Partialresponse(varargin)
|
||||
parser = inputParser;
|
||||
parser.addParameter("order", 1);
|
||||
parser.parse(varargin{:});
|
||||
function obj = Partialresponse(options)
|
||||
arguments
|
||||
options.M = [];
|
||||
options.order = 1;
|
||||
end
|
||||
|
||||
obj.order = parser.Results.order;
|
||||
fn = fieldnames(options);
|
||||
for n = 1:numel(fn)
|
||||
obj.(fn{n}) = options.(fn{n});
|
||||
end
|
||||
end
|
||||
|
||||
function signal = precode(obj, signal, options)
|
||||
@@ -134,13 +139,19 @@ classdef Partialresponse
|
||||
end
|
||||
end
|
||||
|
||||
function M = resolveM(~, data, M)
|
||||
function M = resolveM(obj, data, M)
|
||||
if isempty(M)
|
||||
M = obj.M;
|
||||
end
|
||||
if isempty(M)
|
||||
M = numel(unique(round(data, 12)));
|
||||
end
|
||||
end
|
||||
|
||||
function M = resolveEncodedM(obj, data, M)
|
||||
if isempty(M)
|
||||
M = obj.M;
|
||||
end
|
||||
if isempty(M)
|
||||
I = numel(unique(round(data, 12)));
|
||||
if obj.order == 1
|
||||
|
||||
Reference in New Issue
Block a user