From ad0391b341d7350761effe3b05798b0790d09d9f Mon Sep 17 00:00:00 2001 From: Wojciech Kaczmarski <44336093+sp5wwp@users.noreply.github.com> Date: Wed, 23 Feb 2022 19:39:54 +0100 Subject: [PATCH] matlab code for golay matrices --- docs/physical_layer.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/physical_layer.rst b/docs/physical_layer.rst index 2b0211b..580e9d7 100644 --- a/docs/physical_layer.rst +++ b/docs/physical_layer.rst @@ -203,6 +203,19 @@ The output of the Golay encoder is shown in the table below. Four of these 24-bit blocks are used to reconstruct the LSF. +Sample MATLAB/Octave code snippet for generating *G* and *H* matrices is shown below. + +.. code-block:: matlab + :caption: Golay(24,12) matrices generator + + P = hex2poly('0xC75'); + [H,G] = cyclgen(23, P); + + G_P = G(1:12, 1:11); + I_K = eye(12); + G = [I_K G_P P.']; + H = [transpose([G_P P.']) I_K]; + Convolutional encoder ~~~~~~~~~~~~~~~~~~~~~