Exemplo n.º 1
0
  void TurboCodeWithZP::Decoder_term(const itpp::cvec& in1,
                                     const itpp::cvec& in2,
                                     double n0, int iterations) const
  {
    // std::cout << "## zeroPadding_ = " << zeroPadding_.PadPositions() << std::endl;

    int memory = rsc1_.Constraint() - 1;
    static itpp::vec llrZeros(0);
    if (llrZeros.size() != memory){
      llrZeros.set_size(memory);
      llrZeros.zeros();
    } // if
    
    for (int ite = 0; ite < iterations; ++ite){
      itpp::vec llrToRsc1_mod = zeroPadding_.ModifyLLR(llrToRsc1_);
      
      itpp::vec llrFromRsc1;
      rsc1_.Decode(in1, llrToRsc1_mod, &llrFromRsc1, n0);
      
      itpp::vec llrFromRsc1_mod = zeroPadding_.ModifyLLR(llrFromRsc1);
            
      itpp::vec llrToRsc2 = Interleave(llrFromRsc1_mod.left(interleaver_.size()), interleaver_);
      llrToRsc2 = itpp::concat(llrToRsc2, llrZeros);

      itpp::vec llrFromRsc2;
      rsc2_.Decode(in2, llrToRsc2, &llrFromRsc2, n0);

      llrToRsc1_ = Deinterleave(llrFromRsc2.left(interleaver_.size()), interleaver_);
      llrToRsc1_ = itpp::concat(llrToRsc1_, llrZeros);
    } // for ite    
  }
Exemplo n.º 2
0
  void TurboCode::Decoder_term(const itpp::cvec &in1,
                               const itpp::cvec &in2,
                               double n0, int iteration) const
  {
    int memory = rsc1_.Constraint() - 1;
    static itpp::vec llrZeros(0);
    if (llrZeros.size() != memory){
      llrZeros.set_size(memory);
      llrZeros.zeros();
    } // if

    for (int ite = 0; ite < iteration; ++ite){
      itpp::vec llrFromRsc1;
      rsc1_.Decode(in1, llrToRsc1_, &llrFromRsc1, n0);

      itpp::vec llrToRsc2 = Interleave(llrFromRsc1.left(interleaver_.size()), interleaver_);
      llrToRsc2 = itpp::concat(llrToRsc2, llrZeros);

      itpp::vec llrFromRsc2;
      rsc2_.Decode(in2, llrToRsc2, &llrFromRsc2, n0);

      llrToRsc1_ = Deinterleave(llrFromRsc2.left(interleaver_.size()), interleaver_);
      llrToRsc1_ = itpp::concat(llrToRsc1_, llrZeros);
    } // for ite

  }