rfinterp1
Interpolates the data of the network parameters at new frequencies.
| Library |
|
Syntax
Function call
-
objnew = rfinterp1(objold, newfreq)— interpolates network parameter data fromobjoldat specified frequenciesnewfreqstoring the results inobjnew. Functionrfinterp1uses the functioninterp1to interpolate each individual parameter(i, j)The argumentobjoldto new frequencies.If any value of the specified frequency is outside the range specified by the property objold.Frequencies, functionrfinterp1insertsNaNinobjnewfor these frequency values.
-
objnew = rfinterp1(_, "extrap")— also interpolates network data, but if any of the frequency values specified innewfreq, exceeds the finite frequency of the network parameter objectobjold.Frequencies(end), then the function extrapolates linearly using the final value of the given network parametersobjold.Parameters(:,:,end). If any of the frequency values specified innewfreq, below the first frequency of the network parameter objectobjold.Frequencies(1), then the function extrapolates linearly betweenconj(objold.Parameters(:,:,1))andobjold.Parameters(:,:,1). This ensures that the network parameter data of the new objectobjnew.Parameterswill approach real values when approachingnewfreqto0.
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