📄 rllnd.m
字号:
%RLLnd(n,d)
% This function returns the number of RLL codewords
% with bit length 'n' adhering to a (d,inf) RLL
% encoding system. They do not necessarily hold when
% concatenated.
%
% The numbers produced with this function match the
% table given in the Tang and Bahl paper.
function out = RLLnd(n,d)
dec = [0:2^n-1]';
bin = de2bi(dec);
good = ones(1,2^n)';
for i=1:2^n
for j=1:(n-d)
x = 0;
for k = 0:d
x = x + bin(i,(j+k));
end
if x > 1
good(i,1) = 0;
end
end
end
totalwords = sum(good);
wordsparse = good .* dec;
worddense = find(wordsparse) - 1;
somecodes = de2bi(worddense);
somezeros = zeros(1,n);
allbackwards = [somezeros ; somecodes];
allwords = fliplr(allbackwards);
save codebook n d allwords totalwords;
out = totalwords;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -