loic-fejoz / pyrf-budget-toolbox

a python toolbox for RF signal chain budget analysis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RF Budget Toolbox

A simple python toolbox for RF Budget Analysis.

Objectives are:

  • for me to understand the formulas,
  • having something visual to play with under Jupyter Notebook,
  • having an open source alternative to commercial products

Features

  • Gain
  • SNR
  • OIP2
  • OIP3
  • Free space loss
  • SVG export with SchemDraw
  • Visual rendering under Jupyter Notebook
  • Interactive Jupyter Notebook

Examples

Some examples can be found in their own repository but also in unit tests.

superheterodyne ADSB

But to start with, here is a simpler one. Let's imagine you have one filter with one 1dB loss, and an amplifier with 10dB of gain, but 3dB of noise figure. How is it best to sequence them?

filter then LNA LNA then filter

from rfbudget import *

the_filter = Loss(name="filter", loss=dB(1))

a1 = Amplifier(
    name='LNA',
    gain=10,
    nf=3,
)

Let's do the first computation:

b1 = budget(
    elements=[the_filter, a1],
    input_freq=MHz(144),
    available_input_power=0,
    signal_bandwidth=kHz(1),
    without_oip=True
)

b1.display()

It will display:

rfbudget with properties:
Elements: [1x2 rf.internal.rfbudget.Element]
InputFrequency: 144000000.0 Hz
AvailableInputPower: 0  dBm
SignalBandwidth: 1000.0 Hz
Solver: Friis

Analysis Results
ThermalNoise:    (dBm)    -143.97722915699808
OutputFrequency: (Hz)    [144000000.0, 144000000.0]
OutputPower:     (dBm)   [-1, 9]
TransducerGain:  (dB)    [-1, 9]
Noisefigure:     (dB)    [1.0000000000000002, 4.0]
SNR:             (dB)    [142.97722915699808, 139.97722915699808]
ChannelCapacity: (bps)   [47496.007446578056, 46499.42901811185]

It returns a noise figure of 4dB at the output. Similarly one can compute, the other sequence and get 3dB. Obvious result for those in the field but nice to compute and understand. ;-)

Source of inspiration

Commercial products alternatives

About

a python toolbox for RF signal chain budget analysis

License:MIT License


Languages

Language:Python 100.0%