len31_preamble_code.m

来自「source Matlab traites the UWB」· M 代码 · 共 24 行

M
24
字号
%
% Return the length 31 ternary preamble code with Code Index "id" from the 
% set of 8 length 31 codes of 802.15.4.a
%
% function x = len31_preamble_code(id)
%
function x = len31_preamble_code(id)


X = [   -1 0 0 0 0 1 0 -1 0 1 1 1 0 1 -1 0 0 0 1 -1 1 1 1 0 0 -1 1 0 -1 0 0 ;
        0 1 0 1 -1 0 1 0 1 0 0 0 -1 1 1 0 -1 1 -1 -1 -1 0 0 1 0 0 1 1 0 0 0 ;
        -1 1 0 1 1 0 0 0 -1 1 -1 1 1 0 0 1 1 0 1 0 0 -1 0 0 0 0 -1 0 1 0 -1 ;
        0 0 0 0 1 -1 0 0 -1 0 0 -1 1 1 1 1 0 1 -1 1 0 0 0 1 0 -1 0 1 1 0 -1 ;
        -1 0 1 -1 0 0 1 1 1 -1 1 0 0 0 -1 1 0 1 1 1 0 -1 0 1 0 0 0 0 -1 0 0 ;
        1 1 0 0 1 0 0 -1 -1 -1 1 -1 0 1 1 -1 0 0 0 1 0 1 0 -1 1 0 1 0 0 0 0 ;
        1 0 0 0 0 1 -1 0 1 0 1 0 0 1 0 0 0 1 0 1 1 -1 -1 -1 0 -1 1 0 0 -1 1 ;
        0 1 0 0 -1 0 -1 0 1 1 0 0 0 0 -1 -1 1 0 0 -1 1 0 1 1 -1 1 1 0 1 0 0 ;];

x = X(id,:);

return;


⌨️ 快捷键说明

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