Skip to main content

rf-bench-drivers-utils

Pure RF math utilities for bench instrument automation. Part of the rf-bench-drivers family of packages.

Install

pip install rf-bench-drivers-utils

Import

from rf_bench.utils import dbm_to_vpp, thermal_noise_floor, format_freq

What's in the box

rf_bench.utils is a single module (rf_utils.py) of pure functions. No instrument connections, no side effects, numpy is the only dependency.

Category Key functions
Power / voltage dbm_to_vpp, vpp_to_dbm, dbm_to_vrms, vrms_to_dbm, dbm_to_watts, watts_to_dbm, dbm_to_uv, uv_to_dbm
Power ratio / extended dB db_to_linear, linear_to_db, db_to_voltage_ratio, voltage_ratio_to_db, dbm_to_dbw, dbw_to_dbm, dbm_to_dbuv, dbuv_to_dbm
Impedance / reflection rl_to_vswr, vswr_to_rl, gamma_to_vswr, vswr_to_gamma, rl_to_gamma, gamma_to_rl, vectorized variants
Noise / dynamic range thermal_noise_floor, noise_figure_from_mds, mds_from_noise_figure, ip3_from_imd, ip3_to_dynamic_range, cascaded_noise_figure, noise_temp_to_nf, nf_to_noise_temp
Propagation / antenna wavelength, quarter_wave, half_wave, freespace_path_loss
Passive components capacitive_reactance, inductive_reactance, lc_resonant_freq, l_from_resonant, c_from_resonant, q_factor, bw_from_q, parallel_resistance, voltage_divider, skin_depth
Attenuator design pi_attenuator, t_attenuator
IM products intermod_products
S-meter s_unit_to_dbm, dbm_to_s_unit
Frequency formatting format_freq, format_freq_short
Standard value series nearest_rbw, nearest_value, SIGLENT_RBW_SERIES, E12_SERIES, E24_SERIES, E48_SERIES, E96_SERIES
Two-channel measurement dominant_frequency, gain_phase_from_fft, complex_impedance_series

All functions default to 50 Ω reference impedance where applicable. Frequencies are in Hz throughout; use format_freq() for human-readable display.

Quick examples

from rf_bench.utils import (
    dbm_to_vpp, thermal_noise_floor, rl_to_vswr,
    cascaded_noise_figure, pi_attenuator, format_freq,
)

# 0 dBm into 50 Ω
print(dbm_to_vpp(0))           # 0.6325 Vpp

# Thermal noise floor at 500 Hz bandwidth
print(thermal_noise_floor(500))  # -143.0 dBm (approx)

# Return loss to VSWR
print(rl_to_vswr(20))           # 1.222

# Cascaded noise figure: 2 dB cable -> 20 dB LNA (3 dB NF) -> IF amp
print(cascaded_noise_figure([(-2, 2), (20, 3), (10, 5)]))  # ~5.06 dB

# Pi attenuator values for 6 dB at 50 Ω
print(pi_attenuator(6))         # {'r_shunt': 150.5, 'r_series': 37.35}

# Frequency formatting
print(format_freq(14_200_000))  # '14.2000 MHz'

Related packages

This package is one of four that together replace the original rf-bench monolith:

Package PyPI name Import Contents
rf-bench-drivers-utils rf-bench-drivers-utils rf_bench.utils RF math (this package)
Siglent drivers rf-bench-drivers-siglent rf_bench.siglent SSA3000X, SDG1000X, SDS2000X, SDM3000X, SPD3303X
Icom drivers rf-bench-drivers-icom rf_bench.icom IC7300 via Hamlib rigctld
Yaesu drivers rf-bench-drivers-yaesu rf_bench.yaesu FT891 via Hamlib rigctld

All four packages share the rf_bench namespace; install as many as you need.

License

GPL-3.0-or-later

Metadata

Release files for rf-bench-drivers-utils 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rf-bench-drivers-utils 0.1.0
File Size Uploaded Provenance Actions
rf_bench_drivers_utils-0.1.0.tar.gz 27.9 kB Without provenance Details for rf_bench_drivers_utils-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rf-bench-drivers-utils 0.1.0
File Interpreter ABI Platform Actions
rf_bench_drivers_utils-0.1.0-py3-none-any.whl Python 3 none any Details for rf_bench_drivers_utils-0.1.0-py3-none-any.whl

Total release size: 55.0 kB

Release files / rf_bench_drivers_utils-0.1.0.tar.gz

Download URL rf_bench_drivers_utils-0.1.0.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d796b68f95cabe975c549922b6728b4b33ddf041cfe6451a97c81460bc6e32de
BLAKE2b-256 checksum
How to use checksums
8477a5eaeac72ecbe5b28130f93f66980e3d07ccdbb2ab9bbdd726c9aa532838
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Release files / rf_bench_drivers_utils-0.1.0-py3-none-any.whl

Download URL rf_bench_drivers_utils-0.1.0-py3-none-any.whl
Size 27.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac5b031d8f611a1d4ab4af7fd69010fa13d99af9d5f478cd459c78c3d516d4b3
BLAKE2b-256 checksum
How to use checksums
9c14203b8031a5010568bc60b3d3ab355cae59fc51239e371e232a7232b76c84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.5

Security for rf-bench-drivers-utils 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page