veeresht / CommPy

Digital Communication with Python
http://veeresht.github.com/CommPy
BSD 3-Clause "New" or "Revised" License
538 stars 176 forks source link

confused about turbo.py #95

Open silentsaber opened 3 years ago

silentsaber commented 3 years ago

I use parameters in LTE 36.212 to realize a turbo code. Then I find in line 47 (turbo.py):

stream = conv_encode(msg_bits, trellis1, 'rsc')
sys_stream = stream[::2]
non_sys_stream_1 = stream[1::2]

interlv_msg_bits = interleaver.interlv(sys_stream)
puncture_matrix = array([[0, 1]])
non_sys_stream_2 = conv_encode(interlv_msg_bits, trellis2, 'rsc', puncture_matrix)

Here 'rsc' is not the right parameter in conv_encode, since the third parameter is termination(selected from {'term','cont'}). And 'rsc' should be set in Trellis like this:

memory = np.array([3])
g_matrix = np.array([[1,13]])
feedback = 11
trellis = cc.Trellis(memory, g_matrix, feedback, code_type='rsc')

So am I right? (Does there exist some wrong in turbo.py?)

haixiongli commented 2 years ago

Hello, have you solved this problem, I encountered difficulties when using turbo for encoding and decoding. hope you can help me. https://github.com/veeresht/CommPy/issues/112

silentsaber commented 2 years ago

你好,这个问题你解决了吗,我在使用turbo进行编码和解码的时候遇到了困难。希望您能够帮助我。 #112

I haven't solved it. I used lteTurboEncode in Matlab ltetoolbox instead. For using matlab function in python code, you can try import matlab.engine