<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.18.0" xml:lang="en-US">
  <compounddef id="classgr_1_1fec_1_1code_1_1cc__encoder" kind="class" language="C++" prot="public" abstract="yes">
    <compoundname>gr::fec::code::cc_encoder</compoundname>
    <basecompoundref refid="classgr_1_1fec_1_1generic__encoder" prot="public" virt="virtual">gr::fec::generic_encoder</basecompoundref>
    <includes refid="cc__encoder_8h" local="no">gnuradio/fec/cc_encoder.h</includes>
    <sectiondef kind="public-static-func">
      <memberdef kind="function" id="classgr_1_1fec_1_1code_1_1cc__encoder_1ae1f58e2b9d445fe0492c679af52c4920" prot="public" static="yes" const="no" explicit="no" inline="no" virt="non-virtual">
        <type><ref refid="classgr_1_1fec_1_1generic__encoder_1a6a672384d24b60f9111fda607ce3bdd8" kindref="member">generic_encoder::sptr</ref></type>
        <definition>static generic_encoder::sptr gr::fec::code::cc_encoder::make</definition>
        <argsstring>(int frame_size, int k, int rate, std::vector&lt; int &gt; polys, int start_state=0, cc_mode_t mode=CC_STREAMING, bool padded=false)</argsstring>
        <name>make</name>
        <qualifiedname>gr::fec::code::cc_encoder::make</qualifiedname>
        <param>
          <type>int</type>
          <declname>frame_size</declname>
        </param>
        <param>
          <type>int</type>
          <declname>k</declname>
        </param>
        <param>
          <type>int</type>
          <declname>rate</declname>
        </param>
        <param>
          <type>std::vector&lt; int &gt;</type>
          <declname>polys</declname>
        </param>
        <param>
          <type>int</type>
          <declname>start_state</declname>
          <defval>0</defval>
        </param>
        <param>
          <type><ref refid="cc__common_8h_1a0a58220e9113f8b4003a228c8f765b8e" kindref="member">cc_mode_t</ref></type>
          <declname>mode</declname>
          <defval><ref refid="cc__common_8h_1ae5ac813a96416d2ae3d680a65c1f2d3aa0ac392555537d09c7cd3e678cdd97a97" kindref="member">CC_STREAMING</ref></defval>
        </param>
        <param>
          <type>bool</type>
          <declname>padded</declname>
          <defval>false</defval>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Build a convolutional code encoding FEC API object.</para>
<para><parameterlist kind="param"><parameteritem>
<parameternamelist>
<parametername>frame_size</parametername>
</parameternamelist>
<parameterdescription>
<para>Number of bits per frame; must be &gt; 1. If using in the tagged stream style, this is the maximum allowable number of bits per frame. </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>k</parametername>
</parameternamelist>
<parameterdescription>
<para>Constraint length (K) of the encoder; must be in the range [2, 31]. K = 1 implies a code without memory which does not make sense; upper limit is due the way the polynomials of the code are passed in <computeroutput>polys</computeroutput>. </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>rate</parametername>
</parameternamelist>
<parameterdescription>
<para>Inverse of the coder&apos;s rate; must be &gt; 1. (rate=2 means 2 output bits per 1 input). </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>polys</parametername>
</parameternamelist>
<parameterdescription>
<para>Vector of polynomials as integers. The least significant bit (LSB) denotes the coefficient of exponent zero of the coding polynomial. The position of the most significant set bit (zero based counting) is <computeroutput>K-1</computeroutput>. Note: this representation is reversed compared to the common representation as found in most books and references. The common representation puts the coefficient of the highest exponent into the LSB and the coefficient of exponent zero is the highest set bit. Example: The common binary representation of the Voyager code polynomials (see above) is 1011011 and 1111001; the octal representation is 133 and 171. For this block, the binary representation must be reversed: 1101101 and 1001111; octal this is 155 and 117; decimal this is 109 and 79. Some standards (e.g. CCSDS 131.0-B-3) require the inversion of some outputs. This is supported by providing the negative value of the polynomial, e.g. -109. </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>start_state</parametername>
</parameternamelist>
<parameterdescription>
<para>Initialization state of the shift register; must be in range [0, 2^(K-1)-1] where K is the constraint length. The bits in <computeroutput>start_state</computeroutput> are also used to flush the encoder in mode &apos;CC_TERMINATED&apos;. Note: Most books and references use a shift register shifting from left to right. This implementation, however, shifts from right to left. This means that the start state must be reversed. (The different shift direction is also the reason why the polynomials must be reversed as described above.) </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>mode</parametername>
</parameternamelist>
<parameterdescription>
<para><ref refid="cc__common_8h_1a0a58220e9113f8b4003a228c8f765b8e" kindref="member">cc_mode_t</ref> mode of the encoding. </para>
</parameterdescription>
</parameteritem>
<parameteritem>
<parameternamelist>
<parametername>padded</parametername>
</parameternamelist>
<parameterdescription>
<para>true if the encoded frame should be padded to the nearest byte. </para>
</parameterdescription>
</parameteritem>
</parameterlist>
</para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="gr-fec/include/gnuradio/fec/cc_encoder.h" line="129" column="34"/>
        <references refid="cc__common_8h_1ae5ac813a96416d2ae3d680a65c1f2d3aa0ac392555537d09c7cd3e678cdd97a97" compoundref="cc__common_8h" startline="17">CC_STREAMING</references>
        <references refid="classgr_1_1fec_1_1code_1_1cc__encoder_1aa2476a4526654ebfa1e8aed580765e73">rate</references>
      </memberdef>
    </sectiondef>
    <sectiondef kind="public-func">
      <memberdef kind="function" id="classgr_1_1fec_1_1code_1_1cc__encoder_1acebc1744363f88c7616f720558614f8a" prot="public" static="no" const="no" explicit="no" inline="no" virt="pure-virtual">
        <type>bool</type>
        <definition>bool gr::fec::code::cc_encoder::set_frame_size</definition>
        <argsstring>(unsigned int frame_size) override=0</argsstring>
        <name>set_frame_size</name>
        <qualifiedname>gr::fec::code::cc_encoder::set_frame_size</qualifiedname>
        <reimplements refid="classgr_1_1fec_1_1generic__encoder_1ac6a41c2f21012253a43cebc7e7b98039">set_frame_size</reimplements>
        <param>
          <type>unsigned int</type>
          <declname>frame_size</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Sets the uncoded frame size to <computeroutput>frame_size</computeroutput>. If <computeroutput>frame_size</computeroutput> is greater than the value given to the constructor, the frame size will be capped by that initial value and this function will return false. Otherwise, it returns true. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="gr-fec/include/gnuradio/fec/cc_encoder.h" line="144" column="10"/>
      </memberdef>
      <memberdef kind="function" id="classgr_1_1fec_1_1code_1_1cc__encoder_1aa2476a4526654ebfa1e8aed580765e73" prot="public" static="no" const="no" explicit="no" inline="no" virt="pure-virtual">
        <type>double</type>
        <definition>double gr::fec::code::cc_encoder::rate</definition>
        <argsstring>() override=0</argsstring>
        <name>rate</name>
        <qualifiedname>gr::fec::code::cc_encoder::rate</qualifiedname>
        <reimplements refid="classgr_1_1fec_1_1generic__encoder_1a0c47f99e01942d4316b5b24619aab58c">rate</reimplements>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
<para>Returns the coding rate of this encoder. </para>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="gr-fec/include/gnuradio/fec/cc_encoder.h" line="149" column="12"/>
        <referencedby refid="classgr_1_1fec_1_1code_1_1cc__encoder_1ae1f58e2b9d445fe0492c679af52c4920">make</referencedby>
      </memberdef>
    </sectiondef>
    <briefdescription>
<para>Convolutional Code Encoding class. </para>
    </briefdescription>
    <detaileddescription>
<para>This class performs convolutional encoding for unpacked bits for frames of a constant length. This class is general in its application of the convolutional encoding and allows us to specify the constraint length, the coding rate, and the polynomials used in the coding process.</para>
<para>The parameter <computeroutput>k</computeroutput> sets the constraint length directly. We set the coding rate by setting <computeroutput>rate</computeroutput> to R given a desired rate of 1/R. That is, for a rate 1/2 coder, we would set <computeroutput>rate</computeroutput> to 2. And the polynomial is specified as a vector of integers, where each integer represents the coding polynomial for a different arm of the code. The number of polynomials given must be the same as the value <computeroutput>rate</computeroutput>.</para>
<para>The encoding object holds a shift register that takes in each bit from the input stream and then ANDs the shift register with each polynomial, and places the parity of the result into the output stream. The output stream is therefore also unpacked bits.</para>
<para>The encoder is set up with a number of bits per frame in the constructor. When not being used in a tagged stream mode, this encoder will only process frames of the length provided here. If used in a tagged stream block, this setting becomes the maximum allowable frame size that the block may process.</para>
<para>The <computeroutput>mode</computeroutput> is a <ref refid="cc__common_8h_1a0a58220e9113f8b4003a228c8f765b8e" kindref="member">cc_mode_t</ref> that specifies how the convolutional encoder will behave and under what conditions.</para>
<para><itemizedlist>
<listitem><para>&apos;CC_STREAMING&apos;: mode expects an uninterrupted flow of samples into the encoder, and the output stream is continually encoded.</para>
</listitem>
</itemizedlist>
<itemizedlist>
<listitem><para>&apos;CC_TERMINATED&apos;: is a mode designed for packet-based systems. This mode flushes the encoder with K-1 bits which adds rate*(K-1) bits to the output. This improves the protection of the last bits of a block and helps the decoder.</para>
</listitem>
</itemizedlist>
<itemizedlist>
<listitem><para>&apos;CC_TAILBITING&apos;: is another packet-based method. Instead of adding bits onto the end of a packet (as with &apos;CC_TERMINATED&apos;), this mode will pre-initialize the state of the encoder with a packet’s last (k-1) bits.</para>
</listitem>
</itemizedlist>
<itemizedlist>
<listitem><para>&apos;CC_TRUNCATED&apos;: a truncated code always resets the registers to the <computeroutput>start_state</computeroutput> between frames.</para>
</listitem>
</itemizedlist>
A common convolutional encoder uses K=7, Rate=1/2, and the polynomials <itemizedlist>
<listitem><para>1 + x^2 + x^3 + x^5 + x^6 </para>
</listitem>
<listitem><para>1 + x + x^2 + x^3 + x^6 This is the Voyager code from NASA.</para>
</listitem>
</itemizedlist>
Another encoder class is provided with gr-fec called the <ref refid="classgr_1_1fec_1_1code_1_1ccsds__encoder" kindref="compound">gr::fec::code::ccsds_encoder</ref>, which implements the above code that is more highly optimized for just those specific settings. </para>
    </detaileddescription>
    <inheritancegraph>
      <node id="1">
        <label>gr::fec::code::cc_encoder</label>
        <link refid="classgr_1_1fec_1_1code_1_1cc__encoder"/>
        <childnode refid="2" relation="public-inheritance">
        </childnode>
      </node>
      <node id="2">
        <label>gr::fec::generic_encoder</label>
        <link refid="classgr_1_1fec_1_1generic__encoder"/>
      </node>
    </inheritancegraph>
    <collaborationgraph>
      <node id="1">
        <label>gr::fec::code::cc_encoder</label>
        <link refid="classgr_1_1fec_1_1code_1_1cc__encoder"/>
        <childnode refid="2" relation="public-inheritance">
        </childnode>
      </node>
      <node id="2">
        <label>gr::fec::generic_encoder</label>
        <link refid="classgr_1_1fec_1_1generic__encoder"/>
        <childnode refid="3" relation="usage">
          <edgelabel>d_logger</edgelabel>
        </childnode>
        <childnode refid="4" relation="usage">
          <edgelabel>d_name</edgelabel>
        </childnode>
      </node>
      <node id="5">
        <label>std::basic_string&lt; Char &gt;</label>
      </node>
      <node id="3">
        <label>std::shared_ptr&lt; logger &gt;</label>
      </node>
      <node id="4">
        <label>std::string</label>
        <childnode refid="5" relation="public-inheritance">
        </childnode>
      </node>
    </collaborationgraph>
    <location file="gr-fec/include/gnuradio/fec/cc_encoder.h" line="84" column="1" bodyfile="gr-fec/include/gnuradio/fec/cc_encoder.h" bodystart="85" bodyend="150"/>
    <listofallmembers>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a391cc2f87d40fac87feabdae40dd8f2a" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>alias</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a5ae67e6fcab66da448cf5a1e97a7f70d" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>base_unique_id</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a2425896d3a9b72896db338d2912ed0b4" prot="protected" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>d_logger</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1ab82cb684e9d420af266e7cbb13affe48" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>d_name</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a756957e732c8e4ee020175874e8ae280" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>generic_encoder</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a80c72ef4103a41368b4f70dc3b008d23" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>generic_encoder</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a36aebf80392ed4644c1e8a2818b864d3" prot="public" virt="pure-virtual"><scope>gr::fec::code::cc_encoder</scope><name>generic_work</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1adf46ba604e83c7b8e8ab3b6bd5bbb637" prot="public" virt="virtual"><scope>gr::fec::code::cc_encoder</scope><name>get_input_conversion</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a95db2880c3e02e52564ea6a04b6ee243" prot="public" virt="pure-virtual"><scope>gr::fec::code::cc_encoder</scope><name>get_input_size</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1afdbb6e85bffb01a6366369d6df98b986" prot="public" virt="virtual"><scope>gr::fec::code::cc_encoder</scope><name>get_output_conversion</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1aa72462435284fc66d3b3a2a5b366f4ea" prot="public" virt="pure-virtual"><scope>gr::fec::code::cc_encoder</scope><name>get_output_size</name></member>
      <member refid="classgr_1_1fec_1_1code_1_1cc__encoder_1ae1f58e2b9d445fe0492c679af52c4920" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>make</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1afd01b295f144a57053e5b11a33fff5b6" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>my_id</name></member>
      <member refid="classgr_1_1fec_1_1code_1_1cc__encoder_1aa2476a4526654ebfa1e8aed580765e73" prot="public" virt="pure-virtual"><scope>gr::fec::code::cc_encoder</scope><name>rate</name></member>
      <member refid="classgr_1_1fec_1_1code_1_1cc__encoder_1acebc1744363f88c7616f720558614f8a" prot="public" virt="pure-virtual"><scope>gr::fec::code::cc_encoder</scope><name>set_frame_size</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a6a672384d24b60f9111fda607ce3bdd8" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>sptr</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1adb02ab6b53b41fa0b0e65a51ca966f3b" prot="public" virt="non-virtual"><scope>gr::fec::code::cc_encoder</scope><name>unique_id</name></member>
      <member refid="classgr_1_1fec_1_1generic__encoder_1a576c3fc45c1da7e8712272d556be6b23" prot="public" virt="virtual"><scope>gr::fec::code::cc_encoder</scope><name>~generic_encoder</name></member>
    </listofallmembers>
  </compounddef>
</doxygen>
