Application of flow graphs in the microwave measurements systems

Flow graphs are the effective tool for description of the complicated microwave measurement systems and usually are used in the process of creating measurement equation. The algorithm which can find this equation is known as the Mason's gain formula (MGF). This operation needs to perform a lot of symbolic computations so performing of this algorithm without proper software is heavy and is vulnerable to appearing some errors. This paper shows which existing scripts for MATLAB can be use to perform this task.


Introduction
Microwave measurement is the branch of metrology in which some physical phenomena uncommon for other areas are occurred. Voltage and current values can't be used for description of the signals because high frequency signals must be analyzed as the waves.
The reason of it is the fact that in microwave measuring systems the wave is reflected many times between planes (connectors) with different characteristic impedance. Similar situation occurs in optics where rays are reflected between media with a varying index of refraction. In the microwave systems transmitted wave is attenuated and delayed many times. All these operations can change magnitude and phase of the signal. Consequence of it is the fact that measured energy of the wave for each part of measuring system depends on vector sum of all transmitted and reflected voltage waves. One of the difference between optical and microwave systems is that in optical systems usually only one wavelength parameters are analyzed but in the microwave systems parameters for all frequencies of bandwidth have to be found separately.

Scattering matrix
The microwave systems can be characterized as n-port network, where n is the sum of numbers of inputs and outputs [6]. For example termination loads or power sensors are characterized as one-port network, attenuator as two-port Fig. 1, splitters or dividers as three-port, directional couplers as three or four-port networks. Parameters of the n-port network can be characterized by n x n size S-matrix (1). The network can be created from splitters, terminations, attenuators, power sensors and other components and can be described as one n-port network. Number of components which form the network has no influence on the size of substitute S-matrix.
Scattering matrix called S-matrix is very common form used for describing microwave networks. The S xy elements reflect the physical characteristic of the whole system. These coefficients are complex numbers, magnitude represents attenuation or amplification, phase represents signal delay. For the microwave networks S-matrix coefficients are usually different for different frequencies and need to be measured for every specified frequency because there is no global rule to describe relationship between values for separate frequencies.
All these reasons cause that calculations are complicated and it can be difficult to predict behavior of the expanded systems when all S-matrixes of components are available. The tool which can improve process of analysis is flow graph.

Flow graphs
Flow graph is the graphical method for presenting system of equations [3]. It is widely used in the theory of control. The transmittance in control systems describes dependencies similarly like S-matrix for microwave system, feedback has similar function to repeated reflection of voltage wave. Fig. 2 shows sample conversion from system of equation (4) to flow graph.  Using of flow graphs brings very important advantage during process of designing microwave system. Connecting of two microwave components is equal to connecting their flow graphs, output node of the first flow graph becomes input node of the second.
The representation of microwave system as flow graph gives ability to apply algorithm which is known in control theory as the Mason's gain formula MGF [4].

Mason's gain formula (MGF)
MGF is the algorithm which provides the way to find the gain between any specified nodes of flow graph [1]. This gain is expressed by equations: patha continuous set of branches traversed in the direction that they indicate; forward patha path from an input node to an output node in which no node is touched more than once; loopa path that originates and ends on the same node in which no node is touched more than once; path gainthe product of the gains of all the branches in the path; loop gainthe product of the gains of all the branches in the loop.  Step 1 (find all the forward paths between Step 4 (find product of any three non-touching loops)  The microwave system which was presented at Fig. 4 is relatively simple (it's typical system for calculating power sensor cal factor) however when all path gains and loop gains are substituted to equation (5) and (6) calculation becomes very complicated. This is the reason why some publications [5,6] show simplified method for creating measuring equation and uncertainty estimation. Taking all these aspects into consideration it's obvious that full analysis of microwave system in all frequency bandwidth without adequate software is unreasonable. To solve this problem is possible to use MATLAB.

Automatic realization of MGF
The MATLAB software offers script which provides realization the Mason's gain formula algorithm [9]. This script named mason.m is very easy for use. It needs only net-file with defined microwave system and m-file with information which gain should be find. If MATLAB has Symbolic Math Toolbox it's possible to simplify result and use equations for further calculation. The syntax of net-file is:

[Coefficient #][Start Node #][Stop Node #][Coefficient Name]
Every line of code contains start node, stop node and coefficient name for every branch of flow graph. Figure 5 shows net-file which describes the microwave system presented at Fig. 4 in the form acceptable for mason.m script: is presented at Fig. 6. The start and stop node during the gain calculation process can be changed very easily by setting integer numbers in the formula:  The gain equation (Fig. 7) allows to model the microwave system. All the coefficients are complex because of the scattering matrix properties. Fig. 7 measuring equation can be use for estimation of uncertainty by the Monte Carlo method.
It's possible to modify magnitude, phase and probability distribution of each coefficient, what can be useful for assessing how specific components have influence on expanded uncertainty of the measurement.

MGF for power splitter ratio measurements
Power splitter is typical microwave element used for power ratio measurements. For power splitter ratio measurements the value of the ratio 14 ) 1 ( wherein: 16 G -gain between node ) 1 (

Summary
The microwave measurement in some aspects needs specific approach in the process of creation measurement equation and uncertainty estimation [2]. Even relatively simple measuring system in many cases has complicated measuring equation.
For the people who are novice in microwave technique some clues can be useful:  elements of scattering matrix (reflection coefficient, transmission coefficient) are complex, be sure when in equations occurs complex value or the magnitude of the value;  the probability distribution of reflection coefficient isn't normal distribution [2];  never average measurements in magnitude -phase form, use only real -imaginary form. The result is completely different for these two methods. The reason becomes obvious while considering the example, why average value of 160° and -160°is 0° but it should be value 180° for this case;  when derivatives are calculated during uncertainty estimation process in some cases the ones don't exist in specified ranges. Software can often find the result but it has no physical sense.
The result RL = 60 dB with standard uncertainty u(RL) = 52,11 dB is completely useless. This result is the consequence of fact that logarithmic function and its derivative don't exist for negative values (0,001 -0,006 < 0). For many other branches of metrology fact of discontinuity of the derivative of the function does not have practical importance for uncertainty estimation;  in some cases reflection coefficient can be converted directly into its standard uncertainty according to equations [ The methods, software and clues indicated in this paper can improve process of measuring in daily practice and let avoid some basic errors which can be very difficult to detect. The ones can be used in high-precision calibration as well as routine low-precision calibration.