Skip to main content

This is a Python package for the implementation of various equations of Free Space Optical Communication

Project description

Freesopy

A Python package for the implementation of various equations of Free Space Optical Communication


Freesopy is designed to simplify the implementation of various mathematical equations used in Free Space Optical Communication. It provides easy-to-use functions that can be integrated into your projects.

Structure

Create at least 4 seperate python files in same directory :

  1. main.py
  2. transmitter.py
  3. reciever.py
  4. environment.py

transmitter.py

xt =          # location of transmitter
yt =          # location of transmitter
zt =          # location of transmitter
p_t =         # transmitted power
d_t =         # diameter of transmitter antenna
theta_d =     # angle of divergence
w_0 =         # initial beam waist
theta_semi =  # Semi-angle at half power of the LED's radiation pattern (in degrees)

receiver.py

xr =                 # location of receiver
yr =                 # location of receiver
zr =                 # location of receiver
d_r =                # aperture diameter of receiver
p_r =                # power received by receiver
n_0 =                # noise power
T =                  # temperature of receiver
B =                  # Bandwidth
r_load =             # Load resistance
i_photo =            # Photocurrent
i_shot_squared =     # Shot noise squared
i_thermal_squared =  # thermal noise squared
Adet =               # Detector physical area of the photodetector (PD) (in square meters)
Ts =                 # Gain of an optical filter
index =              # Refractive index of the lens at the photodetector.
FOV =                # Field of View (in degrees) of the receiver.

environment.py

lx =              # dimensions of room 
ly =             # dimensions of room 
lz =            # dimensions of room 
wl =              # wavelength 
sigma_s =        # standard deviation due to scintillation 
f =              # frequency 
d_range =        # Tuple defining the minimum and maximum distance in metres 
num_points =      # Number of distance points to generate 
rho =            # Reflection coefficient of the walls, representing how much light is reflected. 
delta_t =        # Time resolution in nanoseconds 

Usage

You can import Freesopy and the python files containing information about Transmitterr(transmitter.py),reciever(reciever.py) and Environment(environment.py) in your main.py file as:

import freesopy as fso
from transmitter import *
from receiver import *
from environment import *

Some General Equations

Calculate Received Power

Power_received = fso.calculate_received_power(P_t, D_r, d)

Calculate SNR

SNR = fso.calculate_snr(P_r, N_0)

Calculation of Losses

Misalignment Loss

misalignment_loss = fso.pointing_misalignment_loss(d, sigma_p, pt)

General Graphs and Calculations

SNR Calculations

I_photo = fso.calculate_photocurrent(P_received, responsivity)

I_thermal_squared = fso.calculate_thermal_noise(T, B, R_load)

I_shot_squared = fso.calculate_shot_noise(I_photo, B)

SNR = fso.calculate_SNR(I_photo, I_shot_squared, I_thermal_squared)

fso.plot_SNR(P_received, SNR)

Free Space Path Loss (FSPL)

fso.plot_fspl(f, d_range, num_points)

Divergence of Optical Beam

fso.plot_beam_divergence(w_0, lambda_light, d_range, num_points)

Channel Modelling

Simulating the LOS channel gain

fso.los_channel_gain(theta, P_total, Adet, Ts, index, FOV, lx, ly, lz, h, XT, YT)

Plotting the Optical Power Distribution in a Diffuse Channel

fso.optical_power_distribution(P_total, rho, lx, ly, lz, FOV, Adet, Ts, G_Con, theta)

Simulation of the Drms of a Diffuse Channel

fso.calculate_Drms_3D(C, theta, P_total, Adet, rho, Ts, index, FOV, lx, ly, lz, delta_t)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

freesopy-2.0.1.tar.gz (6.3 kB view details)

Uploaded Source

File details

Details for the file freesopy-2.0.1.tar.gz.

File metadata

  • Download URL: freesopy-2.0.1.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for freesopy-2.0.1.tar.gz
Algorithm Hash digest
SHA256 65c12ed2fa0f49a41652b1791e6091c16b144cb0bf4e7f908685c3146aa2bfab
MD5 858156f24a68b8adfcfea0c6f615d4fe
BLAKE2b-256 8d4c0aa9f0c0ed1130052a922e2142808a13e89c1ba840f39d64dcee80d3eccd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page