# Finding Patterns in Signals Using Lossy Text Compression
## 6 Reverse Engineering Experiments
### Experiments on Toy Robots  
In this section we show experimental results on real data strings. These strings were obtained by recording communication signals from the remote controllers (RC) of a pair of toy robots: (i) The IR-UFO helicopter, which communicates through a 3-channel IR signal (yaw, pitch, and throttle). Such a remote controller contains two sticks: a one that can be rotated to four directions (higher/lower pitch, and higher/lower yaw) and another stick that can be rotated (only left and right for higher/lower throttle). (ii) The Lutema Avatar Hovercraft that has similar RC, but different communication protocol than the IR-UFO.  
**The ground truth.** After using our system, we verified the following protocol of IR-UFO which has a structure that is similar to the SYMA S107, as defined in Section 1, with the following changes.  
**Level I:** The IR light changes every 13 microseconds. **Level II:**\({}^{\text{ -}}0^{\text{ -}}=(175,A,200,B)\),\"\(1^{\text{ -}}=(350,A,375,B)\), and \(H=(2,(360,A,240,B))\). **Level III:** A stream of binary words, each consists of 30 bits followed by a list of 4000 \"A\" bits. The format of a word is  
\[\begin{split}&\text{package}(throttle,yaw,pitch,channel)\\ =&(1,H,2,\text{ -}0^{\text{ -}},1,throttle,1,\text{ -}1^{\text{ -}}1,channelOne,1,\\ &\text{ }\text{ }\text{  
\(W_{i}\) by their Hamming distance \(\operatorname{hamm}(W_{i},W)\); i.e., number of corresponding bits that are not the same. The average Hamming distance of the first \(j\leq m\) packages is then  
\[\operatorname{error}(j):=\operatorname{hamm}(W^{j},V_{j})=\frac{1}{j}\sum_{i=1 }^{j}\operatorname{hamm}(W,W_{j}).\]  
In practice, this error is proportional to the distance of the IR receiver sensor and the RC in Figure 2.  
**The error plots** are shown in Figure 3. The green curve shows the average Hamming distance \(\operatorname{error}(j)\) in the \(y\)-axis, over different number \(j\) of words (\(x\)-axis), together with its variance.  
**Recovery using Algorithm 2.** We run Algorithm 2\(m\) times using a call to \(Lossy(M_{j},\text{levels})\), where \(M_{j}\) is the Parikh matrix of \(V_{j}\) and \(\text{levels}=2\), and \(R_{j}\) is the output RRLE for each \(j=[1..m]\). Without noise, \(V_{j}=W^{j}\), and the output is \(R_{j}=(j,s^{*}(W^{*}))\) that corresponds to the string \(W^{j}=V_{j}=S(j,s^{*}(W^{*}))\). In practice, \(V_{j}\), unlike \(W_{j}\) is not periodic, but \(R_{j}\) (the recovered output signal) is expected to be \(j\)-periodic. The average error of the recovered string \(S(R_{j})\) is then  
\[\operatorname{ourerror}(j):=\operatorname{hamm}(W^{j},S(R_{j})).\]  
**Results of Algorithm 2** are shown in Figure 3. The blue curve shows the average Hamming distance \(\operatorname{ourerror}(j)\) in the \(y\)-axis, over different number \(j\) of words (\(x\)-axis). Since \(R_{j}\) is always periodic, the variance error between the recovered packages is zero.  
**Conclusions:** In Figure 3 we see, as expected by the analysis, that the recovery error decreases as Algorithm 2 is given more packages to learn from. On the contrary, the error of the \"memory-less\" thresholding approach does not reduce over time.