# Convolutional Code output does not match polynomial

**URL:** <https://www.ruby-forum.com/t/convolutional-code-output-does-not-match-polynomial/243201>\
**Category:** GNU Radio\
**Created:** [September 1, 2015, 11:56am UTC](https://www.ruby-forum.com/t/convolutional-code-output-does-not-match-polynomial/243201 "2015-09-01T11:56:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [September 1, 2015, 11:56am UTC](https://www.ruby-forum.com/t/convolutional-code-output-does-not-match-polynomial/243201/1 "2015-09-01T11:56:29Z")

</div>

I am trying channel coding in gnuradio. I am using convolutional encoder  
with K=7 and R=1/2 with polynomials [109, 79] (default). However I am  
not  
getting the expected result. I input a known bit sequence, single frame  
using head block, and observe the output of the encoder using file sink.  
The output I think is not correct according to the given polynomials.  
Input  
bit stream is

> **[00 00 00 00 00 00 00 00 01 00 00 00 01 00 01 01 00 00 01 01 01 01 01 00 01 00...](https://pastebin.com/thsYtLFG)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

I am getting this output

> **[00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 00 01 01 01 01 01 01 01...](https://pastebin.com/P42QNjiE)**
>
> Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

However, I am expecting (in hex)

00 00 E3 32 63 D7 4B FA D3 …

I have attached the flowgraph I am using for this purpose. I did a dry  
run  
by drawing a diagram of the encoder and inputing initial two bytes.  
Diagram of the encoder is also attached. I also used MATLAB script to  
test  
and found that my dry run output matches with MATLAB but not with  
Gnuradio  
output. I also played with the endianness but could not get the desired  
result. Maybe I am doing something wrong in configuring the encoder?

Also another thing I noticed is that in QA codes of gr-fec I found

import fec\_swig as fec  
import blocks\_swig as blocks

I think this should be

from gnuradio import fec, blocks

Am I right? I am using gnuradio 3.7.8.

---

<div class="post-metadata">

**Author:** ![bob\_wole](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/b4bc9f/32.png) [@bob\_wole](https://www.ruby-forum.com/u/bob_wole)\
**Post date:** [September 8, 2015, 8:14am UTC](https://www.ruby-forum.com/t/convolutional-code-output-does-not-match-polynomial/243201/2 "2015-09-08T08:14:55Z")

</div>

On Tue, Sep 1, 2015 at 2:55 PM, bob wole [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> and found that my dry run output matches with MATLAB but not with Gnuradio
> 
> from gnuradio import fec, blocks
> 
> Am I right? I am using gnuradio 3.7.8.
> 
> –  
> Bob

I am still waiting to get a reply on this. Anyone else verified the  
output  
of the convolutional encoder?
