Skip to main content
. 2025 Jan 22;25(3):631. doi: 10.3390/s25030631
Algorithm 1: Extraction of Spatial Information Based on MPCs
Input: Q data files, each containing K sample points of I/Q data from both moving and stationary antennas at q-th (1≤q≤Q) different angular position.
Output: A .mat file with spatial angles Degrees and corresponding power values Power.
1. for each data file q=1 to Q do
2.   Read the file to extract the angular position θ0(k) and 2K corresponding I/Q samples from both the moving antenna reception h~1k and the stationary antenna reception h~2k.
3.   Store θ0(k) as the key and h~1k, h~2k as the value in the mapping table d{key}.
4. end
5. for each key in d do
6.   Extract the data h~1k and h~2k for K sample points, respectively.
7.   Compute the ratio hrk of h~1k to h~2k and store the result in the updated mapping table dupdtekey, with the calculation of hrk performed as follows:
  hrk=1K∑k=1Kh~1kh~2k.
8. end
9. for cos θ=−1 to 1, with a step size of 0.01 do
10.   for each key in dupdte do
11.   Calculate the received power P(θ) at spatial angle θ based on Equation (16).
12.   end
13.   Store the current angle θ in the array Degrees, and the corresponding power P(θ) in the array Power.
14. end
15. Save the arrays Degrees and Power as a .mat file for further analysis.