# Verifying Turbo encoder output (was: Re: (no subject)

**URL:** <https://www.ruby-forum.com/t/verifying-turbo-encoder-output-was-re-no-subject/242430>\
**Category:** GNU Radio\
**Created:** [June 23, 2015, 6:33pm UTC](https://www.ruby-forum.com/t/verifying-turbo-encoder-output-was-re-no-subject/242430 "2015-06-23T18:33:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [June 23, 2015, 6:33pm UTC](https://www.ruby-forum.com/t/verifying-turbo-encoder-output-was-re-no-subject/242430/1 "2015-06-23T18:33:08Z")

</div>

Salija,

the notation

interleaver(666)

is one way to generate a random interleaver with a given seed (666 in  
this  
case).

The pccc block requires two FSM (finite state machine) specifications  
(one  
for each of the constituent codes)  
and an interleaver specification.  
You can give the interleaver specification either through a file or by  
letting gnuradio generate a random one.

The interleaver class (pretty straighforward) has been implemented in  
the  
files:

gr-trellis/include/trellis/gnuaradio/interleaver.h  
gr-trellis/lib/interleaver.cc

I am copying the class definition below:

* * *

/\*!  
\* \brief INTERLEAVER class  
\* \ingroup trellis\_coding\_blk  
\*/  
class TRELLIS\_API interleaver  
{  
private:  
int d\_K;  
std::vector d\_INTER;  
std::vector d\_DEINTER;

```
public:
  interleaver();
  interleaver(const interleaver & INTERLEAVER);
  interleaver(int K, const std::vector<int> & INTER);
  interleaver(const char *name);
  interleaver(int K, int seed);
  int K () const { return d_K; }
  const std::vector<int> & INTER() const { return d_INTER; }
  const std::vector<int> & DEINTER() const { return d_DEINTER; }
  void write_interleaver_txt(std::string filename);
};

```

* * *

as you can see there are 5 possible constructors:

interleaver();  
interleaver(const interleaver & INTERLEAVER);  
interleaver(int K, const std::vector & INTER);  
interleaver(const char \*name);  
interleaver(int K, int seed);

the first 2 are trivial and copy constructor,  
the third construct an interleaver from a vector with specified  
permutations and  
the fourth one from a file with specified permutations.  
The last one constructs it from a random permutation with a given seed  
(please see .cc code for details).

Let us know if you have any more questions.

Achilleas

---

<div class="post-metadata">

**Author:** ![Achilleas\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@Achilleas\_A](https://www.ruby-forum.com/u/Achilleas_A)\
**Post date:** [June 24, 2015, 6:36am UTC](https://www.ruby-forum.com/t/verifying-turbo-encoder-output-was-re-no-subject/242430/2 "2015-06-24T06:36:59Z")

</div>

Thank you very much… I got it

With Regards,  
Salija.P

On Tue, Jun 23, 2015 at 10:00 PM, Achilleas A. \<
