diff_enc.m

来自「the source code of Ziemer s book Digital」· M 代码 · 共 13 行

M
13
字号
%diff_enc(input); function to differentially encode a bit stream vector%function output = diff_enc(input)
L_in = length(input);
output = [];
for k = 1:L_in
   if k == 1
      output(k) = not(bitxor(input(k),1));
   else
      output(k) = not(bitxor(input(k),output(k-1)));
   end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?