UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


code:python_reedsolomon

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
code:python_reedsolomon [2008/02/21 06:18] laurencebcode:python_reedsolomon [2008/07/19 23:33] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +===== Main code (uses a c library for decoding, as the tx only has to encode, and we're assuming running binaries on the ground is easy) =====
 +
 +The decoder can be found at [[http://hathawaymix.org/Software/ReedSolomon|hathawaymix.org]]
 +
 <code python> <code python>
 #!/usr/bin/python #!/usr/bin/python
Line 138: Line 142:
  
 </code> </code>
 +
 +===== Usage example =====
 +
 +<code python>
 +import reed_solomon
 +reed_solomon.setup_rs()
 +s=reed_solomon.encode_string("hello world my name is Laurence and I am your supreme ruler !!!111!!111!")
 +print s
 +t=s[0:9]+"df"+s[11:len(s)]
 +d = reed_solomon.decode_string(t,[])
 +print d[0]
 +print "Errors at: ",d[1] 
 +
 +</code>
 +
 +===== produces: =====
 +
 +<code>
 +$ python testcode.py
 +hello world my name is Laurence and I am your supreme ruler !!!111!!111! dJ{,wOWOIUv?M
 +         ]'tkN{edkM98
 +hello world my name is Laurence and I am your supreme ruler !!!111!!111!
 +Errors at:  [84, 85]
 +</code>
 +
code/python_reedsolomon.1203574689.txt.gz · Last modified: 2008/07/19 23:31 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki