|
|
|
|
@ -306,23 +306,14 @@ int rds_decoder_redsea_impl::work (int noutput_items,
|
|
|
|
|
if (num_diff_bits<2){ |
|
|
|
|
dout << "clockslip detection (forward,skipped one):"<<std::endl; |
|
|
|
|
dout << "dataword:"<<std::bitset<16>(dataword)<<"\tlast_pi:"<<std::bitset<16>(last_pi)<<std::endl; |
|
|
|
|
i--; |
|
|
|
|
} |
|
|
|
|
if (num_diff_bits2<2){ |
|
|
|
|
dout << "clockslip detection (backward,repeated one):"<<std::endl; |
|
|
|
|
dout << "dataword:"<<std::bitset<16>(dataword)<<"\tlast_pi:"<<std::bitset<16>(last_pi)<<std::endl; |
|
|
|
|
i++; |
|
|
|
|
}
|
|
|
|
|
diff=dataword^(last_pi>>2); |
|
|
|
|
diff2=(dataword>>2)^(last_pi); |
|
|
|
|
num_diff_bits = std::bitset<16>(diff).count(); |
|
|
|
|
num_diff_bits2 = std::bitset<16>(diff2).count(); |
|
|
|
|
if (num_diff_bits<2){ |
|
|
|
|
dout << "clockslip detection (forward,skipped two):"<<std::endl; |
|
|
|
|
dout << "dataword:"<<std::bitset<16>(dataword)<<"\tlast_pi:"<<std::bitset<16>(last_pi)<<std::endl; |
|
|
|
|
} |
|
|
|
|
if (num_diff_bits2<2){ |
|
|
|
|
dout << "clockslip detection (backward,repeated two):"<<std::endl; |
|
|
|
|
dout << "dataword:"<<std::bitset<16>(dataword)<<"\tlast_pi:"<<std::bitset<16>(last_pi)<<std::endl; |
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//try correcting:
|
|
|
|
|
uint32_t corrected_block= correctBurstErrors(reg,expected_offset_char[block_number]); |
|
|
|
|
@ -382,9 +373,9 @@ int rds_decoder_redsea_impl::work (int noutput_items,
|
|
|
|
|
block_number=(block_number+1) % 4; |
|
|
|
|
blocks_counter++; |
|
|
|
|
/* 1187.5 bps / 104 bits = 11.4 groups/sec, or 45.7 blocks/sec */ |
|
|
|
|
if (blocks_counter==40) {//reduced from 50
|
|
|
|
|
if (blocks_counter==50) {//reduced from 50
|
|
|
|
|
last_wrong_blocks_counter=wrong_blocks_counter; |
|
|
|
|
if (wrong_blocks_counter>28) {//reduced from 35
|
|
|
|
|
if (wrong_blocks_counter>35) {//reduced from 35
|
|
|
|
|
lout << "@@@@@ Lost Sync (Got " << wrong_blocks_counter |
|
|
|
|
<< " bad blocks on " << blocks_counter |
|
|
|
|
<< " total)" << std::endl; |
|
|
|
|
|