-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Began work on hamming codes - Implemented rudimentary version in GF(2) #490
base: release/0.3.x
Are you sure you want to change the base?
Began work on hamming codes - Implemented rudimentary version in GF(2) #490
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/0.3.x #490 +/- ##
=================================================
- Coverage 96.33% 94.89% -1.44%
=================================================
Files 46 47 +1
Lines 5842 5958 +116
=================================================
+ Hits 5628 5654 +26
- Misses 214 304 +90 ☔ View full report in Codecov by Sentry. |
Hi @mhostetter , I wanted to share my current thoughts on implementing it for prime fields Parity check matrix generation Loop over numbers from
To get the number representation I am thinking of using the Error Detection Error Correction Extended Hamming CodeParity Check Matrix Generation Error Detection Error Correction Let me know your suggestions. |
I can't vouch for the algorithm. But here's some thoughts on doing what you describe. In [1]: import numpy as np
In [2]: import galois
In [3]: q, r = 5, 3
In [4]: GF = galois.GF(q**r)
# Lists all numbers 0 to q^r - 1. You can loop through this array if you'd like
In [5]: GF.elements
Out[5]:
GF([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124],
order=5^3)
# You can take an integer representation of a field element in GF(q^r) and represent it as a r length vector over GF(q)
# This is equivalent to integer_to_poly()
In [6]: GF(85).vector()
Out[6]: GF([3, 2, 0], order=5)
# Or you can go the other way
# This is equivalent to poly_to_integer()
In [7]: GF.Vector([3, 2, 0])
Out[7]: GF(85, order=5^3) |
Hi, yea thats perfect for what I require. Thanks |
Hi @mhostetter , I have extended the Hamming class to support prime fields now. I have made a demo of its working here One catch is that the generator matrix is always systematic, not sure if somebody would want it to be non systematic... Let me know what you think about it |
Hi @mhostetter, Wanted to know if you got a chance to look at the current working demo linked in the previous comment? |
@abhishekmittal15 sorry for the delayed response. I did just look at your example notebook. It looks good to me. The API seems consistent with the APIs for the other FEC codes. |
Glad to hear that @mhostetter . I have been thinking of supporting haaming codes for extension fields too, but since I am a bit rusty in remembering its theory, I have been giving it a read from my notes and the galois docs. Meanwhile i think i will add the necessary docstrings to the functions, to update the docs. |
55704df
to
dfc8fe1
Compare
a0c03ba
to
529ba26
Compare
I'm sorry! I deleted |
Hi, I have written a working version of hamming codes in GF(2).
I will soon clean up the functions a little more and add docstrings.
Then we can discuss on implementing extended Hamming codes.
Please let me know, if you have any feedback
Thanks!!