## 3 RSS-Based DoA Estimation for Two-Row ESPAR Antenna
### Generalized PPCC-MCP Algorithm for Two-Row ESPAR Antenna  
The vector form of the PPCC algorithms in Equations (2) and (3) is appropriate for implementation in a WSN node's microcontroller to compute DoA estimation based on RSS measured for incoming packets. It is also straightforward to use such a node with ESPAR antennas having different number of directional radiation patterns or other switched beam antennas [28]. However, it is possible to create many different directional radiation patterns in ESPAR antennas and also patterns that do not have a clearly shaped directional beam. For an ESPAR antenna having 12 passive elements designed for vehicle-to-everything (V2X) applications in 802.11p frequency band, due to performance of microwave switches used at the terminals of passive elements in 5.9 GHz frequency band, it was possible to form 5 different directional radiation patterns types [32] having different beam parameters in the horizontal plane, e.g., gain, HPBW and sidelobe level (SLL), as well in the vertical plane. As every radiation pattern type can be rotated in the horizontal plane to form 12 directional beams, PPCC and PPCC-MCP algorithms can successfully be used in RSS-based DoA estimation [33]. Unfortunately, although such estimation could involve different radiation pattern types in a single estimation, to further increase the overall accuracy, appropriate and convenient PPCC-MCP algorithm formulation has not been created so far. Similarly, among 18 available two-row ESPAR antenna radiation patterns, there exist 6 groups having similar main beam direction in the horizontal plane with differences radiation pattern shape in elevation.  
To perform RSS-based DoA estimation based on radiation patterns available for two-row ESPAR antenna, one has to create a generalized PPCC-MCP algorithm that can easily be implemented within simple WSN nodes and involves all possible radiation patterns. Due to their spatial characteristics, it is possible to increase the overall accuracy of the estimation while mitigating the necessity of correct placement of calibration planes. As the two-row ESPAR antenna radiation patterns, which are created using associated steering vectors \(V^{n}\), exhibit certain spatial performance, including gain, SLL, direction of maximal radiation and HPBW, in both horizontal and vertical directions, we propose rewriting Equation (3) in the following general form:  
\[g_{\theta_{ALL}}=\frac{\sum_{n=1}^{N}\left(p_{\theta_{ALL}}^{n}\ Y(V^{n}) \right)}{\sqrt{\sum_{n=1}^{N}\left(p_{\theta_{ALL}}^{n}\circ p_{\theta_{ALL}}^ {n}\right)\sqrt{\sum_{n=1}^{N}Y(V^{n})^{2}}}} \tag{4}\]  
Total number of radiation patterns used in the DoA estimation and \(n=\{n_{1},\ n_{2},\ \ldots,\ n_{N}\}\) are numbers of chosen steering vectors \(V^{n}\) associated with specific two-row ESPAR antenna radiation patterns \(p_{\theta_{ALL}}^{n}\). Since \(\theta_{ALL}\) means that all \(M\) = 90 possible angles in elevation direction, namely \(\{\theta_{1}=90^{\circ},\ \theta_{2}=89^{\circ},\ \ldots,\theta_{90}=1^{\circ}\}\), are used as calibration planes, a high-precision turntable in the anechoic chamber is required. In consequence, vectors \(p_{\theta_{ALL}}^{n}\), \(g_{\theta_{ALL}}^{n}\), \(\varphi_{\theta_{ALL}}\) will be much longer with the total length _I-M_ = 32400, which will make PPCC-MCP calculation more time consuming. However, the overall DoA estimation accuracy of the proposed generalized PPCC-MCP algorithm is no longer dependent on the choice of number and placement of calibration planes. Therefore, the overall DoAestimation accuracy will not be affected when RF signals impinging on the antenna arrive from arbitrary \(\theta\) angles.