## 7 Experiments
### Experimental Setup  
For both parts of the experiments, the artificial baseband signals were generated using the 5G Toolbox, Phased Array System Toolbox, and Communication Toolbox provided by MATLAB. The simulation parameters are shown in Table 1. The Tapped Delay Line TDL-E channel model (corresponding to Line of Sight propagation) was employed to simulate the multipath propagation phenomenon in indoor environments alongside Additive White Gaussian Noise (AWGN). The center carrier frequency and the frequency deviation correspond to the CTE, and the simulation also randomly generated the CFO between [\(-30\) kHz,\(+30\) kHz] using Gaussian distribution. The CFO values were chosen based on the empirical experiment in [49], which estimated that 99% of CFO values in Bluetooth were within such interval. The L-shaped array is composed of seven isotropic antennas, that is, four antennas for each ULA. This number of antennas is small, thus, it is reasonable for IoT devices. The distance between antennas is half of the Bluetooth signal wavelength. To measure the memory footprint (RAM and Flash), execution time, energy consumption, and accuracy, we employed a PCA10056 development kit that comes with an nRF52840 System-on-Chip (SoC) having an Arm Cortex-M4 of 64 MHz with a Floating-Point Unit (FPU). The SoC did not use an operating system or software layers. The hardware floating-point instructions and hardware floating-point linkage (_-mfloat-abi=hard_) were activated so the processor could fully operate the FPU. All devices of the nRF52 series have support for BLE, and although nRF52840 does not have Bluetooth Direction Finding capability, it is almost identical to other nRF52 and nRF53 devices that do have it. Notably, the nRF52 and nRF53 devices are a well-known series of constrained IoT devices developed by Nordic Semiconductor with a radio module of Bluetooth 5.1 or later versions and come with an Arm Cortex-M4 or Arm Cortex-M33 processor. Another popular one \begin{table}
\begin{tabular}{c c} \hline \hline \multicolumn{2}{c}{**Simulation Parameters**} \\ \hline Antenna array type & L-shaped array \\ \hline Antenna type and frequency ranges & Isotropic of 2 GHz–3 GHz \\ \hline Distance between antennas (\(\Delta\)) & \(\lambda\)/2 \\ \hline Frequency deviation (\(f_{\Delta}\)) & 250 kHz \\ \hline Carrier frequency offset (\(f_{o}\)) & [\(-\)30 kHz, +30 kHz] \\ \hline Center carrier frequency (\(f_{c}\)) & 2.4 GHz \\ \hline Sampling frequency & 1 MHz \\ \hline Channel model & TDL-E + AWGN \\ \hline Number of antennas & 7 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Simulation parameters in MATLAB. Figure 7: Overview of the experiment. is the EFR32 BG22 SoC series developed by Silicon Labs, which has the direction-finding capability, ARM Cortex-M33 with 76.8 MHz, up to 512 kB of flash, and 32 kB of RAM. Table 2 shows some SoCs with Bluetooth Direction Finding capability. The implemented solution used the single-precision floating-point (FP32), under IEEE 754-2008 specification, since the FPU of Arm Cortex-M4 does have support for FP32 only. Hence, floating-point operations with FP32 attain the fastest execution time as empirically shown in [34], and achieve the same accuracy as the other two floating-point formats. The half-precision floating-point (FP16) is another format employed by ARM processors; however, that format is used as a storage format only for Arm Cortex-M4. When operating in FP16, the processor promotes FP16 into FP32 before and demotes it after every calculation [50]. Those operations create a small overhead that could increase the Flash consumption and the execution time. A slower execution time may translate into more energy consumption. Another supported format is double-precision floating-point (FP64), but the FPU of Arm Cortex-M4 does not have support for FP64 at all. Thus, the C compiler emulates FP64 calculations [51; 52], and that emulation creates an excess of computations culminating in a substantial increment of execution time and Flash usage.