# Changing code rate (FEC)

**URL:** <https://www.ruby-forum.com/t/changing-code-rate-fec/243158>\
**Category:** GNU Radio\
**Created:** [August 27, 2015, 2:07am UTC](https://www.ruby-forum.com/t/changing-code-rate-fec/243158 "2015-08-27T02:07:01Z")\
**Posts on this page:** 3\
**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:** [August 27, 2015, 2:07am UTC](https://www.ruby-forum.com/t/changing-code-rate-fec/243158/1 "2015-08-27T02:07:01Z")

</div>

Hi,

I would like to be able to change the code rate with PSK and QAM  
modulations (e.g QPSK 3/4, 16QAM 1/2). I was thinking of using a FEC  
encoder/decoder as you can see in the attached files but it doesn’t  
really work. I’m trying to send a video file and I would like to be able  
to read the received video. What can I do to make it work or is there  
another way to change the coding rate?

Thanks

---

<div class="post-metadata">

**Author:** ![likumahuwa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@likumahuwa](https://www.ruby-forum.com/u/likumahuwa)\
**Post date:** [August 31, 2015, 7:42pm UTC](https://www.ruby-forum.com/t/changing-code-rate-fec/243158/2 "2015-08-31T19:42:03Z")

</div>

On Wed, Aug 26, 2015 at 8:07 PM, Eric E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Attachments:  
> [http://www.ruby-forum.com/attachment/11055/fec1.jpg](http://www.ruby-forum.com/attachment/11055/fec1.jpg)  
> [http://www.ruby-forum.com/attachment/11056/fec2.jpg](http://www.ruby-forum.com/attachment/11056/fec2.jpg)  
> [http://www.ruby-forum.com/attachment/11057/fec3.jpg](http://www.ruby-forum.com/attachment/11057/fec3.jpg)

Dynamics here haven’t been tested much. A lot of the codes defined now  
are  
single-purpose because there’s a lot of initialization and setup that  
occurs that might interfere with the running of things. It’d be  
interesting  
to see where different codes can be modified live. But for the CC  
encoder/decoder you’re using, look at the man page:

> **[GNU Radio Manual and C++ API Reference: gr::fec::code::cc\_decoder Class...](https://www.gnuradio.org/doc/doxygen/classgr_1_1fec_1_1code_1_1cc__decoder.html)**

That code is highly optimized to do that one rate and K factor that it  
does.

You might have better luck making multiple variables and switching them  
in  
and out of the FEC extended encoder/decoder blocks. I feel we might have  
to  
do something to invalidate any data due to changes in cipher/plain text,  
though.

Tom

---

<div class="post-metadata">

**Author:** ![likumahuwa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@likumahuwa](https://www.ruby-forum.com/u/likumahuwa)\
**Post date:** [August 31, 2015, 8:31pm UTC](https://www.ruby-forum.com/t/changing-code-rate-fec/243158/3 "2015-08-31T20:31:15Z")

</div>

Thank you for your reply. So from what I understand, code rates other  
than the default one are untested and the code rate is difficult to  
change? Also, I still can’t read the video at the output of the decoder.  
I used the highly optimized default values (R=2, K=7, poly: 79, 109) and  
the output of the decoder is still different that my input signal  
(before the encoder) so I’m unable to read my output video. Is there  
something that I’m missing? Thanks.
