RF Toolbox 2.6
RF Data Objects
Most of the time you will work with the RF data in the context of an RFCKT object, but occasionally you may want RF data directly. This demo shows you how to work with rfdata objects. First, you create an rfdata.data object by reading in the S-parameters of a two-port passive network stored in the Touchstone® format data file, 'passive.s2p'. Next, you create a circuit object, rfckt.amplifier, and you update the properties of this object using three data objects.
Contents
Read a Touchstone® Data File
Use the READ method of RFDATA.DATA object to read the Touchstone data file 'passive.s2p'. The parameters in this data file are the 50-ohm S-parameters of 2-port passive network at frequencies ranging from 315 kHz to 6.0 GHz.
data = rfdata.data;
data = read(data, 'passive.s2p')
data =
Name: 'Data object'
Freq: [202x1 double]
S_Parameters: [2x2x202 double]
GroupDelay: [202x1 double]
NF: [202x1 double]
OIP3: [202x1 double]
Z0: 50
ZS: 50
ZL: 50
IntpType: 'Linear'
Use the EXTRACT of RFDATA.DATA object to get other network parameters. For example, here are the frequencies, 75-ohm S-parameters, and Y-parameters which are converted from the original 50-ohm S-parameters in passive.s2p data file.
[s_params, freq] = extract(data, 'S_PARAMETERS', 75); y_params = extract(data, 'Y_PARAMETERS');
Use the RF utility function SMITHCHART to plot the 75-ohm S11 on a Smith chart.
s11 = s_params(1,1,:); fig = figure; smithchart(s11(:));
Here are the four 75-ohm S-parameters and four Y-parameters at 6.0 GHz, the last frequency.
f = freq(end) s = s_params(:,:,end) y = y_params(:,:,end)
f = 6.0000e+009 s = -0.0764 - 0.5401i 0.6087 - 0.3018i 0.6094 - 0.3020i -0.1211 - 0.5223i y = 0.0210 + 0.0252i -0.0215 - 0.0184i -0.0215 - 0.0185i 0.0224 + 0.0266i
Create RFDATA Objects for an Amplifier with Your Own Data
In this example, you create a circuit object, RFCKT.AMPLIFIER Then you create three data objects and use them to update the properties of the circuit object.
RFCKT.AMPLIFIER object has properties for network parameters, noise data and nonlinear data. The NetworkData is an RFDATA.NETWORK object for network parameters. The NoiseData is for noise parameters which could be a scalar NF(dB), an RFDATA.NOISE or an RFDATA.NF object. The NonlinearData is for nonlinear parameters which could be a scalar OIP3(dBm), an RFDATA.POWER or an RFDATA.IP3 object. By default, these properties of RFCKT.AMPLIFIER contain data from the 'default.amp' data file. The NetworkData is an RFDATA.NETWORK object that contains 50-ohm 2-port S-Parameters at 191 frequencies ranging from 1.0 GHz to 2.9 GHz. The NoiseData is an RFDATA.NOISE object that contains spot noise data at 9 frequencies ranging from 1.9 GHz to 2.48 GHz. The NonlinearData is an RFDATA.POWER object that contains Pin/Pout data at 2.1 GHz.
amp = rfckt.amplifier
amp =
Name: 'Amplifier'
nPort: 2
AnalyzedResult: [1x1 rfdata.data]
IntpType: 'Linear'
NetworkData: [1x1 rfdata.network]
NoiseData: [1x1 rfdata.noise]
NonlinearData: [1x1 rfdata.power]
Use the following code to create an RFDATA.NETWORK object that contains 2-port Y-parameters of an amplifier at 2.08 GHz, 2.10 GHz and 2.15 GHz. Later in this example, you use this data object to update the NetworkData property of the amplifier object.
f = [2.08 2.10 2.15] * 1.0e9; y(:,:,1) = [-.0090-.0104i, .0013+.0018i; -.2947+.2961i, .0252+.0075i]; y(:,:,2) = [-.0086-.0047i, .0014+.0019i; -.3047+.3083i, .0251+.0086i]; y(:,:,3) = [-.0051+.0130i, .0017+.0020i; -.3335+.3861i, .0282+.0110i]; netdata = rfdata.network('Type','Y_PARAMETERS','Freq',f,'Data',y)
netdata =
Name: 'Network parameters'
Type: 'Y_PARAMETERS'
Freq: [3x1 double]
Data: [2x2x3 double]
Z0: 50
Use the following code to create an RFDATA.NF object that contains noise figures of the amplifier, in dB, at seven frequencies ranging from 1.93 GHz to 2.40 GHz. Later in this example, you use this data object to update the NoiseData property of the amplifier object.
f = [1.93 2.06 2.08 2.10 2.15 2.3 2.4] * 1.0e+009; nf = [12.4521 13.2466 13.6853 14.0612 13.4111 12.9499 13.3244]; nfdata = rfdata.nf('Freq', f, 'Data', nf)
nfdata =
Name: 'Noise figure'
Freq: [7x1 double]
Data: [7x1 double]
Use the following code to create an RFDATA.IP3 object that contains the output third-order intercept points of the amplifier, which is 8.45 watts at 2.1 GHz. Later in this example, you use this data object to update the NonlinearData property of the amplifier object.
ip3data = rfdata.ip3('Type', 'OIP3', 'Freq', 2.1e9, 'Data', 8.45)
ip3data =
Name: '3rd order intercept'
Type: 'OIP3'
Freq: 2.1000e+009
Data: 8.4500
Use the following code to update the properties of the amplifier object with three data objects you created in the previous steps. To get a good amplifier object, the data in these data objects must be accurate. These data could be obtained from RF measurements, or circuit simulation using other tools.
amp.NetworkData = netdata; amp.NoiseData = nfdata; amp.NonlinearData = ip3data
amp =
Name: 'Amplifier'
nPort: 2
AnalyzedResult: [1x1 rfdata.data]
IntpType: 'Linear'
NetworkData: [1x1 rfdata.network]
NoiseData: [1x1 rfdata.nf]
NonlinearData: [1x1 rfdata.ip3]
close(fig);
Store