Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run turbo_encode #31

Open
sankalpmittal1911-BitSian opened this issue May 16, 2019 · 2 comments
Open

Trying to run turbo_encode #31

sankalpmittal1911-BitSian opened this issue May 16, 2019 · 2 comments

Comments

@sankalpmittal1911-BitSian
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.

@jeichenhofer
Copy link

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
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants