Home Online Manual
Top
Back: sysBin
Forward: syndrome
FastBack: brnoeth_lib
FastForward: System and Control theory
Up: decodegb_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.10.2.5 encode

Procedure from library decodegb.lib (see decodegb_lib).

Usage:
encode (x, g); x a row vector (message), and g a generator matrix

Return:
corresponding codeword

Example:
 
LIB "decodegb.lib";
ring r=2,x,dp;
matrix x[1][4]=1,0,1,0;
matrix g[4][7]=1,0,0,0,0,1,1,
0,1,0,0,1,0,1,
0,0,1,0,1,1,1,
0,0,0,1,1,1,0;
//encode x with the generator matrix g
print(encode(x,g));
==> 1,0,1,0,1,0,0