Skip to content

Trying to run turbo_encode #31

Open
@sankalpmittal1911-BitSian

Description

import numpy as np
import commpy.channelcoding as cx
import commpy.channelcoding.convcode as cc
memory = np.array([2])
g_matrix = np.array([[5, 7]])
trellis = cc.Trellis(memory, g_matrix)
trellis.k =1 
trellis.n = 2
trellis.number_states=0
trellis.number_inputs = 0
trellis.total_memory = 0
x = np.array([1,0,1,0,1,1])
x=np.array(x);
print(cx.turbo_encode(x,trellis,trellis,cx.RandInterlv))

I get this error:

File "C:\Users\sankalp.1\AppData\Local\Programs\Python\Python37\lib\site-packages\commpy\utilities.py", line 50, in dec2bitarray
   bitarray[bit_width - i - 1] = int(binary_string[length - i - 1])
IndexError: index -1 is out of bounds for axis 0 with size 0

Can anyone help me figure out how to eliminate this error? It seems to be working fine in conv_encode.

image

Thank you.

Activity

jeichenhofer

jeichenhofer commented on Jul 7, 2020

@jeichenhofer

I am also interested in an example for constructing correct trellis objects using this interface. I haven't encountered this specific error, but I am struggling to understand the format and specification of this library's representation of the trellis. @veeresht you were able to point me in the right direction on my last question, can you provide any insight here?

BastienTr

BastienTr commented on Jul 8, 2020

@BastienTr
Collaborator

Hi @jeichenhofer,
I can't help you on turbocodes as I've never had a look to this module. However, regarding to the format and specifications of the trellis, you should have a look to conv_encode_decode example file. Be sure to use the github version as the pip version doesn't curretly have all the funtion required to run this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @jeichenhofer@BastienTr@sankalpmittal1911-BitSian

        Issue actions

          Trying to run turbo_encode · Issue #31 · veeresht/CommPy