# CRC-Based Reliable WiFi Backscatter Communication for Supply Chain Management
## 3 CRCScatter Decoder Design
### XOR and Differential Decoder  
The IEEE 802.11 protocol specifies that the DSSS system uses the baseband modulation of DBPSK to provide the 1 Mbit/s data rate and solve the problem of phase ambiguity in BPSK. In DBPSK modulation, the input data \(a\) is calculated by differential encoding to obtain differential data \(e\); then, the differential data \(e\) is modulated by the conventional BPSK modulator. In other words, we can assume that the 802.11b signal in our system transmits the differential data \(e\) rather than the original data \(a\). Since the CRCScatter tag can modify the transmitted data by codeword translation, we set the differential data modified by the tag to \(e^{\prime}\) and the backscatter data to \(a^{\prime}\). According to the decoding Formula (1) and the process shown in Figure 6, the tag data \(t\) can be represented using differential data \(e\) and \(e^{\prime}\). \[t=e\oplus e^{\prime}, \tag{8}\]  
In differential encoding, the transmitted data \(a\) and the differential data \(e\) should satisfy the encoding formula written as:  
\[e_{i}=e_{i-1}\oplus a_{i}. \tag{9}\]  
We can use the original data \(a\) and backscatter data \(a^{\prime}\) to calculate tag data \(t\) by differential encoding formula. The tag data calculation needs to be discussed separately. The first tag data bit \(t_{0}\) is calculated differently from the other tag data bits. \[t_{0}=e_{0}\oplus e_{0}^{\prime}=a_{0}\oplus a_{0}^{\prime}, \tag{10}\]  
\[t_{i}=e_{i}\oplus e_{i}^{\prime}=(e_{i-1}\oplus a_{i})\oplus(e_{i-1}^{\prime} \oplus a_{i}^{\prime})=(a_{i}\oplus a_{i}^{\prime})\oplus(e_{i-1}\oplus e_{i- 1}^{\prime})=(a_{i}\oplus a_{i}^{\prime})\oplus t_{i-1}. \tag{11}\]  
Figure 6: The tag modulates the differential data rather than the original data, and tag data \(t\) can be calculated by \(e\) and \(e^{\prime}\). Algorithm 4 presents the procedure for obtaining correct tag data \(t\) from backscatter data \(a^{\prime}\) and original data \(a\), as described in this section. From a time complexity standpoint, the number of XOR operations in Algorithm 4 is related to the length of tag data. When the tag data are 32 bits long, we can calculate that the number of bits requiring XOR calculation does not exceed 64. Since a single register operation in CRC algorithms requires a 32-bit operation and the number of cycles is related to the packet length, the time required for differential encoding is significantly shorter than that required for solving the original data. Furthermore, tag data with a length of less than 32 bits can be expanded to 32-bit tag data by adding zeros to the end. When processing backscatter packets from various tags, maintaining a unified tag data length can facilitate the decoder's work and prevent the loss of vital information. Thus, we believe that for the CRCScatter system, the decoding time complexity is related to the packet length, and the tag data length will not affect the average decoding time of the system. ```
backscatter data \(a^{\prime}\), original data \(a\)
```  
**Algorithm 4** Calculation in XOR and differential decoder  
In data communication, noise can cause bit errors in received backscatter packets, leading to errors in decoding tag data. To address this issue, similar to the CRC32 sequence in the MAC frame, the tag can add redundancy check bits and piggyback them along with the real tag data. The tag data containing real tag data and redundant bits can be decoded together by the CRCScatter decoder. Subsequently, the CRCScatter decoder is required to check the decoded tag data. The system can detect incorrect results, and any erroneous tag data that fails to pass verification will be discarded. After error detection steps, the correct decoding data can be preserved, thereby improving decoding accuracy. The verification method and complexity are determined by the type of redundant bits. This work employs a simple parity check code as a redundant error-detecting code, and the decoder needs to count the number of bit \"1\" in the tag data to verify the results.