-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbch15_11.py
More file actions
25 lines (17 loc) · 718 Bytes
/
bch15_11.py
File metadata and controls
25 lines (17 loc) · 718 Bytes
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
import bch_utils
class BCH15_11:
def __init__(self):
self.n = 15
self.k = 11
self.t = 1
self.generator = [1, 0, 0, 1, 1]
def encode(self, data, output="codeword"):
return bch_utils.encode(data, self.generator, self.n, self.k, output=output)
def validation_encode(self, data, output="codeword"):
return bch_utils.validation_encode(data, self.n, self.k, output=output)
def decode(self, codeword):
return bch_utils.decode(codeword, self.generator, self.t)
def validation_decode(self, codeword):
return bch_utils.validation_decode(codeword, self.n, self.k)
if __name__ == "__main__":
bch_utils.run_bch_interaction(BCH15_11())