CalcPort

calcPort is a post-simulation function to calculate frequency- and time-domain properties and data for ports.

The port has to be created by, for example, , ,, or.

Input parameters

 * port:      return value of AddMSLPort
 * SimDir:    directory, where the simulation files are
 * f:  frequency vector for calculation

varargin parameters

 * RefImpedance: use a given reference impedance to calculate incident and reflected voltages and currents
 * default is given port or calculated line impedance
 * RefPlaneShift: for transmission lines only, See also calcTLPort for more details
 * SwitchDirection: 0/1, switch assumed direction of propagation
 * SignalType:   'pulse' (default) or 'periodic'

Output
The output structure, where   is the port number, has the following components:

Output signals/values in time domain (TD)

 * :    total voltage (time-domain)
 * :   voltage time vector
 * :    total current (time-domain)
 * :   current time vector

Output signals/values in frequency domain (TD)

 * :                 frequency vector
 * :    total, incident and reflected voltage
 * :    total, incident and reflected current
 * :             reference impedance used


 * :             incident power
 * :             reflected power
 * :             accepted power (incoming minus reflected, may be negative for passive ports)

Transmission line port properties

 * :             propagation constant
 * :               characteristic line impedance
 * :    reference characteristic line impedance used

Examples
Create two waveguide ports with port 1 active:

After the FDTD simulation is complete, perform the following calculations to get the s-parameters. The frequency-domain incident and reflected voltages are used.