# Reed-Solomon en/decoder

**URL:** <https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510>\
**Category:** GNU Radio\
**Created:** [March 10, 2015, 8:32am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510 "2015-03-10T08:32:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [March 10, 2015, 8:32am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/1 "2015-03-10T08:32:30Z")

</div>

I need Reed-Solomon encoder and decoder to perform RS(15, 2/4/7/11).

I found that there are RS codes in  
_gr-fec/lib/reed-solomon._  
But, I couldn’t find some grc blocks implementing the library codes.  
In addition, I don’t see _work()_ function which is generally  
implemented  
in other blocks.

On the other hand, I found _ccsds_ keyword in \*decode\_rs\_ccsds.c \*and  
_encode\_rs\_ccsds.c_  
and I can find that keyword in some grc blocks,  
_fec\_encode\_ccsds, fec\_decode\_ccsds, ccsds\_encoder\_def._  
But, I don’t think such blocks can do what I want.

Are there encoder and decoder which have been already implemented?  
Do I not understand how to use RS blocks which have been already  
implemented?  
Or should I implement them?

Regards,  
Jeon.

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 10, 2015, 8:38am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/2 "2015-03-10T08:38:20Z")

</div>

Take a look in:

gnuradio/gr-dtv/lib/atsc/atsc\_rs\_encoder\_impl.cc  
gnuradio/gr-dtv/lib/atsc/atsc\_rs\_decoder\_impl.cc

Ron

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 10, 2015, 3:12pm UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/3 "2015-03-10T15:12:34Z")

</div>

On Tue, Mar 10, 2015 at 3:35 AM, Ron E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need Reed-Solomon encoder and decoder to perform RS(15, 2/4/7/11).  
> \*fec\_encode\_ccsds, fec\_decode\_ccsds, ccsds\_encoder\_def. \*

What Ron points out will probably get you going fastest. The FEC API  
doesn’t yet fully support the structure needed for RS coding schemes,  
though it’s on the to-do list.

Tom

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 11, 2015, 5:25am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/4 "2015-03-11T05:25:11Z")

</div>

Thanks, Ron and Tom.

But I couldn’t find atsc\_rs\_encoder\_impl.cc. Only I can find decoder.  
I’m using version 3.7.6.1

One thing is, I can find rs en/decoder in gnuradio/gr-atsc.  
Are these irrelevant with gr-dtv?

When I look into repository, gr-dtv/lib/ has both encoder and decoder  
Currently, I am installing the newer version.

Reagrds,  
Jeon.

2015-03-10 23:10 GMT+09:00 Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 11, 2015, 6:44am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/5 "2015-03-11T06:44:21Z")

</div>

HI Jeon, you might try the RS encoder/decoder in my gr-dvbt  
implementation. There are grc blocks that you can use directly after  
installing gr-dvbt.

> **[GitHub - BogdanDIA/gr-dvbt: DVB-T implementation in gnuradio](https://github.com/BogdanDIA/gr-dvbt)**
>
> DVB-T implementation in gnuradio. Contribute to BogdanDIA/gr-dvbt development by creating an account on GitHub.

Regards,Bogdan

```
 On Tuesday, March 10, 2015 9:33 AM, Jeon 

```

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

I need Reed-Solomon encoder and decoder to perform RS(15, 2/4/7/11).

I found that there are RS codes in gr-fec/lib/reed-solomon.  
But, I couldn’t find some grc blocks implementing the library codes.  
In addition, I don’t see work() function which is generally implemented  
in other blocks.

On the other hand, I found ccsds keyword in decode\_rs\_ccsds.c and  
encode\_rs\_ccsds.c  
and I can find that keyword in some grc blocks, fec\_encode\_ccsds,  
fec\_decode\_ccsds, ccsds\_encoder\_def.  
But, I don’t think such blocks can do what I want.

Are there encoder and decoder which have been already implemented?  
Do I not understand how to use RS blocks which have been already  
implemented?  
Or should I implement them?

Regards,  
Jeon.

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 11, 2015, 11:18am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/6 "2015-03-11T11:18:49Z")

</div>

Thank you all Bogdan and Ron.

I wil try your codes.

It’s not important, but one general question.  
Why do the most of Reed-Solomon implentations exist under digital TV or  
broadcasting?  
I can guess that DVB is the typical application of RS.  
But, how about other wireless communications?  
I can see a list of wireless applications with some googling. (I’m not  
sure  
they are standards or just proposal)

Regards,  
Jeon.

2015-03-11 14:42 GMT+09:00 Bogdan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 11, 2015, 6:30am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/7 "2015-03-11T06:30:23Z")

</div>

Yes, the gr-dtv ATSC RS encoder was added in a recent commit after  
the 3.7.6.1 release. Sorry, I forgot to mention that.

The ATSC code in gr-dtv is a re-write of the code in gr-atsc. The  
functionality of the RS encoder and decoder is the same,  
so for those blocks it’s just a clean-up of the code.

I have another slightly different implementation of the RS encoder  
in an out of tree repository.

> **[GitHub - drmpeg/gr-dvbs: A DVB-S transmitter for GNU Radio](https://github.com/drmpeg/gr-dvbs)**
>
> A DVB-S transmitter for GNU Radio. Contribute to drmpeg/gr-dvbs development by creating an account on GitHub.

Specifically:

> <https://github.com/drmpeg/gr-dvbs/blob/master/lib/reed_solomon_enc_bb_impl.cc>

It uses byte input and output rather than the ATSC specific structures  
and is implemented as a general block instead of a sync block. It also  
implements a (204,188) encoder versus a (207,187).

Ron

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 11, 2015, 12:54pm UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/8 "2015-03-11T12:54:27Z")

</div>

Reed-Solomon codes are a form of FEC (Forward Error Correction).  
They make sense for communications channels that don’t have  
a way for the receiver to ask for a re-transmission (such as  
broadcasting).

Reed-Solomon codes are used on many digital formats. One of  
the first uses of RS coding were the Voyager 1 and 2 spacecraft  
launched in 1977.

Then came audio CD in 1980 (I bought my first CD player in 1983).  
It uses a RS(28,24) and a RS(32,28) code.

Other uses are DSL and Wimax (although you don’t see much Wimax  
these days).

In current standards, RS codes are now being replaced with  
more complex BCH (Bose, Chaudhuri, Hocquenghem) codes.

Ron

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 11, 2015, 12:58pm UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/9 "2015-03-11T12:58:42Z")

</div>

Hi Jeon,  
I don’t think RS is typical only for DVB apps. RS is indeed used in DTV  
but it has been used in many wireless applications before too as being  
simple to implement and having many advantages as an block coder/decoder  
together with convolutional one. One advantage of RS is its capability  
of recovering errors that appear in bursts. This is why it has been used  
also in harddrives and barcode readers where errors may appear in bursts  
and entire portion of the data could be missing entirely.  
Bogdan

```
 On Wednesday, March 11, 2015 12:16 PM, Jeon 

```

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

Thank you all Bogdan and Ron.

I wil try your codes.

It’s not important, but one general question.  
Why do the most of Reed-Solomon implentations exist under digital TV or  
broadcasting?  
I can guess that DVB is the typical application of RS.  
But, how about other wireless communications?  
I can see a list of wireless applications with some googling. (I’m not  
sure they are standards or just proposal)

Regards,  
Jeon.

2015-03-11 14:42 GMT+09:00 Bogdan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

HI Jeon, you might try the RS encoder/decoder in my gr-dvbt  
implementation. There are grc blocks that you can use directly after  
installing gr-dvbt.

> **[GitHub - BogdanDIA/gr-dvbt: DVB-T implementation in gnuradio](https://github.com/BogdanDIA/gr-dvbt)**
>
> DVB-T implementation in gnuradio. Contribute to BogdanDIA/gr-dvbt development by creating an account on GitHub.

Regards,Bogdan

```
 On Tuesday, March 10, 2015 9:33 AM, Jeon 

```

[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

I need Reed-Solomon encoder and decoder to perform RS(15, 2/4/7/11).

I found that there are RS codes in gr-fec/lib/reed-solomon.  
But, I couldn’t find some grc blocks implementing the library codes.  
In addition, I don’t see work() function which is generally implemented  
in other blocks.

On the other hand, I found ccsds keyword in decode\_rs\_ccsds.c and  
encode\_rs\_ccsds.c  
and I can find that keyword in some grc blocks, fec\_encode\_ccsds,  
fec\_decode\_ccsds, ccsds\_encoder\_def.  
But, I don’t think such blocks can do what I want.

Are there encoder and decoder which have been already implemented?  
Do I not understand how to use RS blocks which have been already  
implemented?  
Or should I implement them?

Regards,  
Jeon.

* * *

Discuss-gnuradio mailing list  
removed\_email\_address@domain.invalid  
[https://lists.gnu.org/mailman/listinfo/discuss-gnuradio](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

---

<div class="post-metadata">

**Author:** ![Jeon](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e8c25b/32.png) [@Jeon](https://www.ruby-forum.com/u/Jeon)\
**Post date:** [March 12, 2015, 7:16am UTC](https://www.ruby-forum.com/t/reed-solomon-en-decoder/234510/10 "2015-03-12T07:16:45Z")

</div>

Dear Bogdan,  
Thanks again for your answers.

I am currently looking into your gr-dvbt for RS and CC.  
I have a couple of questions as I am not familiar with GNU Radio or Cpp.

First, is it possible to use reed\_solomon class in your gr-dvbt in my  
codes  
which will be written outside from gr-dvbt?  
I think it is possible since you’ve included \<gnuradio/io\_signature.h\>  
which is outside from gr-dvbt. And I can do something very similar to  
it.  
But, will it requires some additional things. For example, should I tell  
something to CMakeLists.txt?

Second question is, convolutional interleaver and deinterleaver are same  
as  
pure convolutional encoder and decoder?  
Or are they specially designed for DVB-T?

Regards,  
Jeon.

2015-03-11 14:42 GMT+09:00 Bogdan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
