# CCSDS 27 Encode/Decode

**URL:** <https://www.ruby-forum.com/t/ccsds-27-encode-decode/160196>\
**Category:** GNU Radio\
**Created:** [February 12, 2009, 8:30pm UTC](https://www.ruby-forum.com/t/ccsds-27-encode-decode/160196 "2009-02-12T20:30:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcus\_DSLeech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/74df32/32.png) [@Marcus\_DSLeech](https://www.ruby-forum.com/u/Marcus_DSLeech)\
**Post date:** [February 12, 2009, 8:30pm UTC](https://www.ruby-forum.com/t/ccsds-27-encode-decode/160196/1 "2009-02-12T20:30:39Z")

</div>

I’m looking at building a quick prototype narrowband QAM16 transceiver  
with error-correction. I’m looking at the CCSDS 27  
blocks, and the encode _looks_ to me like it takes bytes in, and bytes  
out.

But the decoder is different.

Can somebody “clue me up” about how to use them?

–  
Marcus L.  
Principal Investigator, Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org/)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![Marcus\_DSLeech](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/74df32/32.png) [@Marcus\_DSLeech](https://www.ruby-forum.com/u/Marcus_DSLeech)\
**Post date:** [February 12, 2009, 9:13pm UTC](https://www.ruby-forum.com/t/ccsds-27-encode-decode/160196/2 "2009-02-12T21:13:03Z")

</div>

On Thu, 2009-02-12 at 14:29 -0500, Marcus D. Leech wrote:

> I’m looking at building a quick prototype narrowband QAM16 transceiver  
> with error-correction. I’m looking at the CCSDS 27  
> blocks, and the encode _looks_ to me like it takes bytes in, and bytes  
> out.
> 
> But the decoder is different.

Yes, the encoder takes packed bits (bytes) and outputs unpacked bits  
(bytes, with LSBs carrying the interleaved G0 and G1 code bits). So one  
byte in creates 16 bytes out.

The decoder takes floating point soft symbols in the range of 0-255, and  
outputs packed bits. It consumes 16 bytes of demodulator output data  
and outputs 1 byte of packed bits.

There reason for these very specific types is that these blocks do  
nothing but wrap GNU Radio blocks around a version of Phil Karn’s libfec  
library R1/2, K=7 encoder and Viterbi decoder, which only consume and  
produce these types. The one place I successfully used these was in a  
non-packetized, continuously transmitting, BPSK satellite downlink.  
These blocks aren’t suitable for packetized transmission as they don’t  
provide any means of resetting the Viterbi decoder at the start of each  
packet.

I recommend you look at CMU’s SPIRAL project for machine generated  
Viterbi decoders that might be easier to wrap and/or call directly to do  
what you need. I wasn’t aware of this when I did the above, but my the  
next generation of that project will use it.

Johnathan
