FSO Simulation Using MATLAB By: Mojtaba Mansour Abadi Date: 03 September 2018
FSO Simulation Using MATLAB By: Mojtaba Mansour Abadi Date: 03 September 2018
A Start
11
Fog/smoke,
Convert received Geometrical,
7 electrical signal Convert electrical
Ambient Light, and
into binary bits
3 signal into optical
Miscellaneous loss
signal
End A
Figure 1: System block diagram of the simulation procedure
The random binary bits or pseudorandom binary sequence (PRBS) represent any random input data
for the FSO system. These bits are generated using a uniform random number generator engine.
MATLAB function: randi.
1
FSO Simulation Using MATLAB Mojtaba Mansour Abadi
The generated bits 𝑃𝑅𝐵𝑆 are resampled so that each bit is represented by NoS sample. MATLAB
function: rectpulse. The value of NoS depends on the available memory and the time window over
which the train is assumed stationary. Obviously for high data rates or slow trains, larger number of
samples could be generated. If the train moves with the speed of 𝑣 over the distance of ∆𝑙 then it
takes 𝑇travel = ∆𝑙⁄𝑣 to finish the travelling. If the baud rate is BR = 1⁄𝑇𝑠 , where 𝑇𝑠 is the symbol
duration, then
𝑇travel ∆𝑙 × BR
𝑁𝑂𝑆 ≤ =
𝑇𝑠 𝑣
Knowing the average output optical power 𝑃𝑎𝑣𝑔 and extinction ratio 𝜀, The following equations are
used to calculate the high and low powers corresponding to bits 1 and 0 when implementing OOK
modulation:
2 𝑃𝑎𝑣𝑔
𝑃1 =
1
1+𝜀
2 𝑃𝑎𝑣𝑔
𝑃0 =
1+𝜀
∆𝑃 = 𝑃1 − 𝑃0
By multiplying the generated electrical signal 𝑆𝑒𝑙𝑒𝑐 from step 2 by ∆𝑃 and adding the required optical
power offset to accommodate the optical power average value, the optical signal at the transmitter
side is generated ∆𝑃 × 𝑆𝑒𝑙𝑒𝑐 + 𝑃𝑎𝑣𝑔 .
Once calculating the channel coefficients ℎ, the optical power generated from step 3 is multiplied by
the coefficients. The outcome is the optical received power at the receiver side. Depending on the
simulation purpose, the coefficient ℎ may be applied to varying optical signal 𝑃𝑠𝑖𝑔 or average optical
power 𝑃𝑎𝑣𝑔 part. If calculating BER is the target of the simulation, the received signal is ℎ × ∆𝑃 × 𝑆𝑒𝑙𝑒𝑐 .
However, if simulating a real system is desired the received signal would be ℎ × (∆𝑃 × 𝑆𝑒𝑙𝑒𝑐 + 𝑃𝑎𝑣𝑔 ).
To convert the received optical power to electrical signal, the responsivity of the photodiode as well
as the TIA gain are used.
2
FSO Simulation Using MATLAB Mojtaba Mansour Abadi
If the 𝑆𝑁𝑅 is given, by measuring the power of transmit signal in step 3, the required noise power 𝑃𝑛
is calculated. To generate the additive noise, random numbers are generated based on random normal
distribution 𝒩(0, √𝑃𝑛 ). MATLAB function: randn.
7 – Bit extraction
A threshold level is set based on the average value of the received electrical signal. By comparing the
midpoint of each received bit with the threshold, the received bit is determined to be 0 or 1. To
perform adaptive thresholding, the length of averaging is changed from the whole received signal to
smaller sections.
8 – Analysis
To perform the analysis, original transmit bits are compared to received bits, which leads to BER value.
MATLAB function: biterr.
Another parameter extracted from the received signal is the Q-factor. Having the electrical signal level
for bits 0 and 1, I can calculate Q-factor as
|𝑉1 − 𝑉0 |
Q − factor =
𝜎0 + 𝜎1
where 𝑉1 and 𝑉0 are the mean values of received electrical signal corresponding to bits 1 and 0,
respectively. While 𝜎1 and 𝜎0 are the standard deviation values of received electrical signal
corresponding to bits 1 and 0, respectively.
The electrical SNR value is also calculated based on the signal power and existing noise power. From
Section 3, the optical signal power is ∆𝑃 and at the receiver it results in voltage 𝑉sig defined as
𝑉sig = 𝐺 × 𝜂 × ∆𝑃
where 𝐺, and 𝜂 are transimpendace (TIA) gain, and responsivity, respectively. Knowing the load
impedance 𝑅Load the electrical signal power will be
(𝐺 × 𝜂 × ∆𝑃)2
𝑃sig =
𝑅Load
If noise equivalent power (NEP) of the receiver is given and the signal bandwidth BW is known, the
detector noise power is obtained as
𝑃det = NEP√BW
To take into account the background light and shot noise I have
𝑖𝑛2 = 2 × 𝑞 × 𝐼 × BW
where 𝑞 is the electron charge and 𝐼 is the induced current due to the noise. For background noise
𝐼bg = 𝜂𝑃bg , where 𝑃bg is the background illumination power. In case of shot noise, if the received
average optical power is 𝑃r then 𝐼sn = 𝜂𝑃r . Finally the noise power at the output of TIA will be
2𝑞𝜂𝐺 2 BW
𝑃𝑛 = (𝑃bg + 𝑃r )
𝑅load
3
FSO Simulation Using MATLAB Mojtaba Mansour Abadi
2𝑞𝜂𝐺 2 BW
𝑃noise = NEP√BW + (𝑃bg + 𝑃r )
𝑅load
Based on the fading type, different kinds of random numbers are generated. In our simulation,
turbulence and pointing errors are random phenomena. Different models are used to generate
channel coefficient for each. I will briefly explain each process below:
𝑋 = 𝒩(𝜇𝑥,turb , 𝜎𝑥,turb )
ℎ𝑡−𝐿𝑁 = exp(2𝑋)
MATLAB function: randn.
𝑋 = Γ(𝛼, 1)
𝑌 = Γ(𝛽, 1)
1
ℎ𝑡−𝐺𝐺 = 𝑋𝑌
𝛼𝛽
MATLAB function: gamma.
𝑋 = 𝒩(𝜇𝑥,𝑃𝐸 , 𝜎𝑗,𝑃𝐸 )
𝑌 = 𝒩(𝜇𝑦,𝑃𝐸 , 𝜎𝑗,𝑃𝐸 )
𝑟 = √𝑋 2 + 𝑌 2
2𝑟 2
ℎ𝑃𝐸 = 𝐴0 exp (− 2 )
𝑤𝑒𝑞
Once the values are generated, they are resampled to simulate the proper channel effect. If the bit
rate is 𝐷𝑅 after resampling the bits in step two, the sampling frequency will be 𝐹𝑠 = 𝐷𝑅 × 𝑁𝑜𝑆.
Typical channel temporal coherence for turbulence and pointing error is 1 – 1 msec. I pick 𝐹𝑓𝑎𝑑𝑖𝑛𝑔 =
500 Hz for our work. These values are used to resample fading effects to fit the whole signal. Two
possible options exist to do resampling, either doing staircase resampling or resampling by using
polyphaser anti-aliasing filter. MATLAB functions: rectpulse, and resample.
To confirm each model, the simulation results are compared with the available theory.
4
FSO Simulation Using MATLAB Mojtaba Mansour Abadi
𝜂𝐼0
BER = 𝑄 ( )
√2𝑁0
1 ∞ 𝑢2
where 𝑄(𝑥) = 2𝜋 ∫𝑥 exp (− 2
) 𝑑𝑢 is Q function. [1]
2 −1 𝛾2 1 𝑠2 𝛾2
2𝛾 Γ ( 2 + 2) exp ( 2 + 2𝜎𝑥2 𝛾 2 + 2𝜎𝑥2 𝛾 4 ) −
𝜎𝑠 𝜂𝐼0
2
BER = 2 × ( )
√𝜋(𝐴0 )𝛾 √2𝑁0
This BER formula is an asymptotic .approximation for large SNR values [2].
𝛾2
−𝑠 2
𝛽 1 𝑠 2
𝜎𝑠2 𝛼𝛽 𝛽
2𝛽−1 Γ ( 2 + 2) exp (− 2 + 2 ) (𝐴 )
2𝜎𝑠 2𝛽 − 2𝛾 0 −
𝛽
𝛽+1 𝜂𝐼0 2
BER = 2
× Γ( ) √𝜋𝛾 2 ( )
Γ(𝛼)Γ(𝛽) sin[(𝛼 − 𝛽)𝜋] Γ(−(𝛼 − 𝛽) + 1)|𝛾 − 𝛽|𝛽 2 √2𝑁0
This BER formula is an asymptotic .approximation for large SNR values [2].
In case, the receiver has an aperture with diameter of 𝑑s then for Gamma-Gamma model the
parameters will be:
2𝜋
𝑘=
𝜆
0.5
𝑑 = (𝑘𝑑s 2⁄4𝐿)
5
FSO Simulation Using MATLAB Mojtaba Mansour Abadi
2 0.49𝜎𝑅2
𝜎ln𝑋 = 7⁄6
⁄
(1 + 0.65𝑑2 + 1.11𝜎𝑅12 5 )
−5⁄6
⁄
0.51𝜎𝑅2 (1 + 0.69𝜎𝑅12 5 )
2
𝜎ln𝑌 = ⁄5
1 + 0.90𝑑2 + 0.62𝑑2 𝜎𝑅12
𝜎𝐼2 (𝑑s )
≈ [1 + 1.062𝑑2 ]−7⁄6
𝜎𝐼2 (0)
11 – Fog/smoke loss
Based on the visibility Vis and by using Kim model, 𝑞 parameter is defined [4]:
1.6, Vis > 50
1.3, 6 < Vis < 50
𝑞 = 1.6 × Vis + 0.34, 1 < Vis < 6
Vis − 0.5, 0.5 < Vis < 0.1
{ 0, Vis < 0.1
Having the laser wavelength 𝜆 (nm), the parameter 𝛽𝜆 in 1⁄𝑘𝑚 is defined as:
𝑙𝑛 0.02 𝜆 −𝑞
𝛽𝜆 = − ( )
Vis 550
And finally by using Beer’s lambert law, the fog/smoke loss will be:
11 – Geometrical loss
Geometrical or propagation loss for the elliptical beam is estimated based on the followings:
The geometry of the beam and receiver is considered the same as Figure 2.
6
FSO Simulation Using MATLAB Mojtaba Mansour Abadi
Vertical x
axis
Aperture
ψ
W(Z)
ρ L
Propagation
axis
Z z
Laser
y
Horizontal
axis
The geometrical loss of the aperture while the normalised intensity 𝐼𝑛 (𝜌; 𝑍) is given will be:
1
ℎGL = 𝐼𝑛 (𝜌; 𝑍) × 𝑇r × 𝐴Rx−apr × cos 𝜓 , 𝜓 ≤ AFOV
2
where AFOV, amd 𝑇r are full-angle angular field-of-view, and transmittance of the receiver aperture.
The angle 𝜓 is defined as the angle between the vector connecting laser to the aperture and the vector
normal to the aperture. I consider two radiation mechanism for the source, uniform and Gaussian. If
the laser is a multimode-propagation source, it can be approximated with a uniform pattern.
Otherwise a Gaussian propagation is considered.
A- Uniform radiation: when the intensity of the laser beam is uniform across the wavefront.
1
𝐼𝑛 (𝜌; 𝑍) =
𝜋 × 𝑤ℎ (𝑍) × 𝑤𝑣 (𝑍)
where 𝑃Tx is the total power of the beam; 𝑤ℎ (𝑍) and 𝑤𝑣 (𝑍) are beam radius along horizontal
and vertical directions, respectively.
𝑤ℎ (𝑍) = 𝑤0ℎ + 𝑍𝜃0ℎ
𝑤𝑣 (𝑍) = 𝑤0𝑣 + 𝑍𝜃0𝑣
𝑤0ℎ and 𝑤0𝑣 are beam radii at transmitter side along horizontal and vertical directions,
respectively. 𝜃0ℎ and 𝜃0𝑣 are beam divergence (1⁄𝑒 criterion) at transmitter side along
horizontal and vertical directions, respectively.
B- Gaussian radiation: the intensity profile is Gaussian.
2 2𝑥 2 2𝑦 2
(𝜌;
𝐼𝑛 𝑍) = exp (− − )
𝜋 × 𝑤ℎ (𝑍) × 𝑤𝑣 (𝑍) 𝑤𝑣 (𝑍)2 𝑤ℎ (𝑍)2
𝜆𝑍 2
𝑤ℎ (𝑍) = 𝑤0ℎ √1 + 𝜀ℎ ( )
𝜋𝑤0ℎ 2
𝜆𝑍 2
𝑤𝑣 (𝑍) = 𝑤0𝑣 √1 + 𝜀𝑣 ( )
𝜋𝑤0𝑣 2
7
FSO Simulation Using MATLAB Mojtaba Mansour Abadi
𝑤0ℎ 2
𝜀ℎ = 1 + 2
𝜌0 (𝑍)2
𝑤0𝑣 2
𝜀𝑣 = 1 + 2
𝜌0 (𝑍)2
3
𝜌0 (𝑍) = (0.55𝐶𝑛2 𝑘 2 𝑍)−5
12 – References