forked from tapparelj/gr-lora_sdr
-
Notifications
You must be signed in to change notification settings - Fork 2
gray_code
Martyn van Dijke edited this page May 7, 2021
·
1 revision
The purpose of the gray coding is to modulated the bits in such a way that two subsequent symbols differ one bit. Using this approach in the end we can easily recover from off by one bit errors which have a (relatively) high change of happening.
Gray mapping is implemented in the following way, by making a simple for loop over the input array and mapping the bits.
for (int i = 0; i < noutput_items; i++) {
out[i] = (in[i] ^ (in[i] >> 1u));
}