| |
- Beep(frequency, duration)
- A wrapper around the Windows Beep API.
frequency
Frequency of the sound in hertz.
Must be in the range 37 through 32,767.
duration
How long the sound should play, in milliseconds.
- S2T(S)
- input:
S: [num_pts,2,2] S-parameter matrix
output:
T: [num_pts,2,2] T-parameter matrix
- T2S(T)
- input:
T: [num_pts,2,2] T-parameter matrix
output:
S: [num_pts,2,2] S-parameter matrix
- ab2G(rec, ports)
- ab2G Returns reflection coefficient G (gamma) from a and b waves
G = ab2G(rec,ports)
Inputs:
rec: dict{int:[num_pts]}
reciever recording returned by measure1Port()
ports: map that associates a port number with each VNA Tx/Rx
possible keys: ['Tx1','Tx2','Rx1A','Rx1B','Rx2A','Rx2B']
possible values: [1, 2, 3, 4, 5, 6]
Outputs:
G = [num_pts] reflection coefficient (gamma) of the transmitting port
- ab2S(rec_tx1, rec_tx2, ports)
- Converts ab wave measurements from measure2Port() to S parameters.
input:
rec_tx1,rec_tx2: {1:[num_pts] , 2:[num_pts], ..., 6:[num_pts]}
recording dictionaries returned by measure2Port()
output:
S: [num_pts,2,2] stack of S parameter matricies in frequency
- ab2S_SwitchCorrect(rec_tx1, rec_tx2, ports)
- Converts ab wave measurements from measure2Port() to S parameters with
switch correction
input:
rec_tx1,rec_tx2: {1:[num_pts] , 2:[num_pts], ..., 6:[num_pts]}
recording dictionaries returned by measure2Port() with 'Tx1'
and 'Tx2' transmitting
ports: mapping dictionary,
possible keys: ['Tx1','Tx2','Rx1A','Rx1B','Rx2A','Rx2B']
possible values: [1, 2, 3, 4, 5, 6]
output:
S: [num_pts,2,2] stack of S parameter matricies in frequency
- beep()
- Produce a short notification beep
- correct12Term(Sm, fwd_terms, rev_terms, **kwargs)
- Applies 12-Term Model error correction with terms obtained from get12TermModel()
input:
Sm: [num_pts,2,2] raw S-parameter measurements
fwd_terms: [num_pts,6] [e00 ,e11 ,e10e01 ,e10e32 ,e22 ,e30]
rev_terms: [num_pts,6] [ep33,ep22,ep23ep32,ep23ep01,ep11,ep03]
output:
S: [num_pts,2,2] 12-term corrected S-parmeters
- correct1Port(Gm, err_terms)
- corrects a reflection coefficient measurement using the one-port VEC terms
returned from get1PortModel()
input:
Gm: [num_pts] measured reflection coefficient
err_terms: [num_pts,3] matrix of 1-port error terms obtained from
get1PortModel()
output:
G: corrected reflection coefficient
- correct8Term(Sm, A, B, q)
- returns DUT S parameters from 8-term error model
input:
Sm: [num_pts,2,2] raw measured DUT S-parmeters
A,B,q: 8-term mdoel error terms from get8TermModel()
output:
S: [num_pts,2,2] corrected DUT S-params
- correctPortExt(S_ext_dut, e10e01, port_num)
- Performs correction of S-parameter data on one port based on the
the port-extension model. Supports 2-Port networks only.
input:
S_ext_dut: [num_pts,2,2] uncorrected S-parameter data
e10e01: [num_pts] Transmission tracking coefficients of the error model
port_num: (1 or 2) port at which the adapter is connected
output:
S_dut: [num_pts] Corrected S-Parameters
e10 __________
Port o---->----o--| |--o
(port_num) e01 | DUT |
o----<----o--|__________|--o
- correctResponse(Sm, H)
- Computes DUT S-parameters by inverting the channel modeled by H
input:
Sm: [num_pts,2,2] measured S-parameters
H: [num_pts,2,2] Frequency Response channel model
output:
S: [num_pts,2,2] DUT S-parameters
- deEmbed(S_A_DUT_B, S_A=[], S_B=[])
- deEmbed De-Embeds an adapter or multiple adapters from a 2-port
measurement. All S-Parameter inputs must be aligned. Port 2 of
one network feeds port 1 of the subsequent network (see diag).
This fuction supports de-embedding of adapters on either side
of the DUT. If only a single adapter is used, set unused
adapter to [] or np.tile([[0,1],[1,0]],(num_pts,1,1))
_______________________________________
| _______ _______ _______ |
A_DUT_B o-|---|P1 P2|---|P1 P2|---|P1 P2|---|-o A_DUT_B
Port1 | | S_A | | S_DUT | | S_B | | Port2
o-|---|_______|---|_______|---|_______|---|-o
|_______________________________________|
inputs:
S_A_DUT_B: [num_pts,2,2] S-Parameter description of the combined
network Adapter A - DUT - Adapter B
S_A : [num_pts,2,2] S-Parameter description of adapter on
the left (Port 1) side of the DUT
S_B : [num_pts,2,2] S-Parameter description of adapter on
the right (Port 2) side of the DUT
outputs:
S_DUT: [num_pts,2,2] S-parameter description of the DUT
- get12TermModel(G1, Gm1, G2, Gm2, T, Tm, isolation=None)
- Constructs the 12-Term error model (with optional isolation measurement),
using measured SOLT data and listed SOLT data.
input:
G1,G2: [num_pts,3] listed (G) and measured (Gm) reflection coefficients
of standards used on port 1 and 2 respectively. Standards used in
G,Gm must be in same order (ie. G = [O,S,L] Gm = [Om,Sm,Lm])
T,Tm: [num_pts,2,2] listed (T) and measured (Tm) relfection coefficients
of thru standard
isolation (optional): [num_pts,2,2] measured S-parameters of an isolation measurement.
ie. matched loads on each port
output:
fwd_terms: [num_pts,6] [e00 ,e11 ,e10e01 ,e10e32 ,e22 ,e30]
rev_terms: [num_pts,6] [ep33,ep22,ep23ep32,ep23ep01,ep11,ep03]
- get1PortModel(G, Gm)
- returns 3 error terms from 1 port calibration
parameters are ideal and measured reflection coefficients for 3 components
G and Gm must have standards listed in the same order
inputs:
G: [num_pts,3] actual component reflection coefficients
Gm: [num_pts,3] measured component reflection coeffcients
outputs:
x: [num_pts,3] solution to the matrix equation Ax=b,
where A and b are defined by the system of equations for the 1 port model,
resulting in x containing [e_00, e_11, delta_e] (in that order)
- get1PortResponseModel(G, Gm)
- returns a model for the reflection channel: Gm = H(w)G
input:
G: [num_pts] actual, listed, or ideal reflection coefficient
Gm: [num_pts] measured reflection coefficient
output:
H: [num_pts] reflection channel
- get2PortResponseModel(G1, G1m, G2, G2m, T, Tm)
- returns a model for a 2x2 Frequency Response model (channel):
Sijm = Hij(w)Sij
input:
G1,G2: [num_pts] actual, listed, or ideal reflection coefficient
at port 1 and port 2
Gm1,Gm2: [num_pts] measured reflection coefficient at port 1 and port 2
T,Tm: [num_pts,2,2] actual, listed, or ideal thru measurement (T)
and measured thru (Tm)
output:
H: [num_pts,2,2] 2x2 Frequency Response model (channel)
- get8TermModel(G1, Gm1, G2, Gm2, T, Tm)
- Constructs 8-term model based on measured and actual SOLT S-parmeters.
input:
G1,G2: [num_pts,3] actual (G) and measured (Gm) reflection coefficients
of standards used on port 1 and 2 respectively. Standards used in
G,Gm must be in same order (ie. G = [O,S,L] Gm = [Om,Sm,Lm])
T,Tm: [num_pts,2,2] actual (T) and measured (Tm) relfection coefficients
of thru standard
output:
A,B: [num_pts,2,2] normalized error adapter [-delta_e e00
e11 1 ]
at ports 1 and 2 respectively
q: [num_pts,1] thru error term e10e32
- get8TermModelUThru(G1, Gm1, G2, Gm2, Tm, freq_vec, phys_length=0.05)
- Constructs 8-term model based on measured SOLT and actual SOL S-parmeters.
Uses the Unknown Thru Method.
input:
G1,G2: [num_pts,3] actual (G) and measured (Gm) reflection coefficients
of standards used on port 1 and 2 respectively. Standards used in
G,Gm must be in same order (ie. G = [O,S,L] Gm = [Om,Sm,Lm])
Tm: [num_pts,2,2] measured S-parameters of the unknown-thru
freq_vec: [num_pts] frequency vector (in [Hz]!) of the measurements
phys_length: (optional) approximate length of the
unknown thru component in meters for velocity factor of 0.695
Default is 5cm.
output:
A,B: [num_pts,2,2] normalized error adapter [-delta_e e00
e11 1 ]
at ports 1 and 2 respectively
q: [num_pts,1] thru error term e10e32
- getIdealSparams(num_pts)
- Returns S-Parameters of the 'Ideal' Open Short Load and Thru Components
input:
num_pts: (int) number of points in the frequency vector
outputs:
G_ideal: [num_pts, 3] matrix of 'canonical' Open,Short,Load reflection
coefficients (1,-1,0)
T_ideal: [numpts, 2, 2] stack of S matricies of an ideal thru
ie. S = [0 1
1 0]
- getPortExtModel(gamma, gamma_listed)
- Returns error term for the port-extension model. Port-extension is
measured with an open or short termination at the desired measurement plane.
input:
gamma,gamma_listed: [num_pts] measured and listed reflection
coefficient at the extended port
output:
e10e01: [num_pts] Transmission tracking coefficients of the error model
- measure1Port(vnakit, settings, tx)
- makes a,b wave measurement at specified port
input:
vnakit: object (the board),
settings: vnakit settings object,
tx: port number of transmitter (ex. ports['Tx1'])
output:
rec: {1:[num_pts] , 2:[num_pts], ..., 6:[num_pts]}
recording dictionary with ports[tx] as transmitter
- measure2Port(vnakit, settings, ports)
- makes 2 port measurement
input:
vnakit: object (the board),
settings: vnakit settings object,
ports: mapping dictionary,
possible keys: ['Tx1','Tx2','Rx1A','Rx1B','Rx2A','Rx2B']
possible values: [1, 2, 3, 4, 5, 6]
tx: port number of transmitter (ie. ports['Tx1'])
output:
rec_tx1: {1:[num_pts] , 2:[num_pts], ..., 6:[num_pts]}
recording dictionary with tx1 as transmitter
rec_tx2: {1:[num_pts] , 2:[num_pts], ..., 6:[num_pts]}
recording dictionary with tx2 as transmitter
- plotCompareDb(freq_vec, S_array, title_array, settings_str=None)
- Plots comparison of S-parameter objects given in the list S_array.
Titles must be given for each plot in the list title_array uses scikit-rf
plotting and matplotlib.
input:
freq_vec: [num_pts] frequency vector in MHz
S_array: list of S-parameter 'stacks' size [num_pts,2,2] corrected S-parameters
title_array: list of titles for the S-parameter plots
- plotCompareDbDeg(freq_vec, S_array, title_array, settings_str=None)
- Plots comparison of S-parmeter objects given in the list S_array.
Titles must be given for each plot in the list title_array uses scikit-rf
plotting and matplotlib.
input:
freq_vec: [num_pts] frequency vector in MHz
S_array: list of S-parameter 'stacks' size [num_pts,2,2] corrected S-parameters
title_array: list of titles for the S-parameter plots
- plotCompareDeg(freq_vec, S_array, title_array, settings_str=None)
- Plots comparison of S-parmeter objects given in the list S_array.
Titles must be given for each plot in the list title_array uses scikit-rf
plotting and matplotlib.
input:
freq_vec: [num_pts] frequency vector in MHz
S_array: list of S-parameter 'stacks' size [num_pts,2,2] corrected S-parameters
title_array: list of titles for the S-parameter plots
- prompt1PortMeasure(vnakit, settings, ports, tx, name='')
- Prompts the user to measure reflection coefficient at chosen port (tx)
input:
vnakit: (the board) object,
settings: vnakit settings object,
ports: mapping dictionary,
possible keys: ['Tx1','Tx2','Rx1A','Rx1B','Rx2A','Rx2B']
possible values: [1, 2, 3, 4, 5, 6]
tx: port number of transmitter
name: (optional) name of component is printed in the prompt
output:
Gm: [num_pts] measured reflection coefficient
- prompt1PortSOL(vnakit, settings, ports, tx)
- Prompts the user to measure SOL parameters at chosen port (tx)
input:
vnakit: (the board) object,
settings: vnakit settings object,
ports: mapping dictionary,
possible keys: ['Tx1','Tx2','Rx1A','Rx1B','Rx2A','Rx2B']
possible values: [1, 2, 3, 4, 5, 6]
tx: port number of transmitter
output:
Gm: measured reflection coefficients array [num_pts, 3] in order of OSL
- prompt2PortMeasure(vnakit, settings, ports, name='DUT', sw_corr=True)
- Prompts the user to measure 2-port S-parameters
input:
vnakit: (the board) object
settings: vnakit settings object
ports: mapping dictionary
possible keys: ['Tx1','Tx2','Rx1A','Rx1B','Rx2A','Rx2B']
possible values: [1, 2, 3, 4, 5, 6]
name: string (optional) name of component is printed in the prompt
sw_corr: bool (optional) apply switch correction. Default True
output:
Sm: [num_pts,2,2] measured S-parameters
- prompt2PortSOLT(vnakit, settings, ports, isolation=False, sw_corr=True)
- Uses prompt1PortSOL to get SOL measurements at each port, an additional
thru measurement, and an optional isolation measurement
input:
vnakit: (the board) object,
settings: vnakit settings object,
ports: port mapping dictionary
isolation: (bool) will the isolation measurement be taken
sw_corr: (bool) will switch correction be applied
output:
Gm1: [num_pts,3] port 1 measured reflection coefficients in order OSL
Gm2: [num_pts,3] port 2 measured reflection coefficients in order OSL
Tm: [num_pts,2,2] measured thru S-parameters
(optional) Im: [num_pts,2,2] measured isolation S-parameters
- readSnP(path, freq_desired=None, kind='dB')
- Reads a touchstone file, returning a frequency vector and S-parameter matrix.
If freq_desired is provided, S-parameter data is interpolated and then returned.
Units of freq_desired must be in Hz. Python uses the scikit-rf module
for the reading in raw touchstone data.
input:
path: [string] path/to/filename of touchstone file (*.sNp)
freq_desired (optional): [num_pts] frequency vector (in Hz)
for interpolation
kind (optional): (str) Specifies the kind of interpolation
('MA', 'DB', or 'RI') Function interpolated to frequency desired
using linear interpolation on the magnitude and phase ('MP'),
magnitude in dB and phase ('DB'), or real and imaginary parts
('RI'). Default is 'DB'
output:
S: [num_pts,1] or [num_pts,n,n] S-Parameter matrix
f: (optional) [num_pts] frequency vector (in Hz) of file.
Only returned if no freq_desired is given.
- userMsg(msg)
- Prints a message to the console and waits for user input.
program continues on hitting Enter. Progam exits on 'q' input
- writeSnP(freq_vec, S_data, path, freq_unit='Hz')
- writes S-parameter matrix to touchstone (*.SnP) file
input:
freq_vec: [num_pts] frequency vector of measurements
S_data: [num_pts,2,2] S-parameter matrix to save
path: [string] path/to/filename
freq_unit: [string] units of the frequency vector (default: Hz)
|