Signal-Flow Graphs and Mason's Gain Rule
Block-diagram reduction works by rearranging pictures one step at a time, and with three interlocking loops and a feedforward path it becomes a page of error-prone sketches. A signal-flow graph (SFG) is the same information stripped to nodes and arrows, and Mason's gain rule reads the overall transfer function straight off it, in one formula. It is also the natural way to see why some loops interact and others do not, and it is how many circuit-analysis and filter-synthesis texts derive transfer functions of op-amp networks.
From block diagram to graph
In a signal-flow graph:
- every signal is a node (a dot);
- every block is a directed branch with its transfer function as the gain;
- a node equals the sum of all branches entering it (so summing junctions disappear: a subtraction becomes a branch gain with a minus sign), and it sends its value along every branch leaving it.
The graph above has an input , an output , three feedback branches and one feedforward branch from straight to the output. Some vocabulary:
| Term | Meaning in the figure |
|---|---|
| forward path | a path from input to output that visits no node twice: (via ), (via and ) |
| loop | a closed path visiting no node twice: , , |
| touching | two loops (or a loop and a path) share at least one node |
| non-touching | they share none: here only (nodes ) and (nodes ) |
Mason's rule
- : all individual loop gains; : products of all pairs of non-touching loops; then triples of mutually non-touching loops, with alternating signs.
- : the same determinant built only from the loops that do not touch path (1 if every loop touches it).
The rule is the solution of the graph's linear node equations by Cramer's rule, organised so you never write the equations down (Cramer's rule is the underlying idea).
Worked example: three loops and a bypass
Given: the graph above with , , , , , , .
Find: , its DC gain and poles.
Solve:
- Loops: , , . One non-touching pair: .
- .
- touches every loop: . passes through , so it touches and , but not : .
- . Substituting and clearing the denominators :
- DC gain ; poles from : , a well-damped complex pair (). The loops have turned two real open-loop poles into a complex pair.
Check: SymPy solves the five node equations directly (no Mason) and compares the two results.
import sympy as sp
s, R = sp.symbols("s R")
x1, x2, x3, x4, Y = sp.symbols("x1 x2 x3 x4 Y")
G1, G2, G3 = 10 / (s + 1), 1, 5 / (s + 5)
H1, H2, H3, G4 = sp.Rational(1, 2), 1, sp.Rational(1, 5), sp.Rational(1, 10)
# each node = sum of the branches entering it
eqs = [sp.Eq(x1, R - H1 * x2 - H3 * x4),
sp.Eq(x2, G1 * x1),
sp.Eq(x3, G2 * x2 - H2 * x4),
sp.Eq(x4, G3 * x3),
sp.Eq(Y, x4 + G4 * x1)]
sol = sp.solve(eqs, [x1, x2, x3, x4, Y], dict=True)[0]
T_nodes = sp.factor(sp.simplify(sol[Y] / R))
L1, L2, L3 = -G1 * H1, -G3 * H2, -G1 * G2 * G3 * H3
Delta = 1 - (L1 + L2 + L3) + L1 * L2
T_mason = sp.factor(sp.simplify((G1 * G2 * G3 * 1 + G4 * (1 - L2)) / Delta))
print("node equations:", T_nodes)
print("Mason's rule: ", T_mason)
print("equal:", sp.simplify(T_nodes - T_mason) == 0, " DC gain:", T_mason.subs(s, 0),
"=", f"{float(T_mason.subs(s, 0)):.4f}")
print("poles:", ", ".join(f"{complex(p).real:.3f} {complex(p).imag:+.3f}j" for p in sp.solve(sp.denom(T_mason), s)))node equations: (s**2 + 11*s + 510)/(10*(s**2 + 16*s + 70))
Mason's rule: (s**2 + 11*s + 510)/(10*(s**2 + 16*s + 70))
equal: True DC gain: 51/70 = 0.7286
poles: -8.000 -2.449j, -8.000 +2.449j
Solving node equations is what a computer does; Mason's rule is what a person does on paper, and it shows structure: the factor on the bypass term says that loop , which the bypass never enters, acts on the bypass's contribution only through the rest of (the factor partly cancels against its terms in ), while the loops the bypass does touch shape it fully.
Interacting and non-interacting loops
Non-touching loops multiply in : the term means the two inner loops act independently, each setting its own factor of the characteristic polynomial ( if were absent). Touching loops do not factor: tuning one changes the other. This is the formal version of a practical rule for cascade control: an inner loop should be tuned first and made much faster, so the outer loop sees it as a near-constant gain.
In the lab: a circuit is a signal-flow graph
An op-amp circuit's node equations are a signal-flow graph too. The netlist lab solves an inverting integrator ( into the summing node, from output to summing node, the op-amp a high-gain VCVS) whose output is also fed back to the summing node through . In the graph, the forward path from the input to the output has gain , and the loop through has the same gain . Mason gives , a low-pass with DC gain and corner .
Guided lab: check a reduced transfer function on a breadboard
Hand calculation. Build the circuit of the lab with one op-amp (half a TL072 or similar), resistors and a capacitor. Mason predicts at with a phase of (inverted low-pass), and at .
Simulation. The lab shows at for ; slide to and it shows at (the small difference from is because is not exactly ).
What you would measure. (or ) bench supply with current limits of , a function generator at peak, a two-channel scope. Expect the corner within about of ( resistors, capacitor), the gain at within of .
Hazards and safe setup. Low-voltage split supply, current-limited; power the op-amps before applying the signal; check polarity of any electrolytic decoupling capacitors.
Pitfalls
- Counting a "loop" that visits a node twice (it is two loops).
- Forgetting a loop created by a feedforward branch that lands upstream of a feedback pickoff.
- Using by habit: check, for each path, which loops it misses.
- Writing a subtraction as a node instead of a (or ) branch gain.
Practice
- A single loop: forward , feedback . Apply Mason's rule.
- Two non-touching loops , and one forward path of gain 4 that touches both. Find .
- In the worked example, what would be if ?
Answer
- , , , : .
- ; .
- , DC gain .
Test yourself
In Mason's rule, for a forward path that touches every loop is
- 0
- 1
- the path gain
Which products appear in with a plus sign?
- all pairs of loops
- pairs of non-touching loops
- pairs of touching loops
- forward-path gains
Loops and do not touch and there are no other loops. Then equals
The DC gain of the worked example's is
- 0.714
- 0.729
- 1.000
- 7.29