Calculate free-space path loss in Python

Overview

I calculated the free-space path loss using Python, so make a note to remember

Advance preparation

Only math is used, so if Python is included, nothing in particular

Purpose

Calculate free-space path loss in Python. The unit is ** dB ** What is free-space path loss?

Source


def freespace_loss(distance, frequency):
    #frequency is frequency(Hz)
    #distance is meters(m)
    light_speed = 300000000.0 # m/s
    return 20 * math.log10((4.0 * math.pi * distance)/(light_speed/frequency))

#Frequency 2 at a distance of 100 meters.For 412GHz
print freespace_loss(100, 2.412 * 1000000000) # => 80.0893182554 dB

Recommended Posts

Calculate free-space path loss in Python
Calculate mW <-> dBm in Python
Naturally sort Path in Python
File / folder path manipulation in Python
Get the desktop path in Python
Get the script path in Python
Try to calculate Trace in Python
Calculate the previous month in Python
Get the desktop path in Python
Project Euler # 15 "Lattice Path" in Python
Quadtree in Python --2
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Hashable in python
DirectLiNGAM in Python
LiNGAM in Python
Flatten in python
flatten in python
Try to calculate a statistical problem in Python
Try to calculate RPN in Python (for beginners)
Sorted list in Python
Daily AtCoder # 36 in Python
Clustering text in Python
Daily AtCoder # 2 in Python
Implement Enigma in python
Daily AtCoder # 32 in Python