skrf.frequency.Frequency

class skrf.frequency.Frequency(start=0, stop=0, npoints=0, unit='ghz', sweep_type='lin')[source]

A frequency band.

The frequency object provides a convenient way to work with and access a frequency band. It contains a frequency vector as well as a frequency unit. This allows a frequency vector in a given unit to be available (f_scaled), as well as an absolute frequency axis in ‘Hz’ (f).

A Frequency object can be created from either (start, stop, npoints) using the default constructor, __init__(). Or, it can be created from an arbitrary frequency vector by using the class method from_f().

Internally, the frequency information is stored in the f property combined with the unit property. All other properties, start stop, etc are generated from these.

Parameters
  • start (float) –

  • stop (float) –

  • npoints (int) –

  • unit (str) –

  • sweep_type (str) –

Return type

None

Attributes

center

Center frequency in Hz.

center_idx

Closes idx of f to the center frequency.

center_scaled

Center frequency in unit's.

df

The gradient of the frequency vector.

df_scaled

The gradient of the frequency vector (in unit of unit).

dw

The gradient of the frequency vector (in radians).

f

Frequency vector in Hz.

f_scaled

Frequency vector in units of unit.

multiplier

Multiplier for formatting axis.

multiplier_dict

Frequency unit multipliers.

npoints

Number of points in the frequency.

span

The frequency span.

span_scaled

The frequency span.

start

Starting frequency in Hz.

start_scaled

Starting frequency in unit's.

step

The inter-frequency step size (in Hz) for evenly-spaced frequency sweeps

step_scaled

The inter-frequency step size (in unit) for evenly-spaced frequency sweeps.

stop

Stop frequency in Hz.

stop_scaled

Stop frequency in unit's.

t

Time vector in s.

t_ns

Time vector in ns.

unit

Unit of this frequency band.

unit_dict

Dictionnary to convert unit string with correct capitalization for display.

w

Angular frequency in radians/s.

Methods

__init__

Frequency initializer.

copy

Returns a new copy of this frequency.

from_f

Construct Frequency object from a frequency vector.

labelXAxis

Label the x-axis of a plot.

overlap

Calculates overlapping frequency between self and f2.

plot

Plot something vs this frequency.

round_to

Round off frequency values to a specified precision.