Pattern-Based Decoding for Wi-Fi Backscatter Communication of Passive Sensors

Ambient backscatter communication enables passive sensors to convey sensing data on ambient RF signals in the air at ultralow power consumption. To extract data bits from such signals, threshold-based decoding has generally been considered, but suffers against Wi-Fi signals due to severe fluctuation of OFDM signals. In this paper, we propose a pattern-matching-based decoding algorithm for Wi-Fi backscatter communications. The key idea is the identification of unique patterns of signal samples that arise from the inevitable smoothing of Wi-Fi signals to filter out noisy fluctuation. We provide the mathematical basis of obtaining the pattern of smoothed signal samples as the slope of a line expressed in a closed-form equation. Then, the new decoding algorithm was designed to identify the pattern of received signal samples as a slope rather than classifying their amplitude levels. Thus, it is more robust against signal fluctuation and does not need tricky threshold configuration. Moreover, for even higher reliability, the pattern was identified for a pair of adjacent bits, and the algorithm decodes a bit pair at a time rather than a single bit. We demonstrate via testbed experiments that the proposed algorithm significantly outperforms conventional threshold-based decoding variants in terms of bit error rate for various distances and data rates.


Introduction
Ambient backscatter communication is widely considered a means of ultralow power communication of low-end passive sensors (e.g., sensor tag) in Internet of Things (IoT) environments. Ambient backscatter communication is realized by letting a sensor tag reflect and absorb ambient signals in the air according to sensing-data bits to transmit by controlling the state of a radio frequency (RF) switch. For example, a tag reflects ambient signals (reflection state) for transmitting data one, but absorbs ambient signals (absorption state) for transmitting data zero; a receiver then sees the amplitude changes of received signals from which it can decode data bits. A variety of ambient signals, such as TV broadcasts, Wi-Fi and FM radio, are considered for this purpose. In particular, Wi-Fi backscatter communication is promising since Wi-Fi access points (main signal sources) prevail and most smartphones/tablet PCs (data-collecting node or Internet gateway for Wi-Fi backscatter tags) are already equipped with a Wi-Fi transceiver. Such wide availability of Wi-Fi-equipped devices is the key advantage of Wi-Fi backscatter communication for the quick deployment of technology. Thus, Wi-Fi has been considered as a promising carrier source of backscatter communication in the literature [1][2][3][4][5][6][7].
The backscattered signal is then received by the Wi-Fi receiver as the sum of the signals along both paths. The received signal is expressed as where x and y are the amplitudes of the transmitted and received Wi-Fi signal samples, respectively, h 1 and h 2 are the channel gains of backscattered and other signal components, respectively (for simplicity, they are assumed static during a single frame period), ρ is the reflection loss of the tag, r ∈ {1, 0} is the switching state of the tag (1 is reflection and 0 is absorption), and σ is the noise floor including thermal noise; k is the sample index.

Sensing data
Wi-Fi transmitter Wi-Fi receiver We assume that the backscatter tag reflects signal (r = 1) for data one, and this results in an increased (high) amplitude level of the backscattered signal; it absorbs the signal (r = 0) for data zero, and the backscattered signal has no increased (low) amplitude level. The tag maintains its switching state for period T (given as the number of signal samples), which we call a slot (one bit is transmitted during a slot) and can switch the state at the end of each slot depending on the value of the next bit to transmit. Slot n is represented as [τ n , τ n + T] (samples), where τ n is the first sample of slot n.
We assume that the bits to transmit are coded by, but not limited to, FM0 coding [8], i.e., the code rate is 1/2 (one information bit needs the transmission of two coded bits). In FM0 coding, if the information bit to transmit is data one, the signal level is maintained (represented by bit pair (1,1) or (0, 0)); if it is data zero, the level is inverted in the middle (represented by bit pair (0, 1) or (1, 0)). The signal level is inverted at the end of every slot. Unless otherwise specified, the transmission bit rate is represented as the transmitted number of coded bits per unit time.
We limited the focus of the paper to the communication scenario where a backscatter tag transmits its data to more powerful receiver nodes, such as smartphones and IoT gateways, which is common in IoT environments, in that things are equipped with sensors and report sensing results to the outer world (e.g., the Cloud).
In addition, we make the following assumptions.

Assumption 1.
Digital-domain processing of received signal samples: Receiver nodes are assumed to have sufficient computing power and thus run a decoding process in the digital domain for better performance.

Assumption 2.
In-frame switching: To achieve a higher transmission bit rate with occasional Wi-Fi signals, a backscatter device changes its switching state within a Wi-Fi frame reception so that it modulates multiple data bits on the frame. Figure 2a shows the received signal samples of a backscattered Wi-Fi data frame for which a backscatter tag modulates coded bits at 100 kbps. The beginning non-OFDM part of the frame (32 µs for a preamble and part of the physical-layer header) has small fluctuation, but the following OFDM-modulated part shows considerable fluctuation. Due to such fluctuation of the Wi-Fi signal itself, no amplitude patterns of the tag's backscattering are noticeable in raw signal samples.  In general, a backscatter tag's bit modulation on a Wi-Fi signal is at a much lower rate than for Wi-Fi. Therefore, we can smooth the fluctuation of the Wi-Fi signal out while letting backscattered amplitude patterns remain [8]. To this end, we applied moving average to signal samples, i.e., a window of signal samples were averaged to produce another signal value, which is a representative low-complexity method of low-pass filtering. The moving average process we considered is given asȳ

Patterns in Smoothed Wi-Fi Signal
where y andȳ are the amplitudes of received Wi-Fi signal samples before and after the moving average, respectively, and N is the window size (in the number of samples) of the moving average. The signal samples after smoothing are shown in Figure 2b with several values of window size N. It was observed that a significant amount of fluctuation disappeared, and amplitude patterns were then noticeable. However, the following points show that conventional threshold-based decoding still suffers: • As the window size of the moving average increases, the fluctuation of the Wi-Fi signal is better reduced, but backscattered amplitude patterns are also smoothed out more, which becomes more severe for a higher backscatter bit rate. That is, the window size of the moving average is one of the factors determining decoding performance. • The entire samples of a slot period are not above or below a threshold. This results not only from residual fluctuation, but also from the nature of the moving average. Thus, a small variation of the signal may lead to the wrong decision of threshold-based decoding for an information bit. • The scale of amplitude changes is significantly reduced. Therefore, a small variation of a threshold from the optimal one may result in decoding failures.
• The scale of amplitude changes changes depending on the window size of smoothing and the switching rate of a backscatter tag. This means that an adequate threshold has to be adaptive to such parameters, which makes threshold configuration even more difficult.
To tackle the above challenges, we paid attention not to amplitude levels, but to the pattern of its changes after signal smoothing was applied. Ideally, as illustrated in Figure 3, if a tag alternates reflection and absorption states, the signal is modulated as a square wave. When the signal goes through the smoothing (moving average) of Equation (2), the distortion patterns are twofold: (1) inclining slope around a rising edge; (2) declining slope around a falling edge. Suppose that the tag changes the switching state at 1/THz, i.e., the reflection state remains unchanged during T (in the number of samples). In order not to filter out the reflection patterns of the tag, we must let N < T. Then, these signal-distortion patterns after smoothing are formally proved in the following proposition. Proof. Under the above assumption of N, applying Equation (2) to Equation (1) leads tō wherex is the average of x samples within the window. When the window of signal samples for smoothing includes a rising edge at j, r[k] = 1 for k ≥ j, and otherwise zero. Then, the last term of the above equation becomes monotonically increase for i. When N includes a falling edge at j, the last term becomes

and nowȳ[i] monotonically decreases for i.
This observation motivates us to exploit such patterns for decoding data bits. The following proposition shows that we can identify inclining and declining signal patterns as positive and negative gradients (slopes) of a line, respectively, via simple first-order curve fitting (linear regression) whose solution is given in a closed form.

Proposition 2.
First-order least-mean-square curve fitting of any monotonically increasing (decreasing) function produces a line with a positive (negative) gradient.
Proof. The first-order least-mean-square curve-fitting problem is presented as minimizing the cost function of ∑ i (v i − (a + bu i )) 2 , where u i and v i are input and output samples, respectively, and a and b are the coefficients of the curve (problem variables in curve fitting). By letting the cost's partial derivatives of a and b be zero and solving the resulting simultaneous equations, we obtain the optimal b as [31] b whereū andv are the averages of u and v, respectively, for the given samples, σ 2 u is the variance of u, m is the number of samples, and cov() is the covariance. It is known that cov( f (u), g(u)) ≥ 0 holds for any two increasing functions f and g, and if one is increasing and the other is decreasing, then the inequality is reversed. Therefore, if v is a monotonically increasing function of u, cov(u, v) ≥ 0 and the optimal b is positive. Conversely, if v is a monotonically decreasing function of u, cov(u, v) < 0, and the optimal b becomes negative [32,33].

Proposition 3.
If N is large enough to filter out signal fluctuation while N ≤ T, the gradient of the fitted line for moving-averaged samples with N is always positive (negative) when the window of smoothing includes a rising (falling) edge.
Proof. The proof is straightforward according to Propositions 1 and 2; thus, it is omitted. Figure 4 shows the groups of signal samples for a set of bit pairs that appear in the smoothed signal of Figure 2a; we chose those of bit pairs (0, 1) and (1, 0) for straightforward illustration. The horizontal line is the average amplitude of the whole Wi-Fi frame, which is the threshold of decoding configured by the total-mean method. In an ideal condition, the first half of samples are below the line and the second half are above it for bit pair (0, 1); the opposite trend is shown for bit pair (1, 0), i.e., the signal of each case crosses the horizontal line at the center. In such a case, we achieve a reliable decoding decision of the total-mean method. However, the real samples are not aligned with the expectation. Moreover, several cases show that most samples are below or above the line, thus leading to a decoding error. For example, the 12th group has most samples below the threshold, and the 14th group has most samples above the threshold. Despite such irregular signal fluctuation, signal patterns are still reserved in all cases. The line found by first-order curve fitting for each group of samples is shown as a red dotted line; rising-edge groups corresponding to bit pair (0, 1) produce positive-gradient lines (the signal inclines) and falling-edge groups corresponding to bit pair (1, 0) produce negative-gradient lines (the signal declines).

Pattern-Based Decoding Algorithm
Based on the observations made in the previous section, we developed a pattern-based decoding algorithm. The pseudocode of the algorithm is given in Algorithm 1. In order to decode the bit of slot n, we designed the algorithm to identify the pattern of samples in [τ n − T/2, τ n + T/2 − 1], i.e., T/2 samples from slot n − 1 and the other T/2 samples from slot n, not in [τ n , τ n + T − 1], due to the following reasons (τ n is the first sample of slot n): • When signal smoothing of Equation (2) is applied, the sample pattern in [τ n − T/2, τ n + T/2 − 1] monotonically increases and decreases if the transmitted signal at τ n corresponds to rising and falling edges, respectively, according to Proposition 1, thus being identified as positive and negative slopes, respectively, according to Proposition 3. • It does not identify a single bit value, but the transition of two adjacent bits at once. This means that we decode the value of a bit twice, once with the previous bit and the second time with the next bit. Therefore, decoding becomes more robust against sudden unstable noisy samples.
The algorithm calculates slope of samples [τ n − T/2, τ n + T/2 − 1] (denoted by slope[n]) via linear curve fitting, which is derived from Equation (4) as (the details of the derivation are given in Appendix A): If the slope is positive (inclining pattern), the algorithm assumes that the samples correspond to bit pair (0, 1); otherwise, to bit pair (1, 0). Since the first T/2 samples of pattern detection are from the previous slot n − 1, the algorithm identifies the second value of the resulting bit pair (bitPair[n] [2]) as the bit of slot n (bit[n]). Finally, the algorithm compares slope[n] obtained for slot n with that for the previous slot (slope[n − 1]). If slope[n] is larger than the previous one, the algorithm assumes that the detected bit pair from slope[n] (bitPair[n]) is more confident and modifies the bit value of the previous slot (bit[n − 1]) as the first value of this bit pair (bitPair[n] [1]).
In the algorithm, for both bit pairs (1, 1) and (0, 0), the slope is ideally obtained as zero. Then, the corresponding bit value is judged from the samples of the next slot because the samples of the next slot are either (1, 0) or (0, 1), having a nonzero slope (no consecutive bit pairs of either (1, 1) or (0, 0) appear in FM0 coding). In reality, for both bit pairs (1, 1) and (0, 0), the slope may be obtained as a nonzero value, but its absolute value is probably smaller than the one for the next slot. Therefore, from the comparison between the slopes for two consecutive slots, the algorithm is likely to pick the bit value judged from the samples for the next slot. Figure 5 illustrates the operation of the algorithm. The transmitted bits are the FM0-coded ones for the data of alternating one and zero. Suppose that bit [1] is decoded as data one, and slope [1] is positive. In order to decode bit [2], the algorithm calculates slope [2], which is obtained small but positive, and judges bit [2] as data one. The previous slope [1] is for bit pair (0, 1) and larger than slope [2]; thus, the algorithm keeps the decision of bit [1]. The algorithm obtains slope [3] as a negative since it is for bit pair (1, 0), and judges bit [3] as data zero. The absolute value of slope [3] is larger than that of slope [2]; thus, bit [2] is determined as the first value of bit pair (1, 0), i.e., data one. The calculated slope for bit [4] corresponds to bit pair (0, 1) and is obtained as positive, thus resulting in bit [4] as data one. Since slope [3] and slope [4] produce bit pairs (1, 0) and (0, 1), respectively, a comparison between two does not change the result of bit [3]. The same procedure is applied to bit [5]-bit [7]. However, for bit [8], slope [8] is obtained positive, which is not aligned with the true bit pair (1, 0) due to signal fluctuation. The algorithm assumes that the corresponding bit pair is (0, 1) and judges bit [8] as data one, which is corrected by the decision of slope [9], since slope [9] is obtained larger than slope [8].
Received signal (after smoothing)

Experimental Evaluation
In this section, we evaluate the proposed pattern-based decoding algorithm through indoor testbed experiments. For comparison with conventional threshold-based decoding, we considered two methods to configure a threshold: (1) the average of all samples of a received Wi-Fi frame (total mean), and (2) the average of the samples of a sliding window (sliding). In the sliding method, window size was set as the same as a slot length.

Environmental Setup
We used two Ettus Universal Software Radio Peripherals (USRPs, N210 and X310) [34] to generate and receive Wi-Fi signals, as shown in Figure 6. The gr-ieee802-11 module of GNU Radio [35] was used to generate Wi-Fi carrier signals according to the OFDM frame format of IEEE 802.11g. Each Wi-Fi frame is composed of a 64 µs physical-layer header and a following MAC frame of 1528 bytes. It is transmitted at a bit rate of 9 Mbps (QPSK modulation and 3/4 code rate) and 1.4 ms long. The USRPs operate at the center frequency of 2.432 GHz. The transmit power of the transmitting USRP is 14.78 dBm (as measured at the output antenna port by a network analyzer). The receiving USRP captures the I/Q signals of received Wi-Fi frames via two antennas, each at a sampling rate of 10 MHz (for moderate computational loads), and preprocesses them according to the µMO procedure [9], so that communication distance is expanded thanks to diversity. Then, the resulting signal stream is smoothed via moving average with the window size same as the slot length and input to the processing block of bit decoding. The backscatter tag was implemented using Analog Devices' RF switch ADG902 [36] for the reflection and absorption of ambient Wi-Fi signals. Information data were generated as alternating one and zero, and coded using FM0 coding [8]. Then, the backscatter tag transmits coded bits at a bit rate of 20, 50, 100, and 200 kbps. The total number of Wi-Fi frames generated for each experiment was 500, where each of received Wi-Fi frame is represented as 14,000 signal samples. The performance metric is the bit error rate (BER) of information bits for various tag distances and bit rates. Figures 6 and 7 show the experimental setup, and the placement of the USRPs and the backscatter tag in the indoor environment of a small office. The USRPs were one meter apart from each other. The backscatter tag was placed in the middle of the USRPs and moved to eight different positions, each 0.5 m apart from the adjacent ones. All were at a height of 0.5 m from the ground. The tag's reflection gain (calculated as the ratio of the backscattered signal amplitude of the tag's reflection state to that of the absorption state, i.e., approximately |h 1 ρ + h 2 |/|h 2 | from Equation (1)) for different distances is given in Figure 8.    Figure 9 shows a signal trace of the experiment where the backscatter tag transmits the shown stream of bits at 100 kbps; each slot is 10 µs long and the Wi-Fi frame lasts 1.4 ms. Thus, the backscatter tag transmits up to 70 information bits (140 coded bits) on the frame. It also shows more details about where bit errors occur. In the raw samples of the received signal, it is hard to notice the amplitude patterns corresponding to the bit stream. After smoothing, the received signal now shows noticeable amplitude patterns. The bits with decoding error are shown as red in the figure; four bit errors occurred in the sliding method, one bit error occurred in the total mean method, and no bit error occurred in the pattern-based method. In slot 83, in which a bit error occurred for both threshold-based methods, the smoothed signal had a convex downward shape, but more samples were above both thresholds and demodulated as data one. On the other hand, the pattern-based method checks the two adjacent slopes. Since slope[83] is negative, the bit pair is judged as (1, 0), and data zero is the candidate for bit [83]. Since slope[84] is positive, the bit pair is detected as (0, 1); thus, both slopes confirm that bit[83] is data zero.   Figure 10 shows the comparison of BER results between decoding algorithms for different tag distances. In the figures, it is clearly shown that the proposed decoding algorithm outperforms threshold-based ones in most positions for all bit-rate cases. In particular, the proposed algorithm achieves a BER of 2.5e −4 , 1.1e −3 , 6.5e −3 and 5.7e −2 at 2.5 m for 20, 50, 100 and 200 kbps, respectively, which is a reduction by up to 93.2% from conventional ones. At 0 m, all algorithms achieved almost identical BER results since it has the best conditions for communication (except for the case of 200 kbps, where the proposed algorithm achieved BER reduction by 84.8%). The results show the trend that BER increases as the backscatter tag moves farther from the transmitter/receiver; we have the smallest BER at 0 m (at most, 8.7e −4 ) and higher BERs in farther positions from it. We also see that BERs at a higher bit rate are higher than those at a lower bit rate. The highest gain is achieved as reduction by 94.4% from the BER of the sliding method at 1 m.  In Figure 11 (1,0) and (0, 1) appear positive and negative, respectively, thus leading to wrong decoding results and high BER at 2.5 m. When the bit rate is doubled as 200 kbps, the slope distributions of different bit pairs become less distinguishable between them, as shown in Figure 12. We also observed that the slope values of 200 kbps were more dispersed than those of 100 kbps. This is because signal fluctuation is less filtered out due to a smaller smoothing window size.  Figure 13 shows the cumulative distribution functions (CDFs) of per-frame BER (calculated as the ratio of errored bits to the total number of backscattered bits on a Wi-Fi frame) (If we assume that the tag's packet is transmitted per Wi-Fi frame, this per-frame BER is readily converted into the packet error rate) for three different decoding methods with distances from 1 to 2.5 m (BER results at shorter distances are less problematic) at 100 kbps. As can be seen from the CDF results, transmission performance decreases as the distance of the backscatter tag becomes longer. As shown in the figure, the proposed algorithm enables the tag to transmit without any error for more than 80% of Wi-Fi frames at all distances. While threshold-based methods achieve similar results with the proposed algorithm at 1 and 1.5 m, they successfully decode data at most for or less than 40% of Wi-Fi frames at 2 and 2.5 m. Performance is degraded as the tag moves farther from the Wi-Fi transmitter and receiver since the signal's traversing path becomes longer.

Conclusions
In this paper, we proposed a pattern-based decoding algorithm for backscatter communications using ambient Wi-Fi signals. The proposed algorithm identifies the pattern of received signal samples, and is thus more robust against signal fluctuation with no need for tricky threshold configuration. Moreover, the pattern for a pair of adjacent bits is exploited, and the algorithm decodes a bit pair at a time, which enables the algorithm to make a decision on a bit from two patterns, and makes the decision more reliable against fluctuation. The experimental study with real Wi-Fi traffic demonstrated that the proposed algorithm has noticeable performance enhancement over conventional threshold-based decoding methods. The proposed algorithm can be combined with or extended for other techniques of a longer communication range, higher-order modulation, etc. to achieve higher overall performance.

Conflicts of Interest:
The authors declare no conflict of interest.

Abbreviations
The following abbreviations are used in this manuscript: wherej andȳ are obtained asj Therefore, the numerator of Equation (A2) is reduced to and the denominator is obtained as (A6)