GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Main page
  • Contents
  • Current events
  • Random article
  • About Wikipedia
  • Contact us
  • Help
  • Learn to edit
  • Community portal
  • Recent changes
  • Upload file
  • Special pages
  • Search
  • Donate

This view

  • Original page
  • New address

GeezerVison is showing en.wikipedia.org — Modulo-N code - Wikipedia

icon
This article relies on a single source. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Modulo-N code" – news · newspapers · books · scholar · JSTOR
(October 2025) (Learn how and when to remove this message)

Modulo-N code is a lossy compression algorithm used to compress correlated data sources using modular arithmetic.

Compression

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; the even node is required to send the coded data as the Me=DemodN. Hence the name modulo-N code.

Since at least log2K bits are required to represent a number K in binary, the modulo coded data of the two nodes requires log2Mo+log2Me bits. As we can generally expect log2Me≤log2Mo always, because Me≤N. This is how compression is achieved.[1]

A compression ratio achieved is C.R.=log2Mo+log2Me2log2Mo.

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

CLOSEST⁡(Mo,N.k+Me).

The decoder essentially finds the closest match to Mo≃N.k+Me and the decoded value is declared as N.k+Me

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)
 43≃8⋅5+7
 D_o=43,D_e=47

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 π), then decoding leads to an incorrect value.

See also

  • DISCUS is a more sophisticated technique for compressing correlated data sources.
  • Delta encoding is a related algorithm used in lossless compression algorithms designed for correlated data sources.

References

  1. ↑ Franco, Fernando (2021-08-27). "Three effective ways to create modulo n integer sequences". Franco Fernando. Retrieved 2025-09-21.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Modulo-N_code&oldid=1314884534"
Categories:
  • Information theory
  • Data compression
  • Wireless sensor network
Hidden categories:
  • Articles with short description
  • Short description matches Wikidata
  • Articles needing additional references from October 2025
  • All articles needing additional references
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.