summaryrefslogtreecommitdiff
path: root/gr-fec/grc/variable_ldpc_encoder_G.block.yml
diff options
context:
space:
mode:
Diffstat (limited to 'gr-fec/grc/variable_ldpc_encoder_G.block.yml')
-rw-r--r--gr-fec/grc/variable_ldpc_encoder_G.block.yml42
1 files changed, 42 insertions, 0 deletions
diff --git a/gr-fec/grc/variable_ldpc_encoder_G.block.yml b/gr-fec/grc/variable_ldpc_encoder_G.block.yml
new file mode 100644
index 0000000000..f35f473705
--- /dev/null
+++ b/gr-fec/grc/variable_ldpc_encoder_G.block.yml
@@ -0,0 +1,42 @@
+id: variable_ldpc_encoder_G_def
+label: LDPC Encoder Definition (via Generator)
+
+parameters:
+- id: value
+ label: Ignore Me
+ dtype: raw
+ default: '"ok"'
+ hide: all
+- id: ndim
+ label: Parallelism
+ dtype: enum
+ options: ['0', '1', '2']
+- id: dim1
+ label: Dimension 1
+ dtype: int
+ default: '1'
+ hide: ${ ('none' if (int(ndim) >= 1) else 'all') }
+- id: dim2
+ label: Dimension 2
+ dtype: int
+ default: '1'
+ hide: ${ ('none' if (int(ndim) >= 2) else 'all') }
+- id: G
+ label: LDPC Generator Matrix
+ dtype: raw
+value: ${ value }
+
+templates:
+ imports: from gnuradio import fec
+ var_make: "\n% if int(ndim)==0 #:\nself.${id} = ${id} = fec.ldpc_gen_mtrx_encoder_make(${G})\n\
+ % elif int(ndim)==1 #:\nself.${id} = ${id} = map((lambda a: fec.ldpc_gen_mtrx_encoder_make(${G})),\
+ \ range(0,${dim1})) \n% else:\nself.${id} = ${id} = map((lambda b: map((lambda\
+ \ a: fec.ldpc_gen_mtrx_encoder_make(${G})), range(0,${dim2}))), range(0,${dim1}))\
+ \ \n% endif"
+
+documentation: |-
+ Given a generator matrix in systematic form, G = [I|P], where I is the identity matrix and P is the parity submatrix, the information word s is encoded into a codeword x via:
+
+ x = G'*s
+
+file_format: 1