Git Product home page Git Product logo

rf-tool's Introduction

RF-Tool

RF electronics calculator. Developed for python 3.

Calculate static or frequency dependent characteristic impedance for microstip lines. Based on the empirical effective permittivity and impedance formulas of Hammerstad-Jensen, and the empirical dispersion formula of yamashita.

Available on PYPI

Downloads

https://pypi.org/project/rf-tool/

pip install rf-tool

Documentation now on Readthedocs!

https://rf-tool.readthedocs.io/

Basic Usage:

Use the help() function for description of inputs and valid ranges of the functions. Below are some of the supported functions.

PCB Tools

import rftool.pcb as pcb
# Quasi static impedance, Hammerstad and Jensen's method.
Z_static = pcb.microstripImpedanceHJ( h, w, e_r )

# Calcultate the effective width, accounting for the microstrip height, Hammerstad and Jensen's method.
w_eff = pcb.effectiveStripWidthHJ( h, w, t, e_r )

# Quasi static impedance of microstrip in metallic enclosure.
Z_static = pcb.shieldedMicrostripImpedanceHJ( h, w, t, a, b, e_r )

# Frequency dependent impedance calculation (Yamashita dispersion)
Z_100M = pcb.microstripImpedanceYa( h, w, e_r, f)

# Frequency dependent impedance calculation (Kirschning and Jansen dispersion)
Z_100M = pcb.microstripImpedanceKJ( h, w, e_r, f)

Radar Tools

import rftool.pcb as radar
# Albersheim's equation for required SNR with incoherent integration
SNRdB = radar.Albersheim( Pfa, Pd, N )

# Shnidman's equation for required SNR with incoherent integration, swerling 0-5
SNRdB = radar.Shnidman( Pfa, Pd, N, SW )

# Hillbert Spectrum Plot
from scipy.signal import chirp
import numpy as np
Fs=np.intc(10e3)
t = np.linspace(0, 1, Fs)
w = chirp(t, f0=1e3, f1=2e3, t1=1, method='quadratic')
radar.hilbert_spectrum(np.real(w), Fs)

Digital Communications

import rftool.communications as comm

# Calculate probability of error in AWGN for various modulations
Perror = comm.errorProbabilityBpsk( EbN0 )
Perror = comm.errorProbabilityQpsk( EbN0 )
Perror = comm.errorProbabilityMPsk( EbN0, M )
Perror = comm.errorProbabilityFsk( EbN0 )
Perror = comm.errorProbabilityCoherentFsk( EbN0 )
Perror = comm.errorProbabilityCoherentMFsk( EbN0, M )
Perror = comm.errorProbabilityGMSK( EbN0 )
Perror = comm.errorProbabilityQam( EbN0 , M)

Utility

from rftool.utility import *

# Conversion between reflection coef. and VSWR
VSWR = Gamma2VSWR( Gamma )

# Linear to log conversion 
dB = mag2db( mag )
mag = db2mag( dB )

dB = pow2db( power )
mag = db2pow( dB )

rf-tool's People

Contributors

erikbuer avatar

Stargazers

Dave Workman avatar Nami-NGNMWT-coreEternity avatar

Watchers

 avatar

rf-tool's Issues

Error in shnidman function (tested only for python 3.9.6)

Hi,

Nice repo, but found that there is an error when using the Shnidman function (at least for python 3.9.6). The error is the function K.
Running the code now gives the error: C1 = np.divide( ( (17.7006*Pd-18.4496)*Pd+14.5339 )*Pd-3.525, K(SW) ) TypeError: unsupported operand type(s) for /: 'float' and 'NoneType'

The K(SW) needs to return something, as this doesnt seemed to be supported by newer versions of python anymore

Fix is just adding a return instead

def K(SW): if SW == 1: return 1 elif SW == 2: return N elif SW == 3: return 2 elif SW == 4: return 2*N

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.