1- # Authors: Veeresh Taranalli <veeresht@gmail.com>
1+ # Authors: Veeresh Taranalli <veeresht@gmail.com>
22# License: BSD 3-Clause
33
44""" Algorithms for Convolutional Codes """
@@ -545,16 +545,19 @@ def viterbi_decode(coded_bits, trellis, tb_depth=None, decoding_type='hard'):
545545 return decoded_bits [0 :len (decoded_bits )- tb_depth - 1 ]
546546
547547def puncturing (message , punct_vec ):
548- '''
548+ """
549549 Applying of the punctured procedure.
550550 Parameters
551551 ----------
552- message: input message {0,1}
553- punct_vec: puncturing vector {0,1}
552+ message : 1D ndarray
553+ Input message {0,1} bit array.
554+ punct_vec : 1D ndarray
555+ Puncturing vector {0,1} bit array.
554556 Returns
555557 -------
556- punctured: output punctured vector {0,1}
557- '''
558+ punctured : 1D ndarray
559+ Output punctured vector {0,1} bit array.
560+ """
558561 shift = 0
559562 N = len (punct_vec )
560563 punctured = []
@@ -566,17 +569,21 @@ def puncturing(message, punct_vec):
566569 return np .array (punctured )
567570
568571def depuncturing (punctured , punct_vec , shouldbe ):
569- '''
572+ """
570573 Applying of the inserting zeros procedure.
571574 Parameters
572575 ----------
573- punctured: input punctured message {0,1}
574- punct_vec: puncturing vector {0,1}
575- shouldbe: length of the initial message (before puncturing)
576+ punctured : 1D ndarray
577+ Input punctured message {0,1} bit array.
578+ punct_vec : 1D ndarray
579+ Puncturing vector {0,1} bit array.
580+ shouldbe : int
581+ Length of the initial message (before puncturing).
576582 Returns
577583 -------
578- depunctured: output vector {0,1}
579- '''
584+ depunctured : 1D ndarray
585+ Output vector {0,1} bit array.
586+ """
580587 shift = 0
581588 shift2 = 0
582589 N = len (punct_vec )
0 commit comments