📄 rllencode.m
字号:
%RLLencode(in)
% This function RLL encodes a string of bits (whose length must be
% an integer multiple of p) into a (d,inf) RLL code that holds
% when concatenated.
function out = RLLencode(in)
load codebook n d allwords totalwords
p = length(de2bi(totalwords)) - 1;
q = n + d;
rate = p/q;
chain = zeros(1,length(in) / rate);
for i=0:(length(in)/p)-1
lookup = in(p*i+1:p*(i+1));
index = bi2de(fliplr(lookup)) + 1;
coded = zeros(1,q);
coded(1:n) = allwords(index, 1:n);
chain(q*i+1:q*(i+1)) = coded;
end
out = chain;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -