3 releases
Uses old Rust 2015
0.1.2 | Mar 29, 2018 |
---|---|
0.1.1 | Jan 7, 2018 |
0.1.0 | Dec 31, 2017 |
#13 in #fec
Used in code-rs
11KB
184 lines
cai_cyclic – Encoding and decoding of (17, 9, 5) cyclic code
This crate provides routines for encoding and decoding the cyclic code used by DMR and P25.
Usage
This crate can be used through cargo by
adding it as a dependency in Cargo.toml
:
[dependencies]
cai_cyclic = "0.1.0"
and importing it in the crate root:
extern crate cai_cyclic;
lib.rs
:
Encoding and decoding of the base (17, 9, 5) cyclic code used by DMR and P25.
The generator polynomial for the base code is given by
g(x) = x8 + x5 + x4 + x3 + 1
It can detect up to 4 errors or correct up to 2 errors.
DMR "quadrature residue" code
The DMR air interface extends this code to (18, 9, 6) with an extra parity check bit
in the LSB, then shortens it to (16, 7, 6) by deleting two MSB data bits. The extra
parity bit is computed over the data bits using the mask 1010111
.
P25 "shortened cyclic" code
The P25 air interface shortens this code to (16, 8, 5) by deleting the MSB data bit.
References
The decoding algorithm is based on the algorithm described in Lin and Costello's Error Control Coding (1983) and Roman's Coding and Information Theory (1992), p345.
Dependencies
~160KB