# Update Channel coding toolbox to Gnuradio 3.7.0

**URL:** <https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591>\
**Category:** GNU Radio\
**Created:** [June 25, 2014, 9:56am UTC](https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591 "2014-06-25T09:56:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason\_sam](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/7993a0/32.png) [@jason\_sam](https://www.ruby-forum.com/u/jason_sam)\
**Post date:** [June 25, 2014, 9:56am UTC](https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591/1 "2014-06-25T09:56:42Z")

</div>

Deal all,

Does anyone update the Channel Coding  
([https://www.cgran.org/wiki/chancoding](https://www.cgran.org/wiki/chancoding))  
toolbox so that it can work in Gnuradio 3.7.0?

I did try to install this toolbox. The installation was done but it do  
not  
appear in Gnuradio Companion interface.

Thanks,  
Hoang

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [June 25, 2014, 10:25am UTC](https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591/2 "2014-06-25T10:25:15Z")

</div>

Hi Hoang,

GNU Radio 3.7 has the gr-fec framework, and recent updates brought more  
performance and some features, so if that matches your use case, go  
ahead and try it out!

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [June 25, 2014, 11:28am UTC](https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591/3 "2014-06-25T11:28:18Z")

</div>

Thank you Marcus.

I’ve checked out gr-fec. The problem is that Decode CCSDS 27 block takes  
float input while my data to feed it is in byte.

On Wed, Jun 25, 2014 at 3:23 PM, Marcus Müller  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [June 25, 2014, 3:56pm UTC](https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591/4 "2014-06-25T15:56:36Z")

</div>

On Wed, Jun 25, 2014 at 5:27 AM, Hoang Ngo K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thank you Marcus.
> 
> I’ve checked out gr-fec. The problem is that Decode CCSDS 27 block takes  
> float input while my data to feed it is in byte.

If you’ve built the documentation of the latest version of GNU Radio,  
look  
at the Forward Error Correction page for a description of the new FEC  
API.  
It’s designed with exactly your issue in mind. You would write a new  
deployment for the FEC of your choice to handle the data type  
conversions.  
In fact, the current CC decoder actually takes in bytes but the  
deployment  
takes in floats. The floats are intended to be soft symbols, and the  
decoder deployment converts from the soft symbol floats to a quantized  
soft  
symbol byte that floats at a particular level.

Tom

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [June 28, 2014, 5:25am UTC](https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591/5 "2014-06-28T05:25:40Z")

</div>

Thank you Tom.  
I’ve modified the Decode CCSDS 27. In particular, I changed the code in  
implementation file (.cc):

Existing code:

> ```
> unsigned char sym = (unsigned char)(floor(sample));
> // printf("%li\n", *(out-1), metric);
> }
> }
> 
> d_count++;
> }
> 
> ```

My code:

> ```
> byte = in[ni];
> }
> }
> 
> ```

```
ni ++;

```

> ```
> d_count++;
> 
> ```
> 
> }

I also modify the header file, xml file. Now the new block appear in  
GRC.  
I build a flow graph (see in attachment) to test this block. When I run  
this flowgraph, I got this error:

init::console\_sink\_bb  
Traceback (most recent call last):  
File “/home/khachoang/GNU\_Radio/Test GRC/top\_block.py”, line 58, in  
  
tb = top\_block()  
File “/home/khachoang/GNU\_Radio/Test GRC/top\_block.py”, line 43, in  
**init**  
self.connect((self.fec\_encode\_ccsds\_27\_bb\_0, 0),  
(self.fec\_decode\_ccsds\_27\_bb\_0, 0))  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/top\_block.py”,  
line 130, in connect  
self.\_connect(points[i-1], points[i])  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/top\_block.py”,  
line 142, in \_connect  
dst\_block.to\_basic\_block(), dst\_port)  
File  
“/usr/local/lib/python2.7/dist-packages/gnuradio/gr/runtime\_swig.py”,  
line  
4100, in primitive\_connect  
return \_runtime\_swig.top\_block\_sptr\_primitive\_connect(self, \*args)

_ValueError: itemsize mismatch: encode\_ccsds\_27\_bb0:0 using 1,  
decode\_ccsds\_27\_bb0:0 using 4_  
Is my code correct? How could I fix this bug?

Thanks  
_,_  
Hoang

---

<div class="post-metadata">

**Author:** ![Hoang\_Ngo\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/97f17d/32.png) [@Hoang\_Ngo\_K](https://www.ruby-forum.com/u/Hoang_Ngo_K)\
**Post date:** [June 28, 2014, 4:45pm UTC](https://www.ruby-forum.com/t/update-channel-coding-toolbox-to-gnuradio-3-7-0/230591/6 "2014-06-28T16:45:07Z")

</div>

On Fri, Jun 27, 2014 at 11:24 PM, Hoang Ngo K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > ```
> > // Translate and clip [-1.0..1.0] to [28..228]
> > viterbi_butterfly2(d_viterbi_in, d_mettab, d_state0, d_state1);
> > }
> > 
> > // long metric =
> > 
> > ```
> 
> I also modify the header file, xml file. Now the new block appear in GRC.  
> self.connect((self.fec\_encode\_ccsds\_27\_bb\_0, 0),  
> return \_runtime\_swig.top\_block\_sptr\_primitive\_connect(self, \*args)
> 
> _ValueError: itemsize mismatch: encode\_ccsds\_27\_bb0:0 using 1,  
> decode\_ccsds\_27\_bb0:0 using 4_  
> Is my code correct? How could I fix this bug?
> 
> Thanks  
> _,_  
> Hoang

First, I’d say in the long run, you’re still better off looking into the  
FEC API. Right now, you’ll have to build the new manual yourself as we  
don’t have it published yet online, but the Forward Error Correction  
section in the new manual explains how you could build a deployment to  
use  
the FEC codes you need. Then, you wouldn’t have to have a patch on an  
existing block.

That having been said, the FEC API is brand new, so there’s not much  
more  
help or examples than what’s in the manual and in the code right now. So  
we  
should at least be able to get you going with where you are now.

Most likely, the problem is in the constructor of the block you’re  
editing.  
Look for the io\_signature line. You’ll see a ‘sizeof(float)’ there.  
Change  
that to ‘sizeof(char)’ and that should work for you.

Tom
