next up previous contents
Next: -combine: Build scattering matrices Up: gd1.pp Previous: -wakes: longitudinal and transverse   Contents

-totouchstone: convert fri-data to touchstone format

This section allows the combination of scattering parameters in fri-files to touchstone files.
The section -sparameter may be used to generate the fri-files.
 ##############################################################################
 # Flags: nomenu, noprompt, nomessage,                                        #
 ##############################################################################
 # section: -totouchstone                                                     #
 ##############################################################################
 # outfile= ./s-matrix.sXp                                                    #
 # ports= 2                                                                   #
 # normalise= yes                                                             #
 #                                                                            #
 # ij= (1,1)                  -- Index of S-Parameter                         #
 # file=  -none-
 #                            -- filename of s-parameter                      #
 # factor= 1.0                -- factor to apply                              #
 # ###                                                                        #
 # already specified files:                                                   #
 # ij: (1,1), factor: 1.0                                                     #
 #   file:  -none-
 # ij: (1,2), factor: 1.0                                                     #
 #   file:  -none-
 # ij: (2,1), factor: 1.0                                                     #
 #   file:  -none-
 # ij: (2,2), factor: 1.0                                                     #
 #   file:  -none-
 ##############################################################################
 # clear, doit, ?, return, end, help, ls                                      #
 ##############################################################################

Note: All fri-files must have the same frequency resolution (use wantdf= DF), and must have the same frequency range.
Example The following shell-script computes the four rows of the scattering matrix of a four-port device, by exciting four times a different port. The computed scattering parameters are stored as fri-files and are combined to one TouchStone-file.
#!/bin/sh

#
# First Step:
# Computation of the four rows of the scattering matrix.
# The results of each computation are stored in a different file.
#
#    In the inputfile "arndt.00.x.gdf", the outfile is defined as
#       outfile= /tmp/bruw1931/garbage/arndt-excitation-at-PEXC
#
#
# At each computation, a different port is excited.
#
#    In the inputfile, the excitation is defined via:
#  -pexcitation
#     port= PEXC,
#     mode= 1, amplitude= 1, frequency= 17e9, bandwidth= 20e9,
#

 for PEXC in xlow1 xhigh1 xlow2 xhigh2
 do
    gd1 -DPEXC=$PEXC < arndt.00.x.gdf | tee out-excitation=$PEXC
 done

#
# Fouriertransform, and generating fri-files.
# The names of the fri-files are defined via
#
#  -general, scratch= /tmp/bruw1931/garbage/exc-at-$PEXC-
#
# Frequency resolution is 10 MHz  (wantdf= 10e6)
#
 for PEXC in xlow1 xhigh1 xlow2 xhigh2
 do
    gd1.pp << EOF
      -general
         infile= /tmp/bruw1931/garbage/arndt-excitation-at-$PEXC
         scratch= /tmp/bruw1931/garbage/exc-at-$PEXC-
      -sparameter
         window= yes, edgeofwindow= 0.7
         wantdf= 10e6
         flow= 5e9, fhigh= 25e9
         timedata= no, fsumpower= no, magnitude= no, phase= no, smithplot= no
         fri= yes
         onlyplotfiles= yes
         doit
EOF
 done

#
# Second step.
# Combining the rows of the scattering matrix to one TouchStone-file.
#

 gd1.pp << EOF
 -totouchstone
    clear     # file= - undefined -
    ports= 4

 sdefine(BASE, /tmp/bruw1931/garbage/exc-at)
    sdefine(P1, xlow1) sdefine(P2, xhigh1)
    sdefine(P3, xlow2) sdefine(P4, xhigh2)
      ij= (1,1), file= [BASE]-[P1]-[P1]_out_1.fri
      ij= (1,2), file= [BASE]-[P1]-[P2]_out_1.fri
      ij= (1,3), file= [BASE]-[P1]-[P3]_out_1.fri
      ij= (1,4), file= [BASE]-[P1]-[P4]_out_1.fri

      ij= (2,1), file= [BASE]-[P2]-[P1]_out_1.fri
      ij= (2,2), file= [BASE]-[P2]-[P2]_out_1.fri
      ij= (2,3), file= [BASE]-[P2]-[P3]_out_1.fri
      ij= (2,4), file= [BASE]-[P2]-[P4]_out_1.fri

      ij= (3,1), file= [BASE]-[P3]-[P1]_out_1.fri
      ij= (3,2), file= [BASE]-[P3]-[P2]_out_1.fri
      ij= (3,3), file= [BASE]-[P3]-[P3]_out_1.fri
      ij= (3,4), file= [BASE]-[P3]-[P4]_out_1.fri

      ij= (4,1), file= [BASE]-[P4]-[P1]_out_1.fri
      ij= (4,2), file= [BASE]-[P4]-[P2]_out_1.fri
      ij= (4,3), file= [BASE]-[P4]-[P3]_out_1.fri
      ij= (4,4), file= [BASE]-[P4]-[P4]_out_1.fri

     outfile= /tmp/bruw1931/garbage/touchstone.s4p

    doit
EOF

##############


next up previous contents
Next: -combine: Build scattering matrices Up: gd1.pp Previous: -wakes: longitudinal and transverse   Contents