Engee documentation

rfinterp1

Interpolates the data of the network parameters at new frequencies.

Library

EngeeRF

Syntax

Function call

  • objnew = rfinterp1(objold, newfreq) — interpolates network parameter data from objold at specified frequencies newfreq storing the results in objnew. Function rfinterp1 uses the function interp1 to interpolate each individual parameter (i, j) The argument objold to new frequencies.

    If any value of the specified frequency is outside the range specified by the property objold.Frequencies, function rfinterp1 inserts NaN in objnew for these frequency values.
  • objnew = rfinterp1(_, "extrap") — also interpolates network data, but if any of the frequency values specified in newfreq, exceeds the finite frequency of the network parameter object objold.Frequencies(end), then the function extrapolates linearly using the final value of the given network parameters objold.Parameters(:,:,end). If any of the frequency values specified in newfreq, below the first frequency of the network parameter object objold.Frequencies(1), then the function extrapolates linearly between conj(objold.Parameters(:,:,1)) and objold.Parameters(:,:,1). This ensures that the network parameter data of the new object objnew.Parameters will approach real values when approaching newfreq to 0.

Arguments

Input arguments

# objold — data for interpolation

+ the object of the network parameter

Details

Interpolation data specified as an object of RF network parameters. Object objold It must be one of the following types of network parameter objects: S-parameters, t-parameters, Y-parameters, Z-parameters, h-parameters, g-parameters, or ABCD-parameters.

# newfreq — interpolation frequencies

+ vector of positive numbers

Details

Interpolation frequencies, given as a vector of positive numbers ordered from smallest to largest.

Output arguments

# objnew — interpolated data

+ the object of the network parameter

Details

Interpolated data returned by the RF network parameter object of the same type as objold.

Examples

Interpolation of the object of hybrid h-parameters

Details

Create an object of h-parameters hnet and perform interpolation at frequencies freq. Output the interpolated data hnet2.

using EngeeRF
hnet = hparameters(cat([1 2; 3 4] .+ [1 2; 3 4] .* im, [2 3; 4 5], dims = 3),[1.8e9 2.6e9],)
freq = (1.2:0.2:3.0) .* 1e9

hnet2 = rfinterp1(hnet,freq)

println("NumPorts - ", hnet2.NumPorts)
println("Parameters - ", round.(hnet2.Parameters, digits=3))
println("Frequencies - ",hnet2.Frequencies)
NumPorts - 2
Parameters - ComplexF64[NaN + NaN*im NaN + NaN*im; NaN + NaN*im NaN + NaN*im;;; NaN + NaN*im NaN + NaN*im; NaN + NaN*im NaN + NaN*im;;; NaN + NaN*im NaN + NaN*im; NaN + NaN*im NaN + NaN*im;;; 1.0 + 1.0im 2.0 + 2.0im; 3.0 + 3.0im 4.0 + 4.0im;;; 1.25 + 0.75im 2.25 + 1.5im; 3.25 + 2.25im 4.25 + 3.0im;;; 1.5 + 0.5im 2.5 + 1.0im; 3.5 + 1.5im 4.5 + 2.0im;;; 1.75 + 0.25im 2.75 + 0.5im; 3.75 + 0.75im 4.75 + 1.0im;;; 2.0 + 0.0im 3.0 + 0.0im; 4.0 + 0.0im 5.0 + 0.0im;;; NaN + NaN*im NaN + NaN*im; NaN + NaN*im NaN + NaN*im;;; NaN + NaN*im NaN + NaN*im; NaN + NaN*im NaN + NaN*im]
Frequencies - 1.2e9:2.0e8:3.0e9

Perform interpolation with the setting "extrap".

hnet2 = rfinterp1(hnet,freq, "extrap")

println("NumPorts - ", hnet2.NumPorts)
println("Parameters - ", round.(hnet2.Parameters, digits=3))
println("Frequencies - ",hnet2.Frequencies)
NumPorts - 2
Parameters - ComplexF64[1.0 + 0.667im 2.0 + 1.333im; 3.0 + 2.0im 4.0 + 2.667im;;; 1.0 + 0.778im 2.0 + 1.556im; 3.0 + 2.333im 4.0 + 3.111im;;; 1.0 + 0.889im 2.0 + 1.778im; 3.0 + 2.667im 4.0 + 3.556im;;; 1.0 + 1.0im 2.0 + 2.0im; 3.0 + 3.0im 4.0 + 4.0im;;; 1.25 + 0.75im 2.25 + 1.5im; 3.25 + 2.25im 4.25 + 3.0im;;; 1.5 + 0.5im 2.5 + 1.0im; 3.5 + 1.5im 4.5 + 2.0im;;; 1.75 + 0.25im 2.75 + 0.5im; 3.75 + 0.75im 4.75 + 1.0im;;; 2.0 + 0.0im 3.0 + 0.0im; 4.0 + 0.0im 5.0 + 0.0im;;; 2.0 + 0.0im 3.0 + 0.0im; 4.0 + 0.0im 5.0 + 0.0im;;; 2.0 + 0.0im 3.0 + 0.0im; 4.0 + 0.0im 5.0 + 0.0im]
Frequencies - 1.2e9:2.0e8:3.0e9