In my consultant work, I often need to sweep over a large number S-parameter files, to build/verify scalable models against measured data. Depending on the structure of file names, there are two different methods to access the files:

  • using a look up table and
  • using sprintf() string function to build filenames.

Build file name with sprintf() function

If the file names contain numbers (e.g. size) that I also use in my ADS parameter sweep, it is often possible to “calculate” the filename from sweep variables using the sprintf() string function. This function is well known from many programming languages, and can be used directly in the ADS schematic:

As you can see, there is only one integer parameter n that is inserted by placeholder %i  into the file name string. Of course, sprintf() can handle multiple parameters, even with mixed parameter type. For sprintf() syntax, see http://php.net/manual/en/function.sprintf.php

For variable value 1, the resulting s2p_name string is then “testdata1.s2p”. This is only a very simple example, you can also use this function with multiple parameters of different types, to sweep across many files with multiple parameters.

Lookup tables with file name + parameters

Another option is to use look up tables. This is especially useful if the data is measured at various parameter combinations that are difficult to access with simple parameter sweep. In this case, I like to have S-parameters and the corresponding parameter values in one file, and just sweep over all entries in that file.

The file structure itself is simple:

BEGIN DSCRDATA
% INDEX filename nominal
testdata1.s2p  1
testdata2.s2p  1.5
testdata3.s2p  2
testdata4.s2p 2.5
testdata5.s2p  3
testdata6.s2p  3.5
testdata7.s2p 4
testdata8.s2p  4.5
testdata9.s2p  5
END DSCRDATA

After the header line, there is a line to declare the parameters. In our example, we have the line index, a string parameter filename and one optional numerical parameter “nominal” that is associated with each data file. This could be the nominal value of a capacitor represented by the S2P data. If you don’t need such extra information, you can leave out that column.

In the ADS schematic, we access the file using a Data Access Component (DAC). Interpolation mode is set to Index Lookup. Note how the parameter sweep is configured to find the number of lines automatically.

Schematic variables s2p_name and optional parameters (here: nominal_value) are configured to read their values from the file. This can be extended to multiple parameters if needed.

 

 

A detailed description of the file format can be found in the ADS online help, chapter “Introduction to Data Files”.

The ADS workspace with these examples can be downloaded here (64kB).