Quantcast

Documentation Center

  • Trial Software
  • Product Updates

Basic Operations with RF Objects

Read and Analyze RF Data from a Touchstone Data File

In this example, you create an rfdata.data object by reading the S-parameters of a 2-port passive network stored in the Touchstone format data file, passive.s2p.

  1. Read S-parameter data from a data file. Use the RF Toolbox™ read command to read the Touchstone data file, passive.s2p. This file contains 50-ohm S-parameters at frequencies ranging from 315 kHz to 6 GHz. The read command creates an rfdata.data object, data, and stores data from the file in the object's properties.

    data = read(rfdata.data,'passive.s2p');
    
  2. Extract the network parameters from the data object. Use the extract command to convert the 50-ohm S-parameters in the rfdata.data object, data, to 75-ohm S-parameters and save them in the variable s_params. You also use the command to extract the Y-parameters from the rfdata.data object and save them in the variable y_params.

    freq = data.Freq;
    s_params = extract(data,'S_PARAMETERS',75);
    y_params = extract(data,'Y_PARAMETERS');
    
  3. Plot the S11 parameters. Use the smithchart command to plot the 75-ohm S11 parameters on a Smith® Chart:

    s11 = s_params(1,1,:);
    smithchart(s11(:));
    

  4. View the 75-ohm S-parameters and Y-parameters at 6 GHz. Type the following set of commands at the MATLAB® prompt to display the four 75-ohm S-parameter values and the four Y-parameter values at 6 GHz.

    f = freq(end)
    s = s_params(:,:,end)
    y = y_params(:,:,end)
    

    The toolbox displays the following output:

    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
    

For more information, see the rfdata.data, read, and extract reference pages.

De-Embed S-Parameters

The Touchstone data file samplebjt2.s2p contains S-parameter data collected from a bipolar transistor in a test fixture. The input of the fixture has a bond wire connected to a bond pad. The output of the fixture has a bond pad connected to a bond wire.

The configuration of the bipolar transistor, which is the device under test (DUT), and the fixture is shown in the following figure.

In this example, you remove the effects of the fixture and extract the S-parameters of the DUT.

  1. Create RF objects. Create a data object for the measured S-parameters by reading the Touchstone data file samplebjt2.s2p. Then, create two more circuit objects, one each for the input pad and output pad.

    measured_data = read(rfdata.data,'samplebjt2.s2p');
    input_pad = rfckt.cascade('Ckts',...
          {rfckt.seriesrlc('L',1e-9), ...
          rfckt.shuntrlc('C',100e-15)});    % L=1 nH, C=100 fF
    output_pad = rfckt.cascade('Ckts',...
          {rfckt.shuntrlc('C',100e-15),...
          rfckt.seriesrlc('L',1e-9)});     % L=1 nH, C=100 fF
    
  2. Analyze the input pad and output pad circuit objects. Analyze the circuit objects at the frequencies at which the S-parameters are measured.

    freq = measured_data.Freq;
    analyze(input_pad,freq);
    analyze(output_pad,freq);
    
  3. De-embed the S-parameters. Extract the S-parameters of the DUT from the measured S-parameters by removing the effects of the input and output pads.

    z0 = measured_data.Z0;
    
    input_pad_sparams = extract(input_pad.AnalyzedResult,...
    'S_Parameters',z0);
    output_pad_sparams = extract(output_pad.AnalyzedResult,...
    'S_Parameters',z0);
    
    de_embedded_sparams = ...
    deembedsparams(measured_data.S_Parameters,...
                          input_pad_sparams, output_pad_sparams);
    
  4. Create a data object for the de-embedded S-parameters. In a later step, you use this data object to plot the de-embedded S-parameters.

    de_embedded_data = rfdata.data('Z0',z0,...
                      'S_Parameters',de_embedded_sparams,...
                      'Freq',freq);
    
  5. Plot the measured and de-embedded S11 parameters. Type the following set of commands at the MATLAB prompt to plot both the measured and the de-embedded S11 parameters on a Z Smith Chart:

    hold off;
    h = smith(measured_data,'S11');
    set(h, 'Color', [1 0 0]);
    hold on
    i = smith(de_embedded_data,'S11');
    set(i,'Color', [0 0 1],'LineStyle',':');
    l = legend;
    legend(l, {'Measured S_{11}', 'De-embedded S_{11}'});
    legend show;
    

  6. Plot the measured and de-embedded S22 parameters. Type the following set of commands at the MATLAB prompt to plot the measured and the de-embedded S22 parameters on a Z Smith Chart:

    figure;
    hold off;
    h = smith(measured_data,'S22');
    set(h, 'Color', [1 0 0]);
    hold on
    i = smith(de_embedded_data,'S22');
    set(i,'Color', [0 0 1],'LineStyle',':');
    l = legend;
    legend(l, {'Measured S_{22}', 'De-embedded S_{22}'});
    legend show;
    

  7. Plot the measured and de-embedded S21 parameters. Type the following set of commands at the MATLAB prompt to plot the measured and the de-embedded S21 parameters, in decibels, on an X-Y plane:

    figure
    hold off;
    h = plot(measured_data,'S21', 'db');
    set(h, 'Color', [1 0 0]);
    hold on
    i = plot(de_embedded_data,'S21','db');
    set(i,'Color', [0 0 1],'LineStyle',':');
    l = legend;
    legend(l, {'Measured S_{21}', 'De-embedded S_{21}'});
    legend show;
    hold off;
    

Was this topic helpful?