⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 check_parity_sacch.m

📁 The GSMSP uses the USRP hardware device to receive data from the GSM band. This data is raw and pre
💻 M
字号:
function check_parity_sacch(rx_block, PARITY_CHK)

% Parity check 
% I have no idea what this does, but all bits in out() are 1 and that must
% mean something? I assume it means the parity is ok.

g = [1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1];
d = [rx_block PARITY_CHK];
[q,re] = deconv(d,g);

L = length(re);
out = abs(re(L-39:L));
for n = 1:length(out),
  if ceil(out(n)/2) ~= floor(out(n)/2)
    out(n) = 1;
  else
    out(n) = 0;
  end
end


if sum(out) == 40 
    fprintf(1,'\nChecksum correct!\n');
else
    fprintf(1,'\nChecksum error!\n');
end

⌨️ 快捷键说明

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