Modulo-N code is a lossy compression algorithm used to compress correlated data sources using modular arithmetic.
When applied to two nodes in a network whose data are in close range of each other modulo-N code requires one node (say odd) to send the coded data value as the raw data
Mo=Do
Me=De\bmodN
Since at least
log2K
log2Mo+log2Me
log2Me\lelog2Mo
Me\leN
A compression ratio achieved is
C.R.=
log2Mo+log2Me | |
2log2Mo |
.
At the receiver by joint decoding we may complete the process of extracting the data and rebuilding the original values. The code from the even node is reconstructed by the assumption that it must be close to the data from the odd node. Hence the decoding algorithm retrieves even node data as
\operatorname{CLOSEST}(Mo,N.k+Me).
The decoder essentially finds the closest match to
Mo\simeqN.k+Me
N.k+Me
For a mod-8 code, we have Encoder D_o=43,D_e=47 M_o=43,M_e=47 mod(8) = 7, Decoder M_o=43,M_e=47 mod(8) = 7, D_o=43,D_e=CLOSEST(43,8⋅k + 7)
43\simeq8 ⋅ 5+7
Modulo-N decoding is similar to phase unwrapping and has the same limitation: If the difference from one node to the next is more than N/2 (if the phase changes from one sample to the next more than
\pi