Commit 22c0921d authored by Fredrik Bagge Carlson's avatar Fredrik Bagge Carlson
Browse files

Add iddata implementation for prbs signals

parent adf65142
function idinput(N, class = "prbs"; band = 1)
output = zeros(N)
if lowercase(class) == "prbs"
start = 0x02;
a = start;
for i = 1:N
newbit = (((a >> 12) $ (a >> 3) $ (a >> 2) $ (a >> 0)) & 1);
a = ((a << 1) | newbit) & 0x7f;
output[i] = newbit
end
if band > 1
output = repmat(output',band,1)[1:N]
end
else
warn("Input class $class not supported")
end
return output
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment