[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss-gnuradio] question about dvb_bch_bb_impl.cc
From: |
Tiankun Hu |
Subject: |
[Discuss-gnuradio] question about dvb_bch_bb_impl.cc |
Date: |
Mon, 13 Jun 2016 22:22:57 +0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
I found dvb_bch_bb_impl.cc use shift register to implement BCH encode,
but it seems different with my knowledge.
If I remember right, after shift the register, we should add the info
bit to register's LSB
dvb_bch_bb_impl.cc:526~535
b = (temp ^ (shift[5] & 1));
reg_6_shift(shift);
if (b) {
shift[0] ^= m_poly_n_12[0];
shift[1] ^= m_poly_n_12[1];
shift[2] ^= m_poly_n_12[2];
shift[3] ^= m_poly_n_12[3];
shift[4] ^= m_poly_n_12[4];
shift[5] ^= m_poly_n_12[5];
}
should be like this ===========>
b = shift[5] & 1; // use register's MSB to decide whether
need to XOR poly
reg_6_shift(shift);
shift[0] = shift[0] ^ (temp<<31);// add the info bit to
register's LSB
if (b) {
shift[0] ^= m_poly_n_12[0];
shift[1] ^= m_poly_n_12[1];
shift[2] ^= m_poly_n_12[2];
shift[3] ^= m_poly_n_12[3];
shift[4] ^= m_poly_n_12[4];
shift[5] ^= m_poly_n_12[5];
}
- [Discuss-gnuradio] question about dvb_bch_bb_impl.cc,
Tiankun Hu <=