Network.interpolate(freq_or_n: Union[skrf.frequency.Frequency, numbers.Number, Sequence[numbers.Number], numpy.ndarray], basis: str = 's', coords: str = 'cart', f_kwargs: dict = {}, return_array: bool = False, **kwargs) → Union[, numpy.ndarray][source]

Interpolate a Network along frequency axis

The input ‘freq_or_n` can be either a new Frequency or an int, or a new frequency vector (in hz).

This interpolates a given basis, ie s, z, y, etc, in the coordinate system defined by coord like polar or cartesian.

Different interpolation types (‘linear’, ‘quadratic’) can be used

by passing appropriate **kwargs. This function returns an interpolated Network. Alternatively interpolate_self() will interpolate self.

  • freq_or_n (Frequency or int or listlike) –

    The new frequency over which to interpolate. this arg may be one of the following

    • a new Frequency object
    • if an int, the current frequency span is resampled linearly.
    • if a listlike, then create its used to create a new frequency object using Frequency.from_f
  • basis (['s','z','y','a'],etc) – The network parameter to interpolate
  • coords (['cart','polar']) –
    coordinate system to use for interpolation.
    • ’cart’ is cartesian is Re/Im
    • ’polar’ is unwrapped phase/mag
  • return_array (bool) – return the interpolated array instead of re-assigning it to a given attribute
  • **kwargs (keyword arguments) –

    passed to scipy.interpolate.interp1d() initializer. kind controls interpolation type.

    kind = rational uses interpolation by rational polynomials.

    d kwarg controls the degree of rational polynomials when kind`=`rational. Defaults to 4.


result – an interpolated Network, or array

Return type:



The interpolation coordinate system (coords) makes a big difference for large amounts of interpolation. polar works well for duts with slowly changing magnitude. try them all.

See scipy.interpolate.interpolate.interp1d() for useful kwargs. For example

kind : str or int
Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic, ‘cubic’) or as an integer specifying the order of the spline interpolator to use.


In [1]: n =

In [2]: n
Out[2]: 2-Port Network: 'ring slot',  75.0-110.0 GHz, 201 pts, z0=[50.+0.j 50.+0.j]

In [3]: new_freq = rf.Frequency(75,110,501,'ghz')

In [4]: n.interpolate(new_freq, kind = 'cubic')
Out[4]: 2-Port Network: 'ring slot',  75.0-110.0 GHz, 501 pts, z0=[50.+0.j 50.+0.j]