## 5 Design and Implementation of Sing-Ant
Whilst the results are pseudo-periodic, there is visible randomness. Due to the great interference brought by complex indoor channel environments to the wireless signal propagation, the RSSI value of tags appears to undergo random fluctuations [20]. When collecting the tag data and preparing to place them into our calculation matrices, it is necessary to account for unsuccessful tag read events. These are events whereby there is no RSSI value returned after an antenna beam has been activated and eventually deactivated. Null values can be handled in three ways depending on preference. They are listed as follows: omission, zero padding and infinity padding. Omission simply requires the removal of all the data with missing values and instead using only fully read antenna matrices. Zero padding works by replacing the missed RSSI values with zero instead when they are not read. In infinite padding, if there is no read event, then a large number is used instead; the number has to be large enough to render the Euclidian distance value trivial. Figure 4: Card filter implementation. Figure 5: Received RSSI values (**left**) and filtered RSSI values (**right**). In order to calculate multiple scenarios at one time, we wait for one cycle to complete and then record all the entries from one RFID reader cycle consisting of all the reference tags, target tags and their respective antenna beam RSSI value; the ideal resultant matrix would be split into two. The first matrix shows the antenna beam number and the RSSI of the reference tag. \[S= \begin{bmatrix}S_{11}&S_{11}&\cdots&S_{1A}\\ S_{21}&S_{22}&\cdots&S_{2A}\\ \vdots&\vdots&\vdots&\vdots\\ S_{M1}&S_{M2}&\cdots&S_{MA}\end{bmatrix}  \tag{5}\]  
Defining the signal strength of the tag to be tested as a matrix \(S\), \(S_{ij}\) (\(i\) = 1, 2... \(M\), \(j\) = 1, 2... \(A\)) represents the RSSI value of tag \(i\) to be located and read by the antenna \(j\)[2]. The actual targets will also have their own matrix, mapped out in a similar nature to the original shown here. Therefore, in the event of having only one antenna tag as the target, it will be a vector matrix instead. This will be a regular occurrence, especially when trying to locate only one tag. Lastly, the matrix will appear as shown below:  
\[\theta= \begin{bmatrix}\theta_{11}&\theta_{12}&\ldots&\theta_{1A}\\ \theta_{21}&\theta_{22}&\ldots&\theta_{2A}\\ \vdots&\vdots&\vdots&\vdots\\ \theta_{N1}&\theta_{N2}&\ldots&\theta_{NA}\end{bmatrix}  \tag{6}\]  
Defining the signal strength of the reference tag as a matrix \(\theta_{ij}\) (\(i\) = 1, 2, \(N\), \(j\) = 1, 2,... \(A\)) represents the RSSI value of the reference tag \(i\) read by the antenna \(j\)[5]. We then followed up with the standard LANDMARC protocol for calculating the Euclidian distances and the value with the lowest figures represents the reference tag that is closest to our target tag. However, this is merely the beginning of our calculative process. Consequently, we need to optimize it for range and also direction, so we set antenna clusters and sectors in order to narrow down and fine tune the actual location and also attain better precision with less tags and a wider range. Thus, for the second phase of calculations, we assume that our input values are a row in a matrix \(T\) that contains all the Euclidian distances for the target matrix. For all reference points, we can have a corresponding matrix as shown. For example, if we have 5 reference points, then we can use 5 matrices representing this antenna beam, landmark and target tag matrix. By comparing the relationships and values between each antenna and the reference tags, we can assess the location of the tags by using similar amounts of reference tags. \[T= \begin{bmatrix}T_{11}&T_{12}&\cdots&T_{1N}\\ T_{21}&T_{22}&\cdots&T_{2N}\\ \vdots&\vdots&\vdots&\vdots\\ T_{M1}&T_{M2}&\cdots&T_{MN}\end{bmatrix}