Hauptinhalt

rfinterp1

Interpolate network parameter data at new frequencies

Description

interpData = rfinterp1(netw,newfreq) interpolates the network parameter data netw at the specified frequencies, newfreq. The rfinterp1 function uses the interp1 to interpolate each individual (i,j) parameter of netw to the new frequencies.

Note

If any value of the specified frequency is outside of the range specified by netw.Frequencies, then rfinterp1 function inserts NaNs into interpData for those frequency values.

example

interpData = rfinterp1(netw,newfreq,'extrap') also interpolates the network data but extrapolates the data based on the frequency of the input data, netw.frequencies. If any of the frequency values in newfreq are

  • Above the final frequency of the network parameter object, netw.Frequencies(end), then the function extrapolates flat using the final value of the network parameter data netw.Parameters(:,:,end).

  • Below the first frequency of the network parameter object, netw.Frequencies(1), then the function extrapolates linearly between conj(netw.Parameters(:,:,1)) and netw.Parameters(:,:,1).

This ensures that the network parameter data of the new object, interpData.Parameters approach real values as in newfreq approach 0.

interpData = rfinterp1(netw,newfreq,'rational') interpolates the input network parameter data netw at the specified frequencies, newfreq, using the rational object to return high-fidelity interpolation of the network data.

Note

This function will issue a warning but still interpolate if the input data does not meet the relative the error tolerance of the rational object. For more information, see Tolerance.

(since R2026a)

example

Examples

collapse all

Read the data from the file default.s2p into an S-parameter object.

hnet = sparameters("default.s2p");

Interpolate the data at a specified set of frequencies.

freq = [1.2:0.2:2.8]*1e9;
hnet2 = rfinterp1(hnet,freq)
hnet2 = 
  sparameters with properties:

      Impedance: 50
       NumPorts: 2
     Parameters: [2×2×9 double]
    Frequencies: [9×1 double]

Since R2026a

Create a S-parameter object with the input data.

Sint = sparameters('rfinterpdata.s2p');

Plot the S-parameter data before interpolation.

rfplot(Sint)

Figure contains an axes object. The axes object with xlabel Frequency (GHz), ylabel Magnitude (dB) contains an object of type line. This object represents dB(S_{11}).

Specify frequencies to interpolate.

fnew = linspace(0, 1e10, 1823).';

Interpolate the data with the rational fitting algorithm.

interp = rfinterp1(Sint, fnew, 'rational');

Plot the interpolated data.

rfplot(interp)

Figure contains an axes object. The axes object with xlabel Frequency (GHz), ylabel Magnitude (dB) contains an object of type line. This object represents dB(S_{11}).

Input Arguments

collapse all

Data to interpolate, specified as an RF Toolbox™ network parameter object. netw 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.

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

Output Arguments

collapse all

Interpolated data, returned as an RF Toolbox network parameter object of the same type as netw.

Algorithms

The function uses the MATLAB® function interp1 to perform the interpolation operation. Overall performance is similar to the RF Toolbox analyze function. However, behaviors of the two functions differ when freq contains frequencies outside the range of the original data:

  • analyze performs a zeroth-order extrapolation for out-of-range data points.

  • rfinterp1 inserts NaN values for out-of-range data points. And also supports  interpolation and extrapolation of complex S-parameter data using the rational object. (since R2026a)

Version History

Introduced in R2012b

expand all

See Also

|