# Fuzzy Logic-Based Performance Enhancement of FSO Systems Under Adverse Weather Conditions
## 3 Fuzzy Modeling for Enhancing Receiver Performance in FSO System
### Motivation and Architecture of the FLC-Based Adaptive Receiver for FSO-OCDMA Systems  
Passive optical networks (PONs) are potentially used in last-mile point-to-multipoint broadband access communication systems due to their high bandwidth as well as low cost. In rural areas with low population density and areas with some obstacles, installing optical fibers becomes a complex or impractical process. The FSO system is considered as a practical solution to address this problem [23]. However, the problem of ensuring a reliable connection is particularly challenging in adverse weather conditions in the FSO  
Figure 2: Fuzzy logic model.  
system [24]. For some factors, such as rain, fog, and the distance between the transceivers, the quality of the optical signal drops, which increases the bit error rate (BER). To mitigate these factors, it is necessary to implement a dynamic adjustment of the BER threshold to ensure optimal communication performance. The dynamic BER threshold is a continuously adjustable factor that determines the acceptable level of errors in the transmitted signal. Unlike a static threshold, which remains fixed regardless of environmental conditions, a dynamic threshold adapts to real-time changes in the surrounding environment. This adaptability is crucial, as different conditions may necessitate varying levels of tolerance for error. To obtain this dynamic adjustment, a fuzzy control system can be employed. A fuzzy logic controller (FLC) will consider the parameters, including OCDMA code properties, intensity of rain, fog density, and distance between the devices to establish reliable optical transmission. These inputs are categorized into fuzzy sets, such as very low, low, medium, and high, which enables the system to interpret real-world conditions more effectively.  
The OCDMA-PON network architecture based on FSO with the integrated control fuzzy system at the receiver is displayed in Figure 3 under rainy weather conditions. A similar architecture is used for foggy weather conditions, where the rain sensor is replaced by a fog sensor [17].  
In this work, the transmitter utilizes a conventional encoder in which the SSM SAC-OCDMA system is adopted [25], while each receiver employs an OCDMA decoder equipped with a dynamic threshold device controlled by our proposed control fuzzy system. In the proposed FLC system, we assumed that the data related to the weather conditions are provided by external sensors placed along the network, and we use a similar method as in [26]. The proposed FLC dynamically adjusts the detection threshold level due to weather condition variations. In particular, the dynamic threshold should be inversely proportional to the SNR, increasing for low SNR (poor signal) and decreasing for high SNR (good signal).  
Figure 4 shows the block diagram of the proposed FLC system. It includes four main components, i.e., the fuzzification interface, a rule base, an inference mechanism (which acts as the decision logic), and the defuzzification interface. The Mamdani fuzzy model [22] serves as the foundation for the proposed FLC-PSO approach in this work, which involves two inputs and one output parameter (dynamic BER threshold). These input parameters are rainy (mm/h) and foggy (g/m\({}^{3}\)) weather conditions estimated presumably by external  
Figure 3: OCDMA-PON-architecture-based FSO transmission: with FLC under rainy weather condition.  
sensors along the distance L (km) between each transceiver unit. The output parameter specifies an adjusted threshold (Fuzzy\({}_{T-BER}\)) set by the FL controller, which enables fine-tuning of the receiver unit.