abort if either head or tail data is damaged

This commit is contained in:
Ahmet Inan 2025-07-27 21:40:34 +02:00
commit 3aa823facd
2 changed files with 4 additions and 3 deletions

1
TODO.md vendored
View file

@ -1,5 +1,4 @@
### TODO
* erase symbol or abort if either head or tail data is damaged, as we can't recover anything when that happens
* implement analog mode (most significant mode bit is 1), where only complex values are the payload
* re-encode preamble to use entire symbol to update the channel estimation
* re-encode entire message and output number of bitflips and real SNR

View file

@ -306,7 +306,8 @@ struct Decoder : Common
int head_data = hadamard_decoder(head);
if (head_data < 0) {
std::cerr << "head data damaged" << std::endl;
head_data = 0;
oper_mode = -1;
break;
}
hadamard_encoder(head, head_data);
for (int i = 0; i < head_tones; ++i) {
@ -322,7 +323,8 @@ struct Decoder : Common
int tail_data = hadamard_decoder(tail);
if (tail_data < 0) {
std::cerr << "tail data damaged" << std::endl;
tail_data = 0;
oper_mode = -1;
break;
}
hadamard_encoder(tail, tail_data);
for (int i = 0; i < tail_tones; ++i) {