a_input.m

来自「英文书《Digital Signal Processing with Examp」· M 代码 · 共 19 行

M
19
字号
function [bit,jb]=a_input(y,jb,ipr);
% Function used by a_decode to pull one bit from y.
% bit  =bit pulled: 1 or 0.
% jb   =bit location in y - incremented and output as jb+1.
% ipr has the same effect here as in a_decode when =2.
iy=fix(jb/8)+1;
% Byte=0 if length of y is exceeded.
if iy>length(y),
	byte=0;
else
   byte=y(iy);
end
ybit=7-rem(jb,8);
bit=rem(fix(byte/2^ybit),2);
if ipr==2,
   fprintf('Pulled%2.0f at jbit=%7.0f\n',bit,jb);
end
jb=jb+1;

⌨️ 快捷键说明

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