Using Mason's Rule to Analyze DSP Networks

Similar documents
DSP Configurations. responded with: thus the system function for this filter would be

SFG and Mason s Rule : A revision

Control Systems (CS)

Keywords- Source coding, Huffman encoding, Artificial neural network, Multilayer perceptron, Backpropagation algorithm

In this lecture, we will consider how to analyse an electrical circuit by applying KVL and KCL. As a result, we can predict the voltages and currents

(Refer Slide Time: )

(Refer Slide Time: 1:49)

Introduction to DSP Time Domain Representation of Signals and Systems

Control Systems, Lecture 05

CHAPTER 5 : REDUCTION OF MULTIPLE SUBSYSTEMS

MITOCW MITRES18_005S10_DerivOfSinXCosX_300k_512kb-mp4

Networks and Systems Prof. V. G. K. Murti Department of Electrical Engineering Indian Institution of Technology, Madras

Pattern Recognition Prof. P. S. Sastry Department of Electronics and Communication Engineering Indian Institute of Science, Bangalore

Notation, Matrices, and Matrix Mathematics

MITOCW ocw f99-lec16_300k

MITOCW ocw f99-lec01_300k

Electric Current. Note: Current has polarity. EECS 42, Spring 2005 Week 2a 1

EE40 KVL KCL. Prof. Nathan Cheung 09/01/2009. Reading: Hambley Chapter 1

ECE503: Digital Signal Processing Lecture 6

CSE 140 Spring 2017: Final Solutions (Total 50 Points)

Recursive, Infinite Impulse Response (IIR) Digital Filters:

CONTROL SYSTEMS ENGINEERING Sixth Edition International Student Version

Switched Mode Power Conversion Prof. L. Umanand Department of Electronics Systems Engineering Indian Institute of Science, Bangalore

Electric Circuits Part 2: Kirchhoff s Rules

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q

chapter 12 MORE MATRIX ALGEBRA 12.1 Systems of Linear Equations GOALS

DESIGN OF QUANTIZED FIR FILTER USING COMPENSATING ZEROS

Determining Appropriate Precisions for Signals in Fixed-Point IIR Filters

9.5 Radical Equations

(Refer Slide Time: 00:01:30 min)

Binary addition example worked out

Writing Circuit Equations

Section 1.1: Patterns in Division

CHAPTER D.C. CIRCUITS

Calculus of One Real Variable Prof. Joydeep Dutta Department of Economic Sciences Indian Institute of Technology, Kanpur

An Introduction to Matrix Algebra

MITOCW big_picture_derivatives_512kb-mp4

AC "POLARITY" Complex numbers are useful for AC circuit analysis because they provide a

Chapter 1: Logic systems

x y = 2 x + 2y = 14 x = 2, y = 0 x = 3, y = 1 x = 4, y = 2 x = 5, y = 3 x = 6, y = 4 x = 7, y = 5 x = 0, y = 7 x = 2, y = 6 x = 4, y = 5

A constant is a value that is always the same. (This means that the value is constant / unchanging). o

Chapter 1 Review of Equations and Inequalities

Chapter 3 ALGEBRA. Overview. Algebra. 3.1 Linear Equations and Applications 3.2 More Linear Equations 3.3 Equations with Exponents. Section 3.

A-Level Notes CORE 1

A primer on matrices

feedback cannot be maintained. If loop 2 is reduced, the signal between G

y k = (a)synaptic f(x j ) link linear i/p o/p relation (b) Activation link linear i/p o/p relation

MITOCW ocw nov2005-pt1-220k_512kb.mp4

36 What is Linear Algebra?

Math 90 Lecture Notes Chapter 1

CONTROL * ~ SYSTEMS ENGINEERING

Getting Started with Communications Engineering. Rows first, columns second. Remember that. R then C. 1

Solution to Homework Assignment 1

MITOCW ocw f99-lec23_300k

Chapter10 Convolutional Codes. Dr. Chih-Peng Li ( 李 )

Algebra Using letters to represent numbers

Chap. 3 Laplace Transforms and Applications

3: Linear Systems. Examples. [1.] Solve. The first equation is in blue; the second is in red. Here's the graph: The solution is ( 0.8,3.4 ).

MITOCW watch?v=pqkyqu11eta

ECE382/ME482 Spring 2005 Homework 1 Solution February 10,

Two-Dimensional Systems and Z-Transforms

1300 Linear Algebra and Vector Geometry

Discussion Question 6A

MITOCW ocw f99-lec09_300k

GRADUATE RECORD EXAMINATIONS. Math Review. Chapter 2: Algebra

Continuous system simulation. Prof. S. Shakya

MATH 320, WEEK 7: Matrices, Matrix Operations

Please bring the task to your first physics lesson and hand it to the teacher.

SECTION 2: BLOCK DIAGRAMS & SIGNAL FLOW GRAPHS

Our first case consists of those sequences, which are obtained by adding a constant number d to obtain subsequent elements:

Special Theory Of Relativity Prof. Shiva Prasad Department of Physics Indian Institute of Technology, Bombay

THE LOGIC OF COMPOUND STATEMENTS

The Celsius temperature scale is based on the freezing point and the boiling point of water. 12 degrees Celsius below zero would be written as

Vectors Part 1: Two Dimensions

GCSE Mathematics Non-Calculator Higher Tier Free Practice Set 1 1 hour 45 minutes ANSWERS. Grade Boundaries A* A B C D E.

Networks and Systems Prof. V. G. K. Murti Department of Electrical Engineering Indian Institute of Technology, Madras

PHY 123 Lab 1 - Error and Uncertainty and the Simple Pendulum

LECTURE NOTES DIGITAL SIGNAL PROCESSING III B.TECH II SEMESTER (JNTUK R 13)

Pre-Algebra 2. Unit 9. Polynomials Name Period

CSC236 Week 4. Larry Zhang

Chapter 1 Linear Equations. 1.1 Systems of Linear Equations

CHAPTER 1 Basic Concepts of Control System. CHAPTER 6 Hydraulic Control System

1 Modular Arithmetic Grade Level/Prerequisites: Time: Materials: Preparation: Objectives: Navajo Nation Math Circle Connection

Lesson 8: Velocity. Displacement & Time

PSEUDORANDOM BINARY SEQUENCES GENERATOR

Lecture 19 IIR Filters

MITOCW ocw feb k

Mechanics, Heat, Oscillations and Waves Prof. V. Balakrishnan Department of Physics Indian Institute of Technology, Madras

MITOCW ocw f99-lec05_300k

UNIT 1. SIGNALS AND SYSTEM

Chapter 3. Expressions and Equations Part 1

Communication Engineering Prof. Surendra Prasad Department of Electrical Engineering Indian Institute of Technology, Delhi

E : Lecture 1 Introduction

DISCRETE RANDOM VARIABLES EXCEL LAB #3

September 12, Math Analysis Ch 1 Review Solutions. #1. 8x + 10 = 4x 30 4x 4x 4x + 10 = x = x = 10.

Instructor (Brad Osgood)

Lecture 11 FIR Filters

Notes on the Z-transform, part 4 1

An Fir-Filter Example: Hanning Filter

MITOCW watch?v=jtj3v Rx7E

Transcription:

Using Mason's Rule to Analyze DSP Networks by Richard Lyons, Besser Associates 1 α This article discusses a powerful analysis method (well known to our analog control system engineering brethren) to obtain the z-domain transfer function equations of digital signal processing (DSP) networks. That method, called "Mason's Rule" (sometimes called "Mason's Gain Formula"), was developed by Samuel Mason in the early 1950s to analyze interconnected analog systems[1-]. Here we describe Mason's Rule and present several examples showing the power of this network analysis technique. Mason's Rule enables us to determine the H(z) = Y(z)/X(z) transfer function of complicated networks, such as the multi-feedback loop network in Figure 1. 1/2 2 4 2 5 1/ Figure 1: A discrete network with multiple feedback loops. Mason's Rule is also particularly useful for deriving the z-domain transfer function of, say, a discrete network that has inner feedback loops embedded within outer feedback loops (nested loops). Here's the good news: if we are able to draw the block diagram of some discrete network, then the application of Mason's Rule will give us that network's z-domain H(z) transfer function. Once we have H(z) we can then use all the algebraic and software tools at our command to determine the frequencydomain behavior, and stability, of the network. Here we describe Mason's Rule, accompanied by several examples, in the hope this robust analysis technique is of use to the reader in their future DSP network analysis efforts. For our purposes, Mason's Rule is a method to derive a discrete network's z-domain transfer function by identifying various forward paths from the input node to the output node of a discrete network, and the various feedback paths that may, or may not, share common signal nodes with those feedforward paths. This sounds mysterious, but it's not really Copyright 2008, R. Lyons, All Rights Reserved Page 1 of 8

too complicated. Let's define our Mason's Rule terminology and then demonstrate this analysis technique by way of examples. I. A FEW DEFINITIONS Mason's Rule is based on converting a network's block diagram to a signal flow diagram like that shown in Figure 2, and identifying crucial signal paths and loops. J B A C D E F G H I a b c d e f g Figure 2: Example signal flow diagram. Using Figure 2 as an example, we establish the following definitions: A gain symbol is an arrowhead with its associated z-domain function (indicated by an uppercase letter), such as a sample delay ( ) or a constant multiplier. The direction of the arrowhead shows the direction of signal flow. A signal node is a single point in the flow diagram. In Figure 2, signal nodes are indicated by an italicized lowercase letter. A path is a sequence of signal flow branches from one node to another node. A forward path is a path that travels from the input to the output, without going through the same node twice. In Figure 2, the path from node a to node g, [a,b,c,d,e,f,g], is a forward path. The gain of that forward path is the product ACDFGI. A loop is a path that starts and ends at the same node, with no node encountered more than once. That is, a loop is a feedback path. In Figure 2, the path from node b to node c and back to node b is a loop. A signal flow diagram, of course, can have multiple forward paths and multiple loops. Nontouching loops are two loops that do not share a common signal node. In Figure 2, the loops [b,c,b] and [d,e,d], for example, are nontouching loops. The loops [b,c,b] and [b,c,d,e,f,g,b] are touching loops because they share the signal nodes b and c. The loop gain of a loop is the product of all the branch gain symbols within a loop. In Figure 2, the loop gain of the [d,e,d] loop is the product FE. The loop gain of the [b,c,d,e,f,g,b] loop is the product CDFGIJ. With those simple definitions established (here comes the exciting part), we define the Δ(z) determinant of a signal flow diagram as: Δ(z) = 1 the sum of all loop gains + the sum of products of nontouching loop gains taken two at a time the sum of products of nontouching loop gains taken three at a time +... etc. (1) Copyright 2008, R. Lyons, All Rights Reserved Page 2 of 8

The "nontouching loop gains taken two at a time" are the combinations of pairs of loop gains. The pairs of nontouching loop gains in Figure 2 are the loop gain combinations: CB,FE; CB,IH; and FE,IH. The "nontouching loop gains taken three at a time" are the combinations of triplets of loop gains. The only triplet of nontouching loop gains in Figure 2 is the loop gain combination: CB,FE,IH. The Δ(z) determinant for the diagram in Figure 2 is Δ(z) = 1 (CB + FE + IH + CDFGIJ) + (CBFE + CBIH + FEIH) CBFEIH. (2) For each forward path in a signal flow diagram there is an associated determinant represented by Δ i (z). If a diagram has P = forward paths (designated as paths P 1 (z), P 2 (z), and P (z)), then there will be a Δ 1 (z), a Δ 2 (z), and a Δ (z) determinant. Subscript variable i is merely the index identifying the individual forward paths and their associated determinants. Determinant Δ i (z) is the determinant of the signal flow diagram that does not touch the ith forward path. To ascertain Δ 1 (z), for example, we delete the P 1 (z) forward path in a signal flow diagram (and any branches that touch the P 1 (z) forward path) and use the above Eq. (1) for whatever signal flow paths that remain. If no loops remain after deleting the P 1 (z) forward path, then Δ 1 (z) = 1. To recap, a signal flow diagram has a Δ(z) determinant, and each P i (z) forward path has a gain as well as its own Δ i (z) determinant. All determinants are defined by Eq. (1) once a diagram's loops have been determined. With all this said, we can now (finally) define Mason's Rule. II. MASON'S RULE, HOW TO USE IT Mason's Rule states that the H(z) = Y(z)/X(z) transfer function of a linear network is: H(z) = P P i (z)δ i (z) i=1 Δ(z) () where P is the number of forward paths in the network. To determine the transfer function of a discrete network, we implement Mason's Rule as the following series of steps: Step 1: Convert the discrete-time network block diagram to a signal flow diagram; replacing multipliers and function blocks with directional gain symbols, and replacing branching nodes and adders with signal nodes. The minus sign associated with subtraction is represented by a gain symbol of 1. Step 2: Identify the number, P, of forward paths and their individual P i (z) path gains. Step : Identify the total number of loops and their individual loop gains, as well as the number of nontouching loop pairs and nontouching loop triplets. Step 4: Delete each of the diagram's P forward paths (along with any branches touching those forward paths), in turn, and define the individual Δ i (z) determinants. Copyright 2008, R. Lyons, All Rights Reserved Page of 8

Step 5: Define the original network's overall Δ(z) determinant using Eq. (1). Step 6: Apply the P i (z) gains and the Δ i (z) and Δ(z) determinants to Eq. () to find the desired H(z) transfer function. Step 7: The final step is to sit back and enjoy a job well done. III. SOME ENCOURAGEMENT If you're still with me so far, don't worry if the above definitions and steps appear to be gibberish. I can assure you they are not. For my money, Mason's Rule is the single most powerful network analysis tool at our disposal, and I now attempt to prove that by way of examples. Please read on. IV. EXAMPLES OF MASON'S RULE Again, the Mason's rule procedure seems a bit complicated but we can show how relatively straightforward the process really is. What follows are a few examples, ranging in complexity, illustrating the execution and utility of Mason's Rule in analyzing discrete networks. Example-1 Our first Mason's Rule example will be to determine the H(z) transfer function of our old friend, the biquad infinite impulse response (IIR) filter shown in Figure (a). b 0 b 0 a 1 b 1 a 1 b 1 a 2 b 2 a 2 b 2 (a) (b) b 0 a 1 b 1 Forward path P 1 deleted a 1 b 1 a b 2 2 a 2 b 2 (c) (d) Figure : Biquad IIR filter: (a) discrete network diagram; (b) signal flow diagram; (c) forward paths shown with bold lines; (d) signal flow diagram with forward path P 1 deleted. Starting with the discrete network diagram in Figure (a), we draw the signal flow diagram shown in Figure (b). Examination of that flow diagram tells us that there are three forward paths, P = (shown by the bold lines in Figure (c)), and two loops. So the three forward path gains and the two loop gains are: P (z) = b, P (z) = b, P (z) = b 2 = b z 2, 1 0 2 1 2 Loop 1 gain = a 1, and Loop 2 gain = a 2 = a 2 z 2. Copyright 2008, R. Lyons, All Rights Reserved Page 4 of 8

Implementing Step 4, when forward path P 1 (z) is deleted, along with any branches touching P 1 (z), the remaining paths are shown in Figure (d), and those paths define forward path P 1 (z)'s determinant Δ 1 (z). In Figure (d) we see no remaining loops, so Δ 1 (z) = 1. Similarly, when forward paths P 2 (z) and P (z) are deleted, along with any paths touching P 2 (z) and P (z), no loops remain so our removed-path determinants are: Δ 1 (z) = Δ 2 (z) = Δ (z) = 1. Realizing there are no nontouching loops in our original signal flow diagram, we now use Eq. (1) to define the network's primary Δ(z) determinant to be: Δ(z) = 1 (Loop 1 gain + Loop 2 gain) = 1 (a 1 + a 2 z 2 ). We have all the information we need to use Eq. () to obtain the network's transfer function as H biquad (z) = P i (z)δ i (z) i=1 Δ(z) = P 1(z)Δ 1 (z) + P 2 (z)δ 2 (z) + P (z)δ (z) 1 a 1 a 2 z 2 = b 0 + b 1 + b 2 z 2 1 a 1 2 a 2 z. (4) Our H biquad (z) result is the well-known transfer function of a 2nd-order IIR filter. Next, let's analyze a discrete network having nested loops as given in the following example. Example-2 This example applies Mason's Rule to a DC bias removal network containing nested loops. Beginning with the network in Figure 4(a), we convert it to the signal flow diagram in Figure 4(b). Notice how the subtraction in Figure 4(a) is replaced with a gain symbol of minus one in the signal flow diagram. 1 α 1 1 α Forward path P 1 deleted (a) (b) (c) Figure 4: DC bias removal: (a) discrete network diagram; (b) signal flow diagram; (c) signal flow diagram with forward path P 1 deleted. Examination of that flow diagram tells us that there is one forward path (P = 1), and two loops. As such, the single forward path gain and the two loop gains are: P 1 (z) = 1, Loop 1 gain = (1 α) ( 1) = (1 α) = α Loop 2 gain =. Copyright 2008, R. Lyons, All Rights Reserved Page 5 of 8

When forward path P 1 (z) is deleted, the remaining paths are shown in Figure 4(c). There we see one remaining loop, so the determinant associated with forward path P 1 (z) is: Δ 1 (z) = 1. Because there are no nontouching loops in our original signal flow diagram, using Eq. (1) to define the network's primary Δ(z) determinant, we state: Δ(z) = 1 (Loop 1 gain + Loop 2 gain) = 1 [α + ] = 1 α. Given what we know so far, we use Eq. () to obtain the network's transfer function as H(z) BiasRemove = 1 P i (z)δ i (z) i=1 Δ(z) = P 1(z)Δ 1 (z) 1 α = 1 z 1 1 α. (5) Next present a final Mason's Rule example that brings to bear all the concepts we've covered so far. Example- Let's analyze that intricate network in Figure 1 by first converting it to the signal flow diagram in Figure 5(a). 2 b 1/2 c 4 a 2 d f e 5 (a) 1/ f Forward path P 1 deleted 1/ e b 1/2 Forward path P 2 deleted c (b) (c) Figure 5: Signal flow diagrams for Figure 1: (a) complete signal flow diagram; (b) signal flow diagram with forward path P 1 deleted; (c) signal flow diagram with forward path P 2 deleted. Upon first glance at the flow diagram in Figure 5(a), we might guess this network has two forward paths and two loops. Watch out! The network actually has four forward paths, three loops, and a pair of nontouching loops. (Careful scrutiny is needed when evaluating a signal flow diagram Copyright 2008, R. Lyons, All Rights Reserved Page 6 of 8

in preparation for Mason's Rule. Stated in different words, using Mason's Rule is like pinning a cloth diaper on a baby the process requires caution because a small mistake can cause big problems.) Examination of the Figure 5(a) flow diagram tells us we have P = 4 forward paths, and three loops. The forward path gains (with the path nodes indicated in brackets) and loop gains are: P 1 (z) = 8, [a,b,c,d] P 2 (z) = 15, [a,f,e,d] P (z) = 0z 2, [a,b,c,f,e,d] P 4 (z) = 24z 2. [a,f,e,b,c,d] Loop 1 gain = /2, [b,c,b] Loop 2 gain = /, [f,e,f] Loop gain = 6z 2. [b,c,f,e,b] When forward path P 1 (z) is deleted, the remaining paths are shown in Figure 5(b), with one remaining loop, so Δ 1 (z) = 1 /. Similarly, when forward path P 2 (z) is deleted, the remaining paths are shown in Figure 5(c), with one remaining loop, thus Δ 2 (z) = 1 /2. Now when forward paths P (z) and P 4 (z) are deleted we have no paths remaining. Thus our removedpath determinants are: Δ 1 (z) = 1 /, Δ 2 (z) = 1 /2, Δ (z) = 1, Δ 4 (z) = 1. In this example there are two nontouching loops, [b,c,b] and [f,e,f], so the sum of products nontouching loop gains taken two at a time is /2 times / = z 2 /6. So we now use Eq. (1) to define the network's primary Δ(z) determinant to be: Δ(z) = 1 (Loop 1 gain + Loop 2 gain + Loop gain) + (product of Loop 1 gain and Loop 2 gain) = 1 ( /2 + / + 6z 2 ) + z 2 /6 = 1 (5/6) (5/6)z 2. Using Eq. () to obtain the network's transfer function, we have H(z) = 4 P i (z)δ i (z) i=1 Δ(z) = P 1(z)Δ 1 (z) + P 2 (z)δ 2 (z) + P (z)δ (z) + P 4 (z)δ 4 (z) 1 (5/6) (5/6)z 2 = 8z 1 (1 /) + 15 (1 /2) + 0z 2 + 24z 2 1 (5/6) (5/6)z 2 = 2 + (26/6)z 2 1 (5/6) 2 (5/6)z. (6) After plowing through this last example, Step 7 at the end of Section II is well-deserved. Copyright 2008, R. Lyons, All Rights Reserved Page 7 of 8

V. MATLAB Code For those readers having access of MATLAB software, there is a Mason's Rule MATLAB function, written by Rob Walton, available at: <http://www.mathworks.com/matlabcentral/fileexchange/22>. Walton's slick routine requires the user to create a ".txt" file describing a network's signal paths. The ".txt" file for our above Example# contains the following 10 lines of text (parameters are separated by tabs). 1 1 2 2 2 2 (1/2) 2 z^(-1) 4 5 2 2 5 4 4 6 5 4 5 7 6 8 6 5 z^(-1) 9 5 6 (1/) 10 1 6 Conclusion Mason's Rule is an analog system analysis technique formulated in the early 1950s (around the time the young truck driver Elvis Presley arrived on the pop music scene) by Samuel Mason. Here we described how to use Mason's Rule to aid in modern-day discrete (DSP) network analysis. Although a bit tedious for complicated networks, Mason's Rule provides a super-effective method for determining the z-domain transfer function of even the most complicated discrete networks. Happily, public domain Mason's Rule MATLAB code is available. References [1] S. Mason, "Feedback Theory: Some Properties of Signal Flow Graphs," Proc. of IRE, Vol. 41, pp. 1144-1156, Sept. 195. [2] S. Mason, "Feedback Theory: Further Properties of Signal Flow Graphs," Proc. of IRE, Vol. 44, pp. 1920-926, Sept. 1956. [] S. Mason and H. Zimmerman, Electronic Circuits, Signals, and Systems, John Wiley & Sons, New York, 1960. About the Author Richard (Rick) Lyons is a consulting Systems Engineer and lecturer with Besser Associates in Mountain View, California. He is the author of "Understanding Digital Signal Processing 2/E" (Prentice-Hall, 2004), and Editor of, and contributor to, "Streamlining Digital Signal Processing, A Tricks of the Trade Guidebook" (IEEE Press/Wiley, 2007). Lyons is also an Associate Editor for the IEEE Signal Processing Magazine. Copyright 2008, R. Lyons, All Rights Reserved Page 8 of 8