Performance Analysis and Software-Defined Implementation of Real-Time MIMO FSO With Adaptive Switching in GNU Radio Platform

In this paper, we provide the first software-based implementation of multiple-input multiple-output (MIMO) free space optical (FSO) link with the adaptive switching based on the software defined radio developed by GNU Radio software system, which emulates the real-time capability of the proposed scheme. We propose a switching mechanism to independently configure each transmitter and receiver, based on the channel state information provided at the transmitter via a feedback link and evaluate the link performance under atmospheric conditions such as fog and turbulence. We also validate the advantages of mitigating both the turbulence and fog in the proposed multiple input multiple output FSO system by means of numerical simulations and the developed GNU Radio software platform. We demonstrate that the proposed system can effectively operate in heavy fog with bit error rates (BER) within the range of 10<sup>−8</sup> to <inline-formula> <tex-math notation="LaTeX">$\sim 10^{-7}$ </tex-math></inline-formula> over link spans of 100, 200 and 300 m. Additionally the system has been shown to mitigate moderate turbulence over a 100 m link span with BER of <inline-formula> <tex-math notation="LaTeX">$\sim 10^{-7}$ </tex-math></inline-formula>.


I. INTRODUCTION
Over the next decade, the number of smart devices to be connected is expected to double, and consequently, the data traffic generated is predicted to increase a thousandfold [1].This rapid expansion of data generated will impose noticeable pressure on the bandwidth usage of current wireless networks.Therefore, the fifth and sixth generations (5G and 6G) wireless technologies are aiming to address the connectivity challenges associated with the future Internet of things (IoT) including people-to-devices communications, device-to-device communications, etc. by utilizing the emerging machine learning on a grand scale.As part of the 5G and 6G, to meet the spectrum congestion and ensure reliable connectivity with 99.999% link availability, the optical wireless communications (OWC) has been considered [1,2].OWC offers several advantages including a virtually unlimited licensed free bandwidth in the infrared band when compared to the overcrowded radio frequency (RF) spectrum, inherent security at the physical layer by confining the optical beams in restricted areas, optical fibre type high data rates, etc. could be adopted in certain applications, where RF-based systems cannot be effectively utilized [1].As a branch of OWC, the free space optical (FSO) systems have been deployed in short to long haul transmission links including the last-mile/meter access networks, building-to-building communications, video surveillance, broadcasting, and satellite-to-satellite communications, to name a few [1,3,4].
While the aforementioned examples probed the realistic applications of FSO, the link performance and the quality of service (QoS) of FSO systems are affected by the unpredictable atmospheric phenomena, especially turbulence and fog/smoke induced fading.This results in channel impairments and fluctuations of both the amplitude and phase of the propagating optical signals particularly over longer transmission link spans [1].To overcome this problem, several techniques, including multiple-input multiple-output (MIMO) and relay-assisted FSO systems have been proposed in the literature [4][5][6].Among the available techniques, MIMO is a reliable technology to realize spatial diversity and to alleviate the atmospheric turbulence induced fading and fog induced attenuation in long distance data transmissions [2].However, the fundamental characteristics of MIMO systems imposed challenges such as costly multiple transmitters (Txs) and the receivers (Rxs), as well as the complexity of hardware design and implementation when using high-speed optical devices (i.e., lasers, laser drivers, and photodetectors (PDs) [7].
In OWC, the optical beam can be modulated using either analogue or digital signals, and the evaluation of methods for different applications deserves the flexibility of softwaredefined radio (SDR).SDR provides a re-usable and futureproof platform by means of combining an RF-to-baseband transceiver physical layer and a digital smart processor.This offers many advantages including (i) softwareconfigurability and control; (ii) improved system performance with the efficient and flexible use of the RF spectrum to offer available new services to the users; (iii) a reduced system size and minimization of the design risk and time-to-market; and (iv) flexibility in research and development due to the implementation and verification of a range of newly developed protocols using the RF platformbased testbeds [8], [9].In [10][11][12], implementation of a MIMO system deploying universal software radio peripheral (USRP) for synchronization, beamforming in the RF domain using the SDR environment for all digital and low-cost systems were reported.
Highly flexible and powerful SDR platforms to accommodate 5G wireless networks have also been reported in the literature [13][14][15].Apart from highly reconfigurable software defined implementation in the RF domain, SDR has also attracted considerable interest in OWC systems for diverse applications.In [16], experimental evaluation and performance analysis of an indoor visible light communications (VLC) system with adaptive softwaredefined equalization using USRPs and LABVIEW was reported.The work reported validated the flexibility of LABVIEW software platform and the ability to improve the measured data simply by changing the software side of the testing prototype.LiFi systems in the range of visible, infrared (IR), and ultraviolet (UV) bands over a 20 m linkspan using LimeSDR USB and GNU Radio for research and development purposes to perform data transmission between two optical transceivers are also commercially reported [17].Validation of the IR optical front ends with a bandwidth of 10 MHz for USRPs for transmission of an audio signal was reported in [18].
In this work, we outline the design and implementation of out of tree (OOT) modules/signal processing blocks integrated into GNU Radio.Then we analyse the performance of a MIMO intensity modulation-direct detection FSO system with the adaptive switching using GNU Radio under various atmospheric conditions for realtime data transmission.To the best of the authors' knowledge, the proposed system is the first implementation of MIMO FSO in the SDR platform.We investigate the FSO link in the SDR environment and evaluate its performance in terms of the bit error rate (BER) performance under fog and turbulence conditions using GNU Radio.We show that, the proposed system (i) could effectively operate in heavy fog with a BER within the range of 10 -8 to ~ 10 -7 , for the link spans of 100, 200, and 300 m; and (ii) experienced a peak turn-over degradation following switching, with the BER of ~10 -7 and > 10 -4 for the moderate and high turbulence levels, respectively over 100 and 200 to 300 m.
The rest of the paper is organised as follows: Sections II and III describe the MIMO FSO system and provide all the design considerations including the adaptive switching mechanisms and implementation of MIMO FSO in the SDR/GNU-Radio environment.Section IV is devoted to the results and discussion on the measured data.Finally, Section V concludes the paper.

II. SYSTEM MODEL
In FSO systems, the link availability as a function of the transmission distance is an important factor, which can vary depending on the applications and geographical areas.Most FSO systems are used in the enterprise market (i.e., the last mile access networks), where, the link availability must meet the five-nine requirements (i.e., 99.999%) [19], [20].
The proposed system with OOT modules facilitates the implementation of N number of Txs and Rxs.In this work we consider a 4 × 2 MIMO FSO system as a proof of concept, see Figure 1.In this design, two sets of Txs and Rxs are used for parallel transmission of two different signals to achieve improved link reliability.A dedicated switching algorithm is proposed to switch on the Tx(s) based on the channel conditions.Each Tx and Rx operates independently or in a unified cluster.Fog and turbulence induced attenuation, and geometric losses are considered for assessing the link reliability.The considered key system parameters are given in Table 1.The Tx unit consists of 4-Txs (i.e., Tx-A1, Tx-A2, Tx-B1, and Tx-B2), which are grouped into two clusters of 2-Tx with each cluster transmitting different on-off keying (OOK) data streams i.e.,   () and   ().Note, at the Tx unit within the Tx switch module we have included threshold levels of  Atm(Thres) and  (Thres) 2 for the fog and atmospheric induced loss and intensity fluctuations, respectively to determine the operation mode using Log-normal and Gamma-Gamma turbulence models [21] [22].
Under normal weather conditions, two independent data streams are transmitted via Tx-A1 and Tx-B1.However, under fog or turbulence, additional Txs (i.e., Tx-A2 and Tx-B2) can be used provided the following conditions i.e.,  Atm (input) ≥  Atm (Thres) or  (input) 2 ≥  (Thres) 2 have been met.This is to ensure that the link availability will be maintained as much as possible at the cost of increased transmit power PTx.The intensity modulated optical beams are launched into the free space channel using optical lenses.At the Rx side, the received optical beams are focused on to two optical Rxs (i.e., Rx-A and Rx-B), which are composed the PD and trans-impedance amplifiers, via optical collimating lenses.The regenerated electrical signal is then applied to moving average filters, samplers, and threshold detectors (slicers) to recover the estimated version of the transmitted data stream.The bit error rate tester (BERT) is utilized subsequently to compare the received and transmitted data stream to determine the real-time BER.Note, (i) the parameters used and the link characteristics in terms of the channel loss (visibility V, scintillation index   2 , and refractive index structure parameter   2 for turbulence) are monitored using SDR/GNU Radio; and (ii) the extracted link characteristics and the received OOK signal are generated in the GNU Radio software domain.
A typical FSO system consists of the laser driver, laser source, additional Tx, and Rx optics, PD, and signal processing.Considering the FSO link with no interference, the received signal is given as: where x(t) is the transmitted signal,  is the photodetector responsivity and n(t) is the additive white Gaussian noise (AWGN) with variance   2 .Ii = -lIohi is the received signal intensity from the i th Tx, where Io is received signal intensity for the ideal channel, ℎ  is the channel irradiance, l is the link distance, and  is the weather-dependent attenuation coefficient (in dB/km) typically 0.43, 42.2 for the clear air and moderate fog, respectively [6].For an FSO link, the channel gain due to the atmospheric conditions is defined by ℎ  =  − [23].Note, weather attenuation as a function of wavelength  is given by [24]: where,   () and   () are the molecular and aerosol absorption coefficients, respectively, and   () is the molecular scattering coefficient.The last term represents the aerosol scattering coefficient due to fog attenuation which is provided to the Tx switch unit in the proposed system and is expressed as [24]: The received power can be expressed as a function of  Tx and the system losses, which is given by: )  Tx , where  Misc is the miscellaneous loss including the coupling losses (i.e., optics to fibre).The geometric and atmospheric losses are given, respectively by [26], [27]: Atm ( dB km ) = 4.343  (), where  tx and  rx are the Tx and the Rx aperture diameters in meters, respectively and  is the Tx beam divergence.For varying thermal expansion in the channel, the scintillation index, which is used to estimate the turbulence effect, is given as [28]: where 〈. 〉 denotes the ensemble average equivalent to longtime averaging with the assumption of an ergodic process and I is the irradiance of the optical beam.The Rytov variance used for determining the strength of turbulence and is given by [28] : The strength of turbulence can be classified as weak (  2 < 1), moderate (  2 ≌ 1), and strong (  2 > 1) [20].For weak to    Tx-A1, Tx-B1, Tx-A2, Tx-B2 moderate turbulence, we can assume that   2 =   2 .Note, k is the wave number, and the refractive index structure parameter is expressed as [29]: where P is the atmospheric pressure in mbar, T is the temperature in Kelvin, and  refers to the thermal difference between two points separated by a distance r.
Assuming that, the transmitted and received signals of the proposed MIMO FSO system are uncorrelated [30], we numerically calculate the separation space between the Txs and the Rxs, which must exceed the correlation length   ≈ √λ .The correlation coefficient as a function of the separation distance  between the Txs is given by [31]: Using ( 3), ( 4), and ( 7),  Atm is estimated for a range of V from 20 km to 1 km.Using ( 8) and ( 9),   2 is determined for   2 of 10 -17 to 10 -11 , which are then adopted in the system simulation to evaluate the link performance in terms of the BER and therefore to determine  Atm(Thres) and  (Thres)

2
, where BER range is ~10 -5 to ~10 -3 .For the link with fog and based on the numerically simulated  Atm for a given V and l, selection of the Txs to used is carried out, as outlined in Table 2. Table 3 outlines the number of Txs used under turbulence for the link spans of 100, 200, and 300 m in the MIMO FSO system.Note,   2 and   2 are estimated to attain the upper limit forward error correction (FEC) BER of 3.8 × 10 -3 .

III. IMPLEMENTATION OF MIMO FSO IN GNU RADIO/SDR
To investigate the performance of the proposed MIMO FSO system, we have implemented the SDR-based Tx, Rx, and the channel in GNU Radio, as well as a general-purpose processor (GPP)-based real-time signal processing framework.The GNU Radio can also work as a simulation environment without the need for real devices.Note, GNU Radio applications are commonly written in Python language as a package and are combined with digital signal processing (DSP) blocks integrated within GNU Radio and implemented in C++ to perform critical signal processing tasks [32].Figure .2 shows the MIMO FSO system implementation in the GNU Radio domain, which is composed of a Tx, a channel, and a Rx.At the Tx, a pseudo random sequence of binary data in the OOK format at the output of the signal generator is applied to the throttle module, which is used to avoid CPU congestion following real time simulation.The outputs of Throttles are applied to (i) the virtual sink modules; and (ii) the MIMO-Tx module.The output of which are applied to virtual sink modules.In addition, the outputs of the virtual sources, which represent the feedback data on atmospheric loss  Atm (input) in dB and turbulence strength  (input) 2 from the channel, are applied to the MIMO-Tx.The outputs of the

IV. RESULTS AND DISCUSSION
We have investigated the implementation of MIMO FSO in SDR using the GNU Radio environment.The objective is to monitor and control the proposed system using a software platform without the need for changing the hardware platform and by only updating the software.Implementation of MIMO FSO utilizing the OOT DSP blocks, which is built from scratch, not only satisfies the purpose but also demonstrates real time system performance evaluation.It also has the potential of experimental implementation on the fly due to direct communications with the SDR platform.Here, we have considered a clear channel (i.e., with V of 20 km),  Tx of 10 dBm, 0 dB channel loss, and additional losses including  Geo that are assumed to be low.Using the flow chart shown in Figure 4, we have carried out a simulation to determine the BER as a function of V for single FSO, MIMO FSO, and proposed FSO links with a range of 100, 200, and 300 m under turbulence and fog conditions.As shown in Figure 5(a), MIMO FSO outperforms the single FSO link for V < 18 km and particularly at lower values of V.At the FEC limit, MIMO FSO meets the BER criteria for all values of V in contrast to the single FSO link where the minimum V is 2 km with BER of 1.9 × 10 -2 .For the proposed FSO link, the BER pattern follows the single FSO plot until V of 3km, beyond which the BER drops down to the MIMO FSO link level with BER of ~ 10 -9 , which is due to turning on additional Txs (i.e., Tx-A2 and Tx-B2) as was explained in the previous section.Note, for the MIMO FSO link, the BER is flat beyond V of 4 km.We observe the same patterns for the BER as in Figure 5 (a), for the 200 and 300 m link as depicted in Figures 5 (b) and (c), except for the switching taking place at V of 6 and 9 km where the BER values are 1.3 × 10 -3 and 7.4 × 10 -4 , respectively.After turning on additional Txs, BER of the 200 and 300 m proposed FSO links improve to 1.6 × 10 -9 at V of 5 km and 5 × 10 -9 at 8 km, respectively.Also observed are the BER plot for the MIMO FSO link, which is almost constant (i.e., 10 -9 ) at V > 5 and 10 km in Figures 5 (b) and (c), respectively.calculated Additionally.The beam spot sizes of 17.5 and 34.9 mm in 100 and 200 m, respectively, are smaller, compared to  Rx .Therefore,  Geo is not considered.Due to the beam spot size of 52.4 mm, additional  Geo of 1.2 dB is introduced in 300 m link.to 1.6 × 10 -9 at V of 5 km and 5 × 10 -9 at 8 km, respectively.Also observed are the BER plot for the MIMO FSO link, which is almost constant (i.e., 10 -9 ) at V > 5 and 10 km in Figures 5  (b) and (c), respectively.calculated Additionally.The beam spot sizes of 17.5 and 34.9 mm in 100 and 200 m, respectively, are smaller, compared to  Rx .Therefore,  Geo is not considered.Due to the beam spot size of 52.4 mm, additional  Geo of 1.2 dB is introduced in 300 m link.Note that, for all three systems, the estimated BER is above the FEC limit for   2 < 0.02, therefore,  (ℎ) 2 was set at ≤ 0.02.The systems were then simulated under weak to moderate turbulence (i.e., 10 -11 <   2 < 10 -17 ) to determine the BER performance as illustrated in Figure 6 for all three systems and link spans of 100, 200, and 300 m.In these plots, we also observe the same pattern as in Figure 6, with the BER of the 100 m proposed FSO link following the single FSO link plot for   2 of 10 -13 m -2 3 ⁄ , beyond which the BER improves considerably, reaching the level in MIMO FSO link at   2 of 10 -12 from 10 -4 to 2.5 × 10 -8 , see Figure 6 (a).This improvement in the BER performance is due to switching additional Txs of Tx-A2 and Tx-B2.In Figure 6 (b), the switch-over in the BER plot for the proposed link is at   2 < 10 -14 dropping down to the BER of 10 -8 at   2 < 10 -13 and then increasing with   2 .Finally, in Figure 6(c), for the proposed system the BER changes over from 10 -3 to 3.210 - 9 at   2 of 10 -14 to 10 -13 , respectively.Note, for (i) both MIMO FSO and proposed FSO links the BER floor level is ~ 10 -9 for   2 > 10 -13 ; and (ii) the 200 and 300 m long MIMO FSO link performance is deteriorated more under turbulence effects (i.e.,   2 > 10 -13 ).

V. CONCLUSION
In this work, we have demonstrated a real-time SDR/GNU Radio implementation of a MIMO FSO link with adaptive switching and investigated its performance under different atmospheric conditions.We made the bit-by-bit comparison with the BERT, a signal processing block in GNU Radio.It was shown that, the proposed switching mechanism mitigated the fog and turbulence induced attenuation effectively for range of transmission link spans.We outlined that, the proposed MIMO FSO system with switching technique could effectively operates in heavy fog with a BER within the range of 10 -8 to ~ 10 -7 , for the link spans of 100, 200, and 300 m.Additionally, the proposed FSO links experienced a peak turn-over degradation after switching, with BER > 10 -4 beyond   2 of 10 -12 in 200 m and 10 -13 in 300 m respectively, hence, cannot mitigate moderate turbulence effectively, whereas in 100 m link, the proposed system can mitigate moderate turbulence with BER of ~10 -7 .We concluded that, (i) in MIMO FSO, parallel transmission of the same data effectively mitigates fog induced attenuation; and (ii) switching on additional Txs overcomes the weak turbulence effect.

Figure 2 .
System implementation for: (a) Tx with fog and turbulence, (b) channel with the additive white gaussian noise, and (c) the Rx with real time BER estimation.

Figure 3 .
Figure 3. OOK waveforms at the: (a) Tx Link A, (b) Tx link B, (c) optical Rx for a clear channel, and (d) Tx Link A, (e) Tx link B, and (f) optical Rx for an un-clear channel.

Figure 5
Figure 5 depicts the BER plots for the three systems for the link range of 100, 200, and 300 m under the fog condition.As shown in Figure5(a), MIMO FSO outperforms the single FSO link for V < 18 km and particularly at lower values of V.At the FEC limit, MIMO FSO meets the BER criteria for all values of V in contrast to the single FSO link where the minimum V is 2 km with BER of 1.9 × 10 -2 .For the proposed FSO link, the BER pattern follows the single FSO plot until V of 3km, beyond which the BER drops down to the MIMO FSO link level with BER of ~ 10 -9 , which is due to turning on additional Txs (i.e., Tx-A2 and Tx-B2) as was explained in the previous section.Note, for the MIMO FSO link, the BER is flat beyond V of 4 km.We observe the same patterns for the BER as in Figure5(a), for the 200 and 300 m link as depicted in Figures5 (b) and (c), except for the switching taking place at V of 6 and 9 km where the BER values are 1.3 × 10 -3 and 7.4 × 10 -4 , respectively.After turning on additional Txs, BER of the 200 and 300 m proposed FSO links improve to 1.6 × 10 -9 at V of 5 km and 5 × 10 -9 at 8 km, respectively.Also observed are the BER plot for the MIMO FSO link, which is almost constant (i.e., 10 -9 ) at V > 5 and 10 km in Figures5 (b) and (c), respectively.calculated Additionally.The beam spot sizes of 17.5 and 34.9 mm in 100 and 200 m, respectively, are smaller, compared to  Rx .Therefore,  Geo is not considered.Due to the beam spot size of 52.4 mm, additional  Geo of 1.2 dB is introduced in 300 m link.to 1.6 × 10 -9 at V of 5 km and 5 × 10 -9 at 8 km, respectively.Also observed are the BER plot for the MIMO FSO link, which is almost constant (i.e., 10 -9 ) at V > 5 and 10 km in Figures5 (b) and (c), respectively.calculated Additionally.The beam spot sizes of 17.5 and 34.9 mm in 100 and 200 m, respectively, are smaller, compared to  Rx .Therefore,  Geo is not considered.Due to the beam spot size of 52.4 mm, additional  Geo of 1.2 dB is introduced in 300 m link.

Table 2 . The number of Txs used as
a function of l, V and   under the fog condition.

Table 3 . The number of Txs used as a function of l,
and    under the turbulence condition.