<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Modulo-N_code</id>
	<title>Modulo-N code - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Modulo-N_code"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Modulo-N_code&amp;action=history"/>
	<updated>2026-04-30T14:57:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Modulo-N_code&amp;diff=2874072&amp;oldid=prev</id>
		<title>imported&gt;PragyaanRover at 13:07, 11 December 2024</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Modulo-N_code&amp;diff=2874072&amp;oldid=prev"/>
		<updated>2024-12-11T13:07:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Lossy Compression Algorithm}}&lt;br /&gt;
{{DISPLAYTITLE:Modulo-&amp;#039;&amp;#039;N&amp;#039;&amp;#039; code}}&lt;br /&gt;
{{Unreferenced|date=December 2009}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Modulo-&amp;#039;&amp;#039;N&amp;#039;&amp;#039; code&amp;#039;&amp;#039;&amp;#039; is a [[lossy compression]] algorithm used to compress [[correlated]] data sources using [[modular arithmetic]].&lt;br /&gt;
&lt;br /&gt;
==Compression==&lt;br /&gt;
When applied to two nodes in a [[computer networking|network]] whose data are in close range of each other modulo-&amp;#039;&amp;#039;N&amp;#039;&amp;#039; code requires one node (say odd) to send the coded data value as the raw data &amp;lt;math&amp;gt;M_o = D_o&amp;lt;/math&amp;gt;; the even node is required to send the coded data as the &amp;lt;math&amp;gt; M_e = D_e \bmod N &amp;lt;/math&amp;gt;. Hence the name modulo-&amp;#039;&amp;#039;N&amp;#039;&amp;#039; code.&lt;br /&gt;
&lt;br /&gt;
Since at least &amp;lt;math&amp;gt;\log_2 K&amp;lt;/math&amp;gt; bits are required to represent a number &amp;#039;&amp;#039;K&amp;#039;&amp;#039; in binary, the modulo coded data of the two nodes requires &amp;lt;math&amp;gt;\log_2 M_o + \log_2 M_e&amp;lt;/math&amp;gt; bits. As we can generally expect &amp;lt;math&amp;gt;\log_2 M_e \le \log_2 M_o&amp;lt;/math&amp;gt; always, because &amp;lt;math&amp;gt;M_e \le N&amp;lt;/math&amp;gt;. This is how compression is achieved.&lt;br /&gt;
&lt;br /&gt;
A compression ratio achieved is &amp;lt;math&amp;gt;\text{C.R.} = \frac{\log_2 M_o + \log_2 M_e}{2\log_2 M_o}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Decompression==&lt;br /&gt;
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 &amp;#039;&amp;#039;assumption&amp;#039;&amp;#039; that it must be close to the data from the odd node. Hence the decoding algorithm retrieves even node data as&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;\operatorname{CLOSEST}(M_o,N.k+ M_e).&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The decoder essentially finds the closest match to &amp;lt;math&amp;gt;M_o \simeq N.k + M_e&amp;lt;/math&amp;gt; and the decoded value is declared as &amp;lt;math&amp;gt;N.k + M_e&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
For a mod-8 code, we have &lt;br /&gt;
&amp;#039;&amp;#039;Encoder&amp;#039;&amp;#039;&lt;br /&gt;
 D_o=43,D_e=47&lt;br /&gt;
 M_o=43,M_e=47 mod(8) = 7,&lt;br /&gt;
 &lt;br /&gt;
&amp;#039;&amp;#039;Decoder&amp;#039;&amp;#039;&lt;br /&gt;
  M_o=43,M_e=47 mod(8) = 7,&lt;br /&gt;
  D_o=43,D_e=CLOSEST(43,8⋅k + 7)&lt;br /&gt;
  &amp;lt;math&amp;gt; 43 \simeq 8 \cdot 5 + 7&amp;lt;/math&amp;gt;&lt;br /&gt;
  D_o=43,D_e=47&lt;br /&gt;
&lt;br /&gt;
Modulo-&amp;#039;&amp;#039;N&amp;#039;&amp;#039; decoding is similar to [[phase unwrapping]] and has the same limitation: If the difference from one node to the next is more than &amp;#039;&amp;#039;N&amp;#039;&amp;#039;/2 (if the phase changes from one sample to the next more than &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt;), then decoding leads to an incorrect value.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[DISCUS]] is a more sophisticated technique for compressing correlated data sources.&lt;br /&gt;
* [[Delta encoding]] is a related algorithm used in lossless compression algorithms designed for correlated data sources.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Modulo-N Code}}&lt;br /&gt;
[[Category:Information theory]]&lt;br /&gt;
[[Category:Data compression]]&lt;br /&gt;
[[Category:Wireless sensor network]]&lt;/div&gt;</summary>
		<author><name>imported&gt;PragyaanRover</name></author>
	</entry>
</feed>