Modulo-''N'' code is a
lossy compression
In information technology, lossy compression or irreversible compression is the class of data compression methods that uses inexact approximations and partial data discarding to represent the content. These techniques are used to reduce data size ...
algorithm used to compress
correlated
In statistics, correlation or dependence is any statistical relationship, whether causal or not, between two random variables or bivariate data. Although in the broadest sense, "correlation" may indicate any type of association, in statisti ...
data sources using
modular arithmetic
In mathematics, modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" when reaching a certain value, called the modulus. The modern approach to modular arithmetic was developed by Carl Friedrich Gauss in his bo ...
.
Compression
When applied to two nodes in a
network
Network, networking and networked may refer to:
Science and technology
* Network theory, the study of graphs as a representation of relations between discrete objects
* Network science, an academic field that studies complex networks
Mathematics ...
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
; the even node is required to send the coded data as the
. Hence the name modulo-''N'' code.
Since at least
bits are required to represent a number ''K'' in binary, the modulo coded data of the two nodes requires
bits. As we can generally expect
always, because
. This is the how compression is achieved.
A compression ratio achieved is
Decompression
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
:
The decoder essentially finds the closest match to
and the decoded value is declared as
Example
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)
D_o=43,D_e=47
Modulo-''N'' decoding is similar to
phase unwrapping
Instantaneous phase and frequency are important concepts in signal processing that occur in the context of the representation and analysis of time-varying functions. The instantaneous phase (also known as local phase or simply phase) of a ''comple ...
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
), then decoding leads to an incorrect value.
See also
*
DISCUS is a more sophisticated technique for compressing correlated data sources.
*
Delta encoding
Delta encoding is a way of storing or transmitting data in the form of '' differences'' (deltas) between sequential data rather than complete files; more generally this is known as data differencing. Delta encoding is sometimes called delta compr ...
is a related algorithm used in lossless compression algorithms designed for correlated data sources.
{{DEFAULTSORT:Modulo-N Code
Information theory
Data compression
Wireless sensor network