I would like to use crc.generator object to implement X.25 standard Cyclic Redundancy Check (CRC) codeing described in ITU-T Recommendation X.25:
but I am not able generate expected Frame Checking Sequence (FCS) described in the documentation (Example 2 in Appendix I, I.1, page 153/169):
% X.25 standard test input sequence
Address = [1 1 0 0 0 0 0 0];UA = [1 1 0 0 1 1 1 0];Input = [Address UA];% X.25 standard expected frame check sequence (FCS)
FCS = [1 1 0 0 1 1 0 0 0 0 1 0 0 1 1 0];% Configure Cyclic Redundancy Check Generator object
h=crc.generator;crcgen.FinalXOR='0xFFFF';% Generate FCS using crc.generator object
Output=generate(h,Input');MATLAB_FCS=Output(end-15:end)';% Result does not match expected FCS
isequal(FCS,MATLAB_FCS)
Best Answer