0% found this document useful (0 votes)
8 views43 pages

Capitulo 2

The document outlines the definitions and representations of functions, signals, and systems, emphasizing the importance of assignment rules and their complementary uses in both procedural and mathematical contexts. It discusses various methods of defining functions, including declarative assignments, graphs, and procedures, while also distinguishing between functions and general relations. The chapter serves as a foundational exploration of how to effectively define and analyze signals and systems in engineering.

Uploaded by

Oliver
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views43 pages

Capitulo 2

The document outlines the definitions and representations of functions, signals, and systems, emphasizing the importance of assignment rules and their complementary uses in both procedural and mathematical contexts. It discusses various methods of defining functions, including declarative assignments, graphs, and procedures, while also distinguishing between functions and general relations. The chapter serves as a foundational exploration of how to effectively define and analyze signals and systems in engineering.

Uploaded by

Oliver
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

2

Defining Signals and Systems

Contents
2.1 Defining functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.1.1 Declarative assignment . . . . . . . . . . . . . . . . . . . . . 52
2.1.2 Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Probing Further: Relations . . . . . . . . . . . . . . . . . . . . . . . 56
2.1.3 Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.1.4 Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.1.5 Composition . . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.1.6 Declarative vs. imperative . . . . . . . . . . . . . . . . . . . 62
Probing Further: Declarative and imperative . . . . . . . . . . . . . 63
2.2 Defining signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.2.1 Declarative definitions . . . . . . . . . . . . . . . . . . . . . 66
2.2.2 Imperative definitions . . . . . . . . . . . . . . . . . . . . . 66
2.2.3 Physical modeling . . . . . . . . . . . . . . . . . . . . . . . 68
2.3 Defining systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Probing Further: Physics of a Tuning Fork . . . . . . . . . . . . . . 70
2.3.1 Memoryless systems and systems with memory . . . . . . . . 71
2.3.2 Differential equations . . . . . . . . . . . . . . . . . . . . . . 72
2.3.3 Difference equations . . . . . . . . . . . . . . . . . . . . . . 74
Basics: Trigonometric Identities . . . . . . . . . . . . . . . . . . . . 76
Basics: Summations . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.3.4 Composing systems using block diagrams . . . . . . . . . . . 78
Probing Further: Composition of graphs . . . . . . . . . . . . . . . . 80
2.4 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

49
2.1. DEFINING FUNCTIONS

The previous chapter describes the representation of signals and systems as functions,
concentrating on how to select the domain and range. This chapter is concerned with how
to give more complete definitions of these functions. In particular, we need an assignment
rule, which specifies how to assign an element in the range to each element in the domain.
There are many ways to give an assignment rule. A theme of this chapter is that these dif-
ferent ways have complementary uses. Procedural descriptions of the assignment rule, for
example, are more convenient for synthesizing signals or constructing implementations of
a system in software or hardware. Mathematical descriptions are more convenient for an-
alyzing signals and systems and determining their properties.
In practice it is often necessary to use several descriptions of assignment rules in combi-
nation, because of their complementary uses. In designing systems, a practicing engineer
is often reconciling these diverse views to ensure, for instance, that a particular hardware
device or piece of software indeed implements a system that is specified mathematically.
We begin with a discussion of functions in general, and then specialize to signals and
systems.

2.1 Defining functions

A function f : X → Y assigns to each element in X a single element in Y , as illustrated in


Figure 2.1. This assignment can be defined by declaring the mathematical relationship
between the value in X and the value in Y , by graphing or enumerating the possible
assignments, by giving a procedure for determining the value in Y given a value in X, or
by composing simpler functions. We go over each of these in more detail in this section.

Example 2.1: In Section 1.1.5 we mentioned that sequences are a special kind
of function. An infinite sequence s is a function that maps the natural numbers
into some set Y , as illustrated in Figure 2.2. This function fully defines any infinite
sequence of elements in Y .

50 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

x1 y1
x2 y2
x3 y3
x4 y4

X f:X! Y Y

Figure 2.1: A function f : X → Y assigns to each element in X a single element in


Y.

1 y1
2 y2
3 y3
4 y4
...

Naturals s : Naturals ! Y Y

Figure 2.2: An infinite sequence s is a function s : N → Y that assigns to each


element in N a single element in Y .

Lee & Varaiya, Signals and Systems 51


2.1. DEFINING FUNCTIONS

2.1.1 Declarative assignment

Consider the function Square : R → R given by

∀ x ∈ R, Square(x) = x2 . (2.1)

In (2.1), we have used the universal quantifier symbol ‘∀’, which means ‘for all’ or ‘for
every’ to declare the relationship between values in the domain of the function and values
in the range. Statement (2.1) is read: “for every value of x in R, the function Square
evaluated at x is assigned the value x2 .” The expression “Square(x) = x2 ” in (2.1) is an
assignment.1
Expression (2.1) is an instance of the following prototype for defining functions. Define
f : X → Y by
∀ x ∈ X, f (x) = expression in x. (2.2)

In this prototype, f is the name of the function to be defined, such as Square, X is the
domain of f , Y is the range of f , and ‘expression in x’ specifies the value in Y assigned to
f (x).
The prototype (2.2) does not say how the ‘expression in x’ is to be evaluated. In the
Square example above, it was specified by the algebraic expression Square(x) = x2 . Such
a definition of a function is said to be declarative, because it declares properties of the
function without directly explaining how to construct the function.

Example 2.2: Here are some examples of functions of complex variables. (See
Appendix B for a review of complex variables.)
The magnitude of a complex number is given by abs : C → R+ , where C is the set
of complex numbers and R+ is the set of set of non-negative real numbers, and
q
∀ z = x + iy ∈ C, abs(z) = (x2 + y2 ).

The complex conjugate of a number, conjugate : C → C, is given by

∀ z = x + iy ∈ C, conjugate(z) = x − iy.

1 See Appendix A for a discussion of the use of “=” as an assignment, vs. its use as an assertion.

52 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

The exponential of a complex number, exp : C → C, is given by



zn
∀ z ∈ C, exp(z) = ∑ .
n=0 n!

If this notation is unfamiliar, see box on page 77.) It is worth emphasizing that
the last definition is declarative: it does not give a procedure for calculating the
exponential function, since the sum is infinite. Such a calculation would never
terminate.

Example 2.3: The signum function gives the sign of a real number, signum : R →
{−1, 0, 1},
 −1 if x < 0

∀ x ∈ R, signum(x) = 0 if x = 0 (2.3)
1 if x > 0

The right side of this assignment tabulates three expressions for three different sub-
sets of the domain. Below we will consider a more extreme case of this where every
value in the domain is tabulated with a value in the range.

Example 2.4: The size of a matrix, size : Matrices → N × N, is given by

∀ M ∈ Matrices, size(M) = (m, n),

where m is the number of rows of the matrix M, n is the number of columns of M,


and Matrices is the set of all matrices.
This definition relies not only on formal mathematics, but also on the English sen-
tence that defines m and n. Without that sentence, the assignment would be mean-
ingless.

Lee & Varaiya, Signals and Systems 53


2.1. DEFINING FUNCTIONS

2.1.2 Graphs

Consider a function f : X → Y . To each x ∈ X, f assigns the value f (x) in Y . The pair


(x, f (x)) is an element of the product set X × Y . The set of all such pairs is called the
graph of f , written graph( f ). Using the syntax of sets, graph( f ) is the subset of X × Y
defined by
graph( f ) = {(x, y) | x ∈ X and y = f (x)}, (2.4)
or slightly more simply,

graph( f ) = {(x, f (x)) | x ∈ X}.

The vertical bar | is read “such that,” and the expression after it is a predicate that defines
the set.2
When X ⊂ R and Y ⊂ R, we can plot graph( f ) on a page.

Example 2.5: Consider the graph of the function Square,

graph(Square) = {(x, x2 ) | x ∈ R},

which is plotted in Figure 2.3. In that figure, the horizontal and vertical axes repre-
sent the domain and the range, respectively (more precisely, a subset of the domain
and the range). The rectangular region enclosed by these axes represents the prod-
uct of the domain and the range (every point in that region is a member of (R × R)).
The graph is visually rendered by placing a black dot at every point in that region
that is a member of graph(Square). The resulting picture is the familiar plot of the
Square function.

While the graph of f : X → Y is a subset of X × Y , it is a very particular sort of subset.


For each element x ∈ X, there is exactly one element y ∈ Y such that (x, y) ∈ graph( f ). In
particular, there cannot be more than one such y ∈ Y , and there cannot be no such y ∈ Y .
This is, in fact, what we mean when we say that f is a function.

2 See appendix A for a review of this notation.

54 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

0.9

0.8

0.7

0.6

0.5

0.4

0.3

0.2

0.1

0
−1 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 0.8 1

Figure 2.3: Graph of Square

Example 2.6: Let X = {1, 2} and Y = {a, b}. Then

{(1, a), (2, a)}

is the graph of a function, but

{(1, a), (1, b)}

is not, because two points a and b are assigned to the same point, 1, in the domain.
Neither is
{(1, a)},
because no point in the range is assigned to the point 2 in the domain.

The graph of Square, graph(Square), is given by the algebraic expression (x, x2 ). In other
cases, no such algebraic expression exists. For example, Voice is specified through its
graph in Figure 1.1, not through an algebraic expression. Thus, graphs can be used to
define functions that cannot be conveniently given by declarative assignments.

Lee & Varaiya, Signals and Systems 55


2.1. DEFINING FUNCTIONS

x1 y1
x2 y2
x3 y3
x4 y4

X Relation ! X × Y Y

Figure 2.4: Any subset of X ×Y is a relation.

Consider again the prototype in (2.2),

∀ x ∈ X, f (x) = expression in x

The graph of f is

graph( f ) = {(x, y) ∈ X ×Y | y = expression in x}.

The expression ‘y = expression in x’ is a predicate in the variable (x, y) and so this proto-
type definition conforms to the prototype new set constructor given in (A.4) of Appendix
A:
NewSet = {z ∈ Set | Pred(z)}.

Probing Further: Relations

The graph of a function f : X → Y is a subset of X ×Y , as defined in (2.4). An arbitrary


subset of X ×Y is called a relation. A relation is a set of tuples (x, y) that pair an element
x ∈ X with an element y ∈ Y , as suggested in Figure 2.4. For relations, it is common to
call X the domain and Y the codomain. A function is a special kind of relation in which
for every x ∈ X there is exactly one y ∈ Y such that (x, y) is an element of the relation.
So a particular relation R ⊂ X ×Y is a function if for every x ∈ X there is a y1 ∈ Y such
that (x, y1 ) ∈ R, and if in addition (x, y2 ) ∈ R, then y1 = y2 .

56 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

Name Marks
John Brown 90.0
Jane Doe 91.2
··· ···

Table 2.1: Tabular representation of Score.

Since the graph of f is a set, we can define the function f via its graph using the same
techniques we use to define sets.
2.1.3 Tables

If f : X → Y has finite domain, then graph( f ) ⊂ X ×Y is a finite set, so it can be specified


simply by a list of all its elements. This list can be put in the form of a table. This table
defines the function.

Example 2.7: Suppose the function

Score : Students → [0, 100]

gives the outcome of the first midterm exam for each student in the class. Obvi-
ously, this function cannot be given by an algebraic declarative assignment. But it
can certainly be given as a table, as shown in table 2.1.

Example 2.8: The command nslookup on a networked computer is a function that


maps hostnames into their IP (Internet) address. For example, if you type:

nslookup cory.eecs.berkeley.edu

you get the IP address 128.32.134.240. The domain name server attached to your
machine stores the nslookup function as a table.

Lee & Varaiya, Signals and Systems 57


2.1. DEFINING FUNCTIONS

2.1.4 Procedures

Sometimes the value f (x) that a function f assigns to an element x ∈ domain( f ) is ob-
tained by executing a procedure.

Example 2.9: Here is a Matlab procedure to compute the factorial function

fact : {1, · · · , 10} → N,

where N is the set of natural numbers:

fact(1) = 1;
for n = 2:10
fact(n) = n * fact(n-1);
end

Unlike previous mechanisms for defining a function, this one gives a constructive method
to determine an element in the range given an element in the domain. This style is called
imperative to distinguish it from declarative. The relationship between these two styles
is interesting, and quite subtle. It is explored further in Section 2.1.6.

2.1.5 Composition

Functions can be combined to define new functions. The simplest mechanism is to con-
nect the output of one function to the input of another. We have been doing this informally
to define systems by connecting components in block diagrams.
If the first function is f1 and the second is f2 , then we write the function composition as
f2 ◦ f1 . That is, for every x in the domain of f1 ,

( f2 ◦ f1 )(x) = f2 ( f1 (x)).

A fundamental requirement for such a composition to be valid is that the range of f1


must be a subset of the domain of f2 . In other words, any output from the first function

58 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

f 3

f 1(x)
x f 2 (f 1(x)) = f 3 (x)

X f 1
Y
f 2 Y’

X’

Figure 2.5: Function composition: f3 = f2 ◦ f1 .

must be in the set of possible inputs for the second. Without this input-output connection
restriction, the interconnection would be meaningless.3
It is worth pausing to study the notation f2 ◦ f1 . Assume f1 : X → Y and f2 : X 0 → Y 0 .
Then if Y ⊂ X 0 , we can define
f3 = f2 ◦ f1 ,
where f3 : X → Y 0 such that
∀ x ∈ X, f3 (x) = f2 ( f1 (x)) (2.5)
Notice that f1 is applied first, and then f2 . Why is f1 listed second in f2 ◦ f1 ? This
convention simply mirrors the ordering of f2 ( f1 (x)) in (2.5). We can visualize f3 as in
Figure 2.5.

Example 2.10: Consider the representation of a color image using a colormap.


The decoding of the image is depicted in Figure 1.7. The image itself might be
given by the function
ColormapImage : DiscVerticalSpace × DiscHorizontalSpace
→ ColorMapIndexes.
3 We just called an element in the domain of a function its input and the corresponding value of the function

its output. This interpretation of domain as inputs and range as outputs is natural, and it is the reason that
systems are described by functions.

Lee & Varaiya, Signals and Systems 59


2.1. DEFINING FUNCTIONS

The function
Display : ColorMapIndexes → Intensity3
decodes the colormap indexes. If ColorMapIndexes has 256 values, it could be
identified with the set Integers8 of all 8-bit words, as we have seen. If we compose
these functions

ColorComputerImage = Display ◦ ColormapImage

then we get the decoded representation of the image

ColorComputerImage : DiscVerticalSpace × DiscHorizontalSpace


→ Intensity3 .

ColorComputerImage describes how an image looks when it is displayed, whereas


ColormapImage describes how it is stored in the computer.

If f : X → X, i.e. the domain and range of f are the same, we can form the function

f2 = f ◦ f.

We can compose f 2 with f to form f 3 , and so on.

Example 2.11: Consider the function S : R2 → R2 , where the assignment


(y1 , y2 ) = S(x1 , x2 ) is defined by matrix multiplication,
    
y1 1 2 x1
= . (2.6)
y2 3 4 x2

The function S2 = S ◦ S : R2 → R2 is also defined by matrix multiplication, and the


corresponding matrix is the square of the matrix in (2.6).

60 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

To see this, let (y1 , y2 ) = S(x1 , x2 ) and (z1 , z2 ) = S(y1 , y2 ) = (S ◦ S)(x1 , x2 ). Then
we see that
         
z1 1 2 y1 1 2 1 2 x1
= =
z2 3 4 y2 3 4 3 4 x2
| {z }
A
 2     
1 2 x1 7 10 x1
= =
3 4 x2 15 22 x2
| {z }
A2
 
x1
= A2 .
x2

Example 2.12: Consider another example in the context of the telephone system.
Let Voices be the set of possible voice input signals of the form

Voice : Time → Pressure.

Voices is a function space,

Voices = [Time → Pressure].

A telephone converts a Voice signal into a signal in the set

LineSignals = [Time → Voltages].

Thus, we could define

Mouthpiece : Voices → LineSignals.

The twisted wire pair may distort this signal, so we define a function

LocalLoop : LineSignals → LineSignals.

The input to the line card therefore is

(LocalLoop ◦ Mouthpiece)(Voice).

Lee & Varaiya, Signals and Systems 61


2.1. DEFINING FUNCTIONS

Similarly let BitStreams be the set of possible bitstreams of the form:

BitStream : DiscreteTime → Binary

where DiscreteTime = {0, 1/64, 000, 2/64, 000, · · · }, since there are 64,000 bit-
s/sec. So,
BitStreams = [DiscreteTime → Binary].
The encoder in a line card can be mathematically described as a function

Encoder : LineSignals → BitStreams

or, with more detail, as a function

Encoder : [Time → Voltages] → [DiscreteTime → Binary].

The digital telephone network itself might be modeled as a function

Network : BitStreams → BitStreams.

We can continue in this fashion until we model the entire path of a voice signal
through the telephone network as the function composition

Earpiece ◦ LocalLoop2 ◦ Decoder ◦ Network ◦ Encoder


◦LocalLoop1 ◦ Mouthpiece. (2.7)

Given a complete definition of each of these functions, we would be well equipped


to understand the degradations experienced by a voice signal in the telephone net-
work.

2.1.6 Declarative vs. imperative

Declarative definitions of functions assert a relationship between elements in the domain


and elements in the range. Imperative definitions give a procedure for finding an element
in the range given one in the domain. Often, both types of specifications can be given for
the same function. However sometimes the specifications are subtly different.

62 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

Consider the function


SquareRoot : R+ → R+

defined by the statement “SquareRoot(x) is the unique value of y ∈ R+ such that y2 = x.”
This declarative definition of SquareRoot does not tell us how to calculate its value at
any point in its domain. Nevertheless, it defines SquareRoot perfectly well. By contrast,
an imperative definition of SquareRoot would give us a procedure, or algorithm, for cal-
culating SquareRoot(x) for a given x. Call the result of such an algorithm ŷ. Since the
algorithm would yield an approximation in most cases, ŷ2 would not be exactly equal to
x. So the declarative and imperative definitions are not always the same.
Any definition of a function following the prototype (2.2) is a declarative definition. It
does not give a procedure for evaluating ‘expression in x’.

Probing Further: Declarative and imperative

The declarative approach establishes a relation between the domain and the range of a
function. For example, the equation

y = sin(x)/x

can be viewed as defining a subset of R × R. This subset is the graph of the function
Sinc : R → R.
The imperative approach also establishes a function, but it is a function that maps the
program state before the statement is executed into a program state after the statement
is executed. Consider for example the Java statement
y = Math.sin(x)/x;

Considering only this statement (rather than a larger program), the program state is the
value of the two variables, x and y. Suppose that these have been declared to be of type
double, which in Java represents double-precision floating-point numbers encoding
according to an IEEE standard. Let the set Doubles be the set of all numbers so encoded,
and note that NaN ∈ Doubles, not a number, the result of division by zero. The set of
possible program states is therefore Doubles × Doubles. The Java statement therefore
defines a function

Statement : (Doubles × Doubles) → (Doubles × Doubles).

Lee & Varaiya, Signals and Systems 63


2.1. DEFINING FUNCTIONS

Example 2.13: As another example where declarative and imperative definitions


differ in subtle ways, consider the following mathematical equation:

sin(x)
y= . (2.8)
x
Consider the following Java statement:

y = Math.sin(x)/x;

or an equivalent Matlab statement

y = sin(x)/x

Superficially, these look very similar to (2.8). There are minor differences in syntax
in the Java statement, but otherwise, it is hard to tell the difference. But there are
differences. For one, the mathematical equation (2.8) has meaning if y is known and
x is not. It declares a relationship between x and y. The Java and Matlab statements
define a procedure for computing y given x. Those statements have no meaning if
y is known and x is not.
The mathematical equation (2.8) can be interpreted as a predicate that defines a
function, for example the function Sinc : R → R, where

graph(Sinc) = {(x, y) | x ∈ R, y = sin(x)/x}. (2.9)

The Java and Matlab statements can be interpreted as imperative definitions of a


function. Confusingly, many programming languages, including Matlab, use the
term “function” to mean something a bit different from a mathematical function.
They use it to mean a procedure that can compute an element in the range of
a function given an element in its domain. Under certain restrictions (avoiding
global variables for example), Matlab functions do in fact compute mathematical
functions. But in general, they do not. .
To interpret the Java and Matlab statements as imperative definitions of a function,
note that given an element in the domain, they specify how to compute an element
in the range. However, these two statements do not define the same function as

64 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

in (2.9). To see this, consider the value of y when x = 0. Given the mathematical
equation, it is not entirely trivial to determine the value of y. You can verify that
y = 1 when x = 0 using l’Hôpital’s rule, which states that if f (a) = g(a) = 0, then

f (x) f 0 (x)
lim = lim 0 , (2.10)
x→a g(x) x→a g (x)

if the limit exists, where f 0 (x) is the derivative of f with respect to x, and g0 (x) is
the derivative of g with respect to x.
In contrast, the meaning of the Java and Matlab statements is that y = 0/0 when
x = 0, which Java and Matlab (and most modern languages) define to be NaN, not
a number. Thus, given x = 0, the procedures yield different values for y than the
mathematical expression. (An exception is symbolic algebra programs, such as
Mathematica or Maple, which will evaluate sin(x)/x to 1 when x = 0. These pro-
grams use sophisticated, rule-based solution techniques, and, in effect, recognize
the need and apply l’Hôpital’s rule.)

We can see from the above example some of the strengths and weaknesses of imperative
and declarative approaches. Given only a declarative definition, it is difficult for a com-
puter to determine the value of y. Symbolic mathematical software, such as Maple and
Mathematica, is designed to deal with such situations, but these are very sophisticated
programs. In general, using declarative definitions in computers requires quite a bit more
sophistication than using imperative definitions.
Imperative definitions are easier for computers to work with. But the Java and Matlab
statements illustrate one weakness of the imperative approach: it is arguable that y = NaN
is the wrong answer, so the Java and Matlab statements have a bug. This bug is unlikely
to be detected unless, in testing, these statements happen to be executed with the value
x = 0. A correct Java program might look like this:

if (x == 0.0) y = 1.0;
else y = Math.sin(x)/x;

Thus, the imperative approach has the weakness that ensuring correctness is more dif-
ficult. Humans have developed a huge arsenal of techniques and skills for thoroughly

Lee & Varaiya, Signals and Systems 65


2.2. DEFINING SIGNALS

understanding declarative definitions (thus lending confidence in their correctness), but


we are only beginning to learn how to ensure correctness in imperative definitions.

2.2 Defining signals

Signals are functions. Thus, both declarative and imperative approaches can be used to
define them.

2.2.1 Declarative definitions

Consider for example an audio signal s, a pure tone at 440 Hz (middle A on the piano
keyboard). Recall that audio signals are functions Sound : Time → Pressure, where the
set Time ⊂ R represents a range of time and the set Pressure represents air pressure.4 To
define this function, we might give the declarative description

∀ t ∈ Time, s(t) = sin(440 × 2πt). (2.11)

In many texts, you will see the shorthand

s(t) = sin(440 × 2πt)

used as the definition of the function s. Using the shorthand is only acceptable when
the domain of the function is well understood from the context. This shorthand can be
particularly misleading when considering systems, and so we will only use it sparingly.
A portion of the graph of the function (2.11) is shown in Figure 1.3.

2.2.2 Imperative definitions

We can also give an imperative description of such a signal. When thinking of signals
rather than more abstractly of functions, there is a subtle question that arises when we
attempt to construct an imperative definition. Do you give the value of s(t) for a particular
t? Or for all t in the domain? Suppose we want the latter, which seems like a more
4 Recall
further that we normalize Pressure so that zero represents the ambient air pressure. We also use
arbitrary units, rather than a physical unit such as millibars.

66 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

complete definition of the function. Then we have a problem. The domain of this function
may be any time interval, or all time! Suppose we just want one second of sound. Define
t = 0 to be the start of that one second. Then the domain is [0, 1]. But there are an
(uncountably) infinite number of values for t in this range! No Java or Matlab program
could provide the value of s(t) for all these values of t.
Since a signal is function, we give an imperative description of the signal exactly as we
did for functions. We give a procedure that has the potential of providing values for s(t),
given any t.

Example 2.14: We could define a Java method as follows:

double s(double t) {
return (Math.sin(440*2*Math.PI*t));
}

Calling this method with a value for t as an argument yields a value for s(t). Java
(and most object-oriented languages) use the term “method” for most procedures.

Another alternative is to provide a set of samples of the signal.

Example 2.15: In Matlab, we could define a vector t that gives the values of time
that we are interested in:

t = [0:1/8000:1];

In the vector t there are 8001 values evenly spaced between 0 and 1, so our sam-
pling rate is 8000 samples per second. Then we can compute values of s for these
values of t and listen to the resulting sound:

s = cos(2*pi*440*t);
sound(s,8000)

The vector s also has 8001 elements, representing evenly spaced samples of one
second of A-440.

Lee & Varaiya, Signals and Systems 67


2.3. DEFINING SYSTEMS

2.2.3 Physical modeling

An alternative way to define a signal is to construct a model for a physical system that
produces that signal.

Example 2.16: A pure tone might be defined as a solution to a differential equation


that describes the physics of a tuning fork.
A tuning fork consists of a metal finger (called a tine) that is displaced by striking
it with a hammer. After being displaced, it vibrates. If the tine has no friction, it
will vibrate forever. We can denote the displacement of the tine after being struck
at time zero as a function y : R+ → R. If we assume that the initial displacement
introduced by the hammer is one unit, then using our knowledge of physics we can
determine that for all t ∈ R+ , the displacement satisfies the differential equation

ÿ(t) = −ω20 y(t) (2.12)

where ω0 is constant that depends on the mass and stiffness of the tine, and and
where ÿ(t) denotes the second derivative with respect to time of y (see box).
It is easy to verify that y given by

∀ y ∈ R+ , y(t) = cos(ω0t) (2.13)

is a solution to this differential equation (just take its second derivative). Thus,
the displacement of the tuning fork is sinusoidal. This displacement will couple
directly with air around the tuning fork, creating vibrations in the air (sound). If
we choose materials for the tuning fork so that ω0 = 2π × 440, then the tuning fork
will produce the tone of A-440 on the musical scale.

2.3 Defining systems

All of the methods that we have discussed for defining functions can be used, in princi-
ple, to define systems. However, in practice, the situation is much more complicated for
systems than for signals. Recall from Section 1.2.1 that a system is a function where the
domain and range are sets of signals called signal spaces. Elements of these domains and

68 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

displacement restorative force

tine

Figure 2.6: A tuning fork.

ranges are considerably more difficult to specify than, say, an element of R or Z. For this
reason, it is almost never reasonable to use a graph or a table to define a system. Much
of the rest of this book is devoted to giving precise ways to define systems where some
analysis is possible. Here we consider some simple techniques that can be immediately
motivated. Then we show how more complicated systems can be constructed from sim-
pler ones using block diagrams. We give a rigorous meaning to these block diagrams so
that we can use them without resorting to perilous intuition to interpret them.
Consider a system S where

S : [D → R] → [D0 → R0 ]. (2.14)

Suppose that x ∈ [D → R] and y = S(x). Then we call the pair (x, y) a behavior of the
system. A behavior is an input, output pair. The set of all behaviors is

Behaviors(S) = {(x, y) | x ∈ [D → R] and y = S(x)}.

Giving the set of behaviors is one way to define a system. Explicitly giving the set
Behaviors, however, is usually impractical, because it is a huge set, typically infinite (see
boxes on pages 679 and 681). Thus, we seek other ways of talking about the relationship
between a signal x and a signal y when y = S(x).

Lee & Varaiya, Signals and Systems 69


2.3. DEFINING SYSTEMS

To describe a system, one must specify its domain (the space of input signals), its range
(the space of output signals), and the rule by which the system assigns an output signal
to each input signal. This assignment rule is more difficult to describe and analyze than
the input and output signals themselves. A table is almost never adequate, for example.
Indeed for most systems we do not have effective mathematical tools for describing or

Probing Further: Physics of a Tuning Fork

A tuning fork consists of two fingers called tines, as shown in Figure 2.6. If you displace
one of these tines by hitting it with a hammer, it will vibrate with a nearly perfect sinu-
soidal characteristic. As it vibrates, it pushes the air, creating a nearly perfect sinusoidal
variation in air pressure that propogates as sound. Why does it vibrate this way?
Suppose the displacement of the tine (relative to its position at rest) at time t is given
by x(t), where x : R → R. There is a force on the tine pushing it towards its at-rest
position. This is the restorative force of the elastic material used to make the tine. The
force is proportional to the displacement (the greater the displacement, the greater the
force), so
F(t) = −kx(t),
where k is the proportionality constant that depends on the material and geometry of the
tine. In addition, Newton’s second law of motion tells us the relationship between force
and acceleration,
F(t) = ma(t),
where m is the mass and a(t) is the acceleration at time t. Of course,

d2
a(t) = x(t) = ẍ(t),
dt
so
mẍ(t) = −kx(t)
or
ẍ(t) = −(k/m)x(t).
Comparing with (2.12), we see that ω20 = k/m.
A solution to this equation needs to be some signal that is proportional to its own
second derivative. A sinusoid as in (2.13) has exactly this property. The sinusoidal
behavior of the tine is called simple harmonic motion.

70 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

t x x(t)

F(x) f
y(t)

Reals y(t) = (F(x))(t) = f(x(t)) Y

Figure 2.7: A memoryless system F has an associated function f that can be


used to determine its output y(t) given only the current input x(t) at time t. In
particular, it does not depend on values of the function x for other values of time.

understanding their behavior. Thus, it is useful to restrict our system designs to those we
can understand. We first consider some simple examples.

2.3.1 Memoryless systems and systems with memory

Memoryless systems are characterized by the property that previous input values are not
remembered when determining the current output value. More precisely, a system F :
[R → Y ] → [R → Y ] is memoryless if there is a function f : Y → Y such that

∀ t ∈ R and ∀ x ∈ [R → Y ], (F(x))(t) = f (x(t)).

This is illustrated in Figure 2.7. In other words, at any time t, the output (F(x))(t) depends
only on the input x(t) at that same time t; in particular, it does not depend on t nor on
previous or future values of x.
Specification of a memoryless system reduces to specification of the function f . If Y is
finite, then a table may be adequate.

Lee & Varaiya, Signals and Systems 71


2.3. DEFINING SYSTEMS

Example 2.17: Consider a continuous-time system with input x and output y,


where for all t ∈ R,
y(t) = x2 (t).
This example defines a simple system, where the value of the output signal at each
time depends only on the value of the input signal at that time. Such systems are
said to be memoryless because you do not have to remember previous values of the
input in order to determine the current value of the output.

By contrast, here is an example of a system with memory.

Example 2.18: Consider a continuous-time system with input x and output y =


F(x) such that ∀ t ∈ R,
1 t
Z
y(t) = x(τ)dτ.
M t−M
By a change of variables this can also be written
Z M
1
y(t) = x(t − τ)dτ.
M 0

This system is clearly not memoryless. It has the effect of smoothing the input
signal. We will study it and many related systems in detail in later chapters.

2.3.2 Differential equations

Consider a class of systems given by functions S : ContSignals → ContSignals where


ContSignals is a set of continuous-time signals. Depending on the scenario, we could
have ContSignals = [Time → R] or ContSignals = [Time → C], where Time = R or Time =
R+ . These are often called continuous-time systems because they operate on continuous-
time signals. Frequently, such systems can be defined by differential equations that relate
the input signal to the output signal.

72 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

Example 2.19: Consider a particle constrained to move forward or backwards


along a straight line with an externally imposed force. We will consider this particle
to be a system where the output is its position and the externally imposed force is
the input.
Denote the position of the particle by x : Time → R, where Time = R+ . By con-
sidering only the non-negative reals, we are assuming that the model has a starting
time. We denote the acceleration by a : Time → R. By Newton’s law, which relates
force, mass, and acceleration,

f (t) = ma(t),

where f (t) is the force at time t, and m is the mass. By the definition of acceleration,

∀ t ∈ R+ , ẍ(t) = a(t) = f (t)/m,

where ẍ(t) denotes the second derivative with respect to time of x. If we know the
initial position x(0) and initial speed ẋ(0) of the particle at time 0, and if we are
given the input force f , we can evaluate the position at any t by integrating this
differential equation
Z t Z s
x(t) = x(0) + ẋ(0)t + [ ( f (τ)/m)dτ]ds. (2.15)
0 0

We can regard the initial position and velocity as inputs, together with force, in
which case the system is a function

Particle : R × R × [R+ → R] → [R+ → R],

where for any inputs (x(0), ẋ(0), f ), x = Particle(x(0), ẋ(0), f ) must satisfy (2.15).
Suppose for example that the input is (1, −1, f ) where m = 1 and ∀ t ∈ R+ , f (t) = 1.
We can calculate the position by carrying out the integration in (2.15) to find that

∀ t ∈ R+ , x(t) = 1 − t + 0.5t 2 .

Suppose instead that x(0) = ẋ(0) = 0 and ∀ t ∈ R+ , f (t) = cos(ω0t), where ω0 is


some fixed number. Again, we can carry out the integration to get
cos(ω0t) − 1
Z tZ s
cos(ω0 u)du ds = − .
0 0 ω20

Lee & Varaiya, Signals and Systems 73


2.3. DEFINING SYSTEMS

Notice that the position of the particle is sinusoidal. Notice further that the ampli-
tude of this sinusoid decreases as ω0 increases. Intuitively, this has to be the case.
If the externally imposed force is varying more rapidly back and forth, the particle
has less time to respond to each direction of force, and hence its excursion is less.
In subsequent chapters, we will study how the response of certain kinds of systems
varies with the frequency of the input.

2.3.3 Difference equations

Consider a class of systems given by functions S : DiscSignals → DiscSignals where


DiscSignals is a set of discrete-time signals. Depending on the scenario, we could have
DiscSignals = [Z → R] or DiscSignals = [Z → C], or even DiscSignals = [N0 → R], or
DiscSignals = [N0 → C]. These are often called discrete-time systems because they op-
erate on discrete-time signals. Frequently, such systems can be defined by difference
equations that relate the input signal to the output signal.

Example 2.20: Consider a system


S : [N0 → R] → [N0 → R]
where for all x ∈ [N0 → R], S(x) = y is given by
∀ n ∈ Z, y(n) = (x(n) + x(n − 1))/2.
The output at each index is the average of two of the inputs. This is a simple
example of a moving average system, where typically more than two input values
get averaged to produce an output value.
Suppose that x = u, the unit step function, defined by
1 if n ≥ 0

∀ n ∈ Z, u(n) = (2.16)
0 otherwise
We can easily calculate the output y,
if n ≥ 1

 1
∀ n ∈ Z, y(n) = 1/2 if n = 0
0 otherwise

74 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

The system smoothes the transition of the unit step a bit.


A slightly more interesting input is a sinusoidal signal given by

∀ n ∈ Z, x(n) = cos(2π f n).

The output is given by

∀ n ∈ Z, y(n) = (cos(2π f n) + cos(2π f (n − 1)))/2.

Using the trigonometric identities in the box on page 76 this can be written as

y(n) = R cos(2π f n + θ)

where
sin(−2π f )
θ = arctan( )/2,
1 + cos(−2π f )
p
R = 2 + 2 cos(2π f )

As in the previous example, a sinusoidal input stimulates a sinusoidal output with


the same frequency. In this case, the amplitude of the output varies (in a fairly
complicated way) as a function of the input frequency. We will examine this phe-
nomenon in more detail in subsequent chapters by studying the frequency response
of such systems.

Example 2.21: The general form for a moving average is given by

1 M−1
∀ n ∈ Integers, y(n) = ∑ x(n − k),
M k=0

where x is the input and y is the output. (If this notation is unfamiliar, see box on
page 77.)
This system is called an M-point moving average, since at any n it gives the average
of the M most recent values of the input. It computes an average, just like example
2.18 but the integral has been replaced by its discrete counterpart, the sum.

Lee & Varaiya, Signals and Systems 75


2.3. DEFINING SYSTEMS

Moving averages are widely used on Wall Street to smooth out momentary fluctuations in
stock prices to try to determine general trends. We will study the smoothing properties of
this system. We will also study more general forms of difference equations of which the
moving average is a special case.
The examples above give declarative definitions of systems. Imperative definitions re-
quire giving a procedure for computing the output signal given the input signal. It is clear
how to do that with the memoryless system, assuming that an imperative definition of the
function f is available, and with the moving average. The integral equation, however, is
harder to define imperatively. An imperative description of such systems that is suitable
for computation on a computer requires approximation via solvers for differential equa-
tions. Simulink, for example, which is part of the Matlab package, provides such solvers.
Alternatively, an imperative description can be given in terms of analog circuits or other
physical systems that operate directly on the pertinent continuous domain. Discrete-time
systems often have reasonable imperative definitions as state machines, considered in
detail in the next chapter.

Basics: Trigonometric Identities

The following trigonometric identities will prove useful repeatedly:

A cos(θ + α) + B cos(θ + β) = C cos θ − S sin θ = R cos(θ + φ)

where
C = A cos α + B cos β
S =√A sin α + B sin β
R = C 2 + S2
φ = arctan(S/C)

76 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

Basics: Summations

In example 2.21, a discrete-time moving average system is defined by

1 M−1
∀ n ∈ Integers, y(n) = ∑ x(n − k),
M k=0
M−1
where x is the input and y is the output. The notation ∑ indicates a sum of M terms.
k=0
The terms are x(n − k), where k takes on values from 0 to M − 1. Thus,
M−1
∑ x(n − k) = x(n) + x(n − 1) + · · · + x(n − M + 1).
k=0

Such summations are related to integrals. Example 2.18 describes a continuous-time


system with input x and output y where
Z t
1
∀ t ∈ R, y(t) = x(τ)dτ.
M t−M

This is similar to the discrete-time moving average in that it sums values of x, but it
sums over a continuum of values of the dummy variable τ. In the discrete-time version,
the sum is over discrete values of the dummy variable k, which takes only integer val-
ues. The summation notation has an ambiguity that it does not share with the integral
notation. In particular, it is not clear how to interpret an expression like
M−1
∑ 1 + 2.
k=0

There are two possibilities, depending on whether the 2 is included in the summation
or is interpreted as being outside the summation. One possibility gives a sum of 3M,
while the other gives M + 2. In integration, this ambiguity does not occur because of the
explicit reference to the dummy variable as dτ. In particular, it is clear that
Z T Z T
1 + 2dτ 6= 1dτ + 2.
0 0

The left integral is equal to 3T , while the right integral is T + 2.

Lee & Varaiya, Signals and Systems 77


2.3. DEFINING SYSTEMS

2.3.4 Composing systems using block diagrams

We have been using block diagrams informally to describe systems. But it turns out that
block diagrams can have as rigorous and formal a meaning as mathematical notations.
We begin the exploration of this concept here, and pursue it much further in Chapter 4.
A block diagram is a visual syntax for describing a system as an interconnection of other
(component) systems, each of which emphasizes one particular input-to-output transfor-
mation of a signal. A block diagram is a collection of blocks interconnected by arrows.
Arrows are labeled by signals. Each block represents an individual system that transforms
an incoming or input signal into an outgoing or output signal.
A block diagram, which is a composition of systems, is itself a system. We can use
function composition, as discussed in Section 2.1.5, to give a precise meaning to this
larger system. A block represents a function, and the connection of an output from one
block to the input of another represents the composition of their two functions. The only
requirement for interconnecting two blocks is that the output of the first block must be an
acceptable input for the second.
Block diagrams can be much more readable than symbolic function composition, particu-
larly for complicated interconnections. They also offer a natural hierarchy, where we can
combine blocks to hide certain signals and component systems and to emphasize others.
For certain sorts of blocks, composing them in a block diagram results in a new system
whose properties are easy to determine. In chapter 4 we will show how to combine state
machine blocks to define a new state machine. In Chapter 8 we will show how to combine
filter blocks to define new filter blocks. Here, we consider the composition of blocks
when all we know about the blocks is that they represent functions with a given domain
and range. No further structure is available.
The simplest block diagram has a single block, as in Figure 2.8. The block represents a
system with input signal x and output signal y. Here, x denotes a variable over the set X,
and y denotes a variable over the set Y . The system is described by the function S : X → Y .
Both X and Y are sets of functions or signals. Therefore the variables x and y themselves
denote functions.
In general, a system obtained by a cascade composition of two blocks is given by the
composition of the functions describing those blocks. In figure 2.9 the function S de-
scribes the system obtained by connecting the systems S1 and S2 , with S = S2 ◦ S1 , i.e.
∀ x ∈ X, S(x) = S2 (S1 (x)).

78 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

x"X y "Y
S:X!Y
X = [DX ! RX] Y = [DY ! RY]

Figure 2.8: The simplest block diagram represents a function S that maps an input
signal x ∈ X to an output signal y ∈ Y . The domain and range of the input are DX
and RX , repectively, and of the output, DY and RY .

x"X y "Y z "Z


S1 : X ! Y S2 : Y ! Z
X = [D ! R] Y = [D' ! R'] Z = [D'' ! R'']

S:X!Z

Figure 2.9: The cascade composition of the two systems is described by S =


S2 ◦ S1 .

The combined system has input signal x, output signal z, and internal signal y. (The
internal signal is not visible in the input or output of the combined system.) Of course,
the range of the first system must be contained by the domain of the second for this
composition to make sense. In the figure, the typical case is shown where this range and
domain are the same. The voice path in (2.7) is an example of cascade composition.
Consider two more block diagrams with slightly more complicated structure. Figure 2.10
is similar to Figure 2.9. The system described by S1 is the same as before, but the system
described by S2 has a pair of input signals (w, y) ∈ W × Y . The combined system has
the pair (x, w) ∈ X × W as input signal, z as output signal, y as internal signal, and it is
described by the function S : X ×W → Z, where

∀(x, w) ∈ X ×W, S(x, w) = S2 (w, S1 (x)). (2.17)

Lee & Varaiya, Signals and Systems 79


2.3. DEFINING SYSTEMS

Probing Further: Composition of graphs

We suggest a general method for writing down a declarative specification of the inter-
connected system S in Figure 2.9 in terms of the subsystems S1 and S2 and the connec-
tion restriction that the output of S1 be acceptable as an input of S2 .
We describe S1 and S2 by their graphs,

graph(S1 ) = {(x, y1 ) ∈ X ×Y | y1 = S1 (x)},

graph(S2 ) = {(y2 , z) ∈ Y × Z | z = S2 (y2 )},


and we specify the connection restriction as the predicate

y1 = y2 .

We use different dummy variables y1 and y2 to distinguish between the two systems and
the connection restriction.
The graph of the combined system S is then given by

graph(S) = {(x, z) ∈ X × Z | ∃y1 , ∃y2


(x, y1 ) ∈ graph(S1 ) ∧ (y2 , z) ∈ graph(S2 ) ∧ y1 = y2 }.

Here, ∧ denotes logical conjunction, “and.” It is now straightforward to show that


graph(S) = graph(S2 ◦ S1 ) so that S = S2 ◦ S1 .
In the case of the cascade composition of Figure 2.9 this elaborate method is unnec-
essary, since we can write down S = S2 ◦ S1 simply by inspecting the figure. But for
feedback connections, we may not be able to write down the combined system directly.
There are three other reasons to understand this method. First, we use it later to
obtain a description of interconnected state machines from their component machines.
Second, this method is used to describe electronic circuits. Third, if we want a computer
to figure out the description of the interconnected system from a description of the
subsystems and the connection restrictions, we have to design an algorithm that the
computer must follow. Such an algorithm can be based on this general method.

80 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

w"W
W = [DW ! RW]
z "Z
S2 : W × Y ! Z
Z = [DZ ! RZ]
x"X y "Y
S1 : X ! Y
X = [DX ! RX] Y = [DY ! RY]

S:W×X!Z

Figure 2.10: The combined system with input signals x, w and output signal z is
described by the function S, where ∀ (x, w), S(x, w) = S2 (w, S1 (x)).

Notice that it is now much harder to define this system using the function composition
notation, ◦, yet the block diagram makes its definition evident. In fact, the block diagram
notation is much more flexible.
The system of Figure 2.11 is obtained from that of figure 2.10 by connecting the output
signal z to the input signal w. As a result the new system has input signal x, output signal
z, internal signals y and w, and it is described by the function S0 : X → Z, where

∀ x ∈ X, S0 (x) = S2 (S0 (x), S1 (x)). (2.18)

The connection of z to w is called a feedback connection because the output z is fed back
as input w. Of course, such a connection has meaning only if Z, the range of S2 , is a subset
of W . The system in Figure 2.11 is again difficult to define using function composition
notation, ◦, yet again the block diagram definition is clear.
There is one enormous difference between (2.17) and (2.18). Expression (2.17) serves as
a definition of the function S: to every (x, w) in its domain S assigns the value given by
the right-hand side which is uniquely determined by the given functions S1 and S2 . But in
expression (2.18) the value S0 (x) assigned to x may not be determined by the right-hand
side of (2.18), since the right-hand side itself depends on S0 (x). In other words, (2.18) is
an equation that must be solved to determine the value of S0 (x) for a given x; i.e. S0 (x) = y
where y is a solution of
y = S2 (y, S1 (x)). (2.19)

Lee & Varaiya, Signals and Systems 81


2.4. SUMMARY

z"W
Z#W
z "Z
S2 : W × Y ! Z
Z = [DZ ! RZ]
x"X y "Y
S1 : X ! Y
X = [DX ! RX] Y = [DY ! RY]

S' : X ! Z

Figure 2.11: The combined system is described by the function S0 , where S0 (x) =
S2 (S0 (x), S1 (x)).

Such a solution, if it exists, is called a fixed point. We now face the difficulty that this
equation may have no solution, exactly one solution, or several solutions. Another diffi-
culty is that the value y that solves (2.19) is not a number but a function. So it will not
be easy to solve such an equation. Since feedback connections always arise in control
systems, we will study how to solve them. We will first solve them in the context of state
machines, which are introduced in the next chapter.
All of these block diagrams follow the same principles. They use component systems
to define composite systems. To be useful, of course, it is necessary to be able to infer
properties of the composite systems. Fortunately, this is often the case, although feedback
connections will prove subtle. This idea is explored further in chapters 4 and 8.

2.4 Summary

Signals and systems both are modeled as functions. It is often straightforward to figure
out the domain and range of a particular signal and system. It is more difficult to specify
the function’s assignment rule. Since the domain and range of a system are themselves
signal spaces, the assignment rule for a system is more complex than for a signal. The
domain and range signal spaces of a system can be quite different: a modem converts bit
sequences into sounds, an encoder converts sounds into bit sequences.

82 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

The assignment rule of a function takes a declarative or imperative form. The declarative
form is usually mathematical, as in: define Chirp : [−1, 1] → R by

∀t ∈ [−1, 1], Chirp(t) = cos(20πt 2 ).

The imperative form is a procedure to evaluate the function at an arbitrary point in its
domain. The procedure may involve a table lookup (if the domain is finite) or a computer
program. If the domain is infinite, the evaluation procedure may only yield an approxi-
mation of the declarative form of the “same” function.
A physical system is often described using differential or difference equations that em-
body its “law of motion.” A mechanical system’s law of motion is derived from Newton’s
laws. An electrical circuit’s law of motion is derived from Kirchhoff’s laws and the laws
of the circuit’s constitutive elements: resistors, capacitors, inductors, transistors.
Most systems are built by composing smaller subsystems. The composition may be ex-
pressed in the visual syntax of block diagrams or, mathematically, using function compo-
sition. Feedback is the most complex form of system composition: a feedback specifica-
tion requires the solution of a fixed point equation.

Lee & Varaiya, Signals and Systems 83


EXERCISES

Exercises

Each problem is annotated with the letter E, T, C which stands for exercise, requires some
thought, and requires some conceptualization. Problems labeled E are usually mechani-
cal, those labeled T require a plan of attack, those labeled C usually have more than one
defensible answer.

1. E The broadcast signal of an AM radio station located at 110 on your dial has a
carrier frequency of 110 kHz. An AM signal that includes the carrier has the form
∀ t ∈ Time, AMSignal(t) = (1 + m(t)) sin(2π × 110, 000t),
where m is an audio signal like Voice in figure 1.1, except that ∀ t ∈ Time, |m(t)| < 1.
Since you cannot easily plot such a high frequency signal, give an expression for
and plot AMSignal (using Matlab) for the case where Time = [0, 1], m(t) = cos(πt),
and the carrier frequency is 20 Hz.
2. T This problem studies the relationship between the notion of delay and the graph
of a function.
(a) Consider two functions f and g from R into R where ∀ t ∈ R, f (t) = t and
g(t) = f (t −t0 ), where t0 is a fixed number. Sketch a plot of f and g for t0 = 1
and t0 = −1. Observe that if t0 > 0 then graph(g) is obtained by moving
graph( f ) to the right, and if t0 < 0 by moving it to the left.
(b) Show that if f : R → R is any function whatsoever, and ∀ t, g(t) = f (t − t0 ),
then if (t, y) ∈ graph( f ), then (t + t0 , y) ∈ graph(g). This is another way of
saying that if t0 > 0 then the graph is moved to the right, and if t0 < 0 then the
graph is moved to the left.
(c) If t represents time, and if t0 > 0, we say that g is obtained by delaying f .
Why is it reasonable to say this?
3. E Indicate whether the following statements are true or false.
(a) [{1, 2, 3} → {a, b}] ⊂ [N → {a, b}]
(b) {g | g = graph( f ) ∧ f : X → Y } ⊂ X ×Y
(c) F : [R → R] → [R → R], such that ∀ t ∈ R, and ∀ x ∈ [R → R],
(F(x))(t) = sin(2π · 440t)
is a memoryless system.

84 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

1 1

graph(g)
graph(f )

-1 0 1 -1 0 1

-0.5

Figure 2.12: Graphs of two functions. The bold line is the graph.

(d) Let f : R → R and g : R → R, where g is obtained by delaying f by τ ∈ R.


That is,
∀ t ∈ R, g(t) = f (t − τ).
Then graph(g) ⊂ graph( f ).

4. E Figure 2.12 shows graphs of two functions f : [−1, 1] → [−1, 1] and g : [−1, 1] →
[−1, 1]. For each case, define the function by giving an algebraic expression for its
value at each point in its domain. This expression will have several parts, similar to
the definition of the signum function in (2.3). Note that g(0) = 0 for the graph on
the right. Plot graph( f ◦ g) and graph(g ◦ f ).

5. T Let X = {a, b, c}, Y = {1, 2}. For each of the following subsets G ⊂ X × Y ,
determine whether G is the graph of a function from X to Y , and if it is, describe
the function as a table.

(a) G = {(a, 1), (b, 1), (c, 2)}


(b) G = {(a, 1), (a, 2), (b, 1), (c, 2)}
(c) G = {(a, 1), (b, 2)}

6. C A router in the Internet is a switch with several input ports and several output
ports. A packet containing data arrives at an input port at an arbitrary time, and
the switch forwards the packet to one of the outgoing ports. The ports of different
routers are connected by transmission links. When a packet arrives at an input port,

Lee & Varaiya, Signals and Systems 85


EXERCISES

the switch examines the packet, extracting from it a destination address d. The
switch then looks up the output port in its routing table, which contains entries of
the form (d, outputPort). It then forwards the packet to the specified output port.
The Internet works by setting up the routing tables in the routers.
Consider a simplified router with one input port and and two output ports, named
O1 , O2 . Let D be the set of destination addresses.

(a) Explain why the routing table can be described as a subset T ⊂ D × {O1 , O2 }.
(b) Is it reasonable to constrain T to be the graph of a function from D → {O1 , O2 }?
Why?
(c) Assume the signal at the input port is a sequence of packets. How would you
describe the space of input signals to the router and output signals from the
router?
(d) How would you describe the switch as a function from the space of input
signals to the space of output signals?

7. C For each of the following expressions, state whether it can be interpreted as an


assignment, an assertion, or a predicate. More than one choice may be valid because
the full context is not supplied.

(a) x = 5,
(b) A = {5},
(c) x > 5,
(d) 3 > 5,
(e) x > 5 ∧ x < 3.

8. T A logic circuit with m binary inputs and n binary outputs is shown in Figure 2.13.
It is described by a function F : X → Y where X = Binarym and Y = Binaryn . (In
a circuit, the signal values 1 and 0 in Binary correspond to voltage High and Low,
respectively.) How many such distinct logic functions F are there?

9. E The function H : [R+ → R] → [N0 → R] given by: ∀x ∈ [R+ → R],

∀n ∈ N0 , H(x)(n) = x(10n),

is a mathematical example of a system with input signal space [R+ → R] and output
signal space [N0 → R]. Give a mathematical example of a system H whose

86 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

x1 " Binary y1 " Binary

... ...
F : Binm ! Binn
xm " Binary yn " Binary

Figure 2.13: The logic circuit has m binary inputs (x1 , · · · , xm ) and n binary outputs
(y1 , · · · , yn ).

(a) input and output signal spaces both are [N0 → Binary].
(b) input signal space is [N0 → R] and output signal space is [N0 → {0, 1}].
(c) input signal space is [Z → R] and output signal space is [R → R].
10. E Consider the functions

g: Y → R and f : Nats → Y.

where Y is a set.
(a) Draw a block diagram for (g ◦ f ), with one block for each of g and f , and
label the inputs and output of the blocks with the domain and range of g and
f.
(b) Suppose Y is given by

Y = [{1, · · · , 100} → R]

(Thus, the function f takes a natural number and returns a sequence of length
100, while the function g takes a sequence of length 100 and returns a real
number.)
Suppose further that g is given by: for all y ∈ Y ,
100
g(y) = ∑ y(i) = y(1) + y(2) + · · · + y(100),
i=1

and f by: for all x ∈ Nats and z ∈ {1, · · · , 100},

( f (x))(z) = cos(2πz/x).

Lee & Varaiya, Signals and Systems 87


EXERCISES

(Thus, x gives the period of a cosine waveform, and f gives 100 samples of
that waveform.) Give a one-line Matlab expression that evaluates (g ◦ f )(x)
for any x ∈ Nats. Assume the value of x is already in a Matlab variable called
x.
(c) Find (g ◦ f )(1).
11. T The following system S takes a discrete-time signal x ∈ X and transforms it into
a discrete-time signal y ∈ Y whose value at index n is the average of the previous 4
values of x. Such a system is called a moving average. Suppose that X = Y = [N →
R], where N is the set of natural numbers. More precisely, the system is described
by the function S such that for any x ∈ X, y = S(x) is given by
[x(1) + · · · + x(n)]/4 for 1 ≤ n < 4

y(n) =
[x(n − 3) + x(n − 2) + x(n − 1) + x(n)]/4 for n ≥ 4
Notice that the first three samples are averages only if we assume that samples prior
to those that are available have value zero. Thus, there is an initial transient while
the system collects enough data to begin computing meaningful averages.
Write a Matlab program to calculate and plot the output signal y for time 1 ≤ n ≤ 20
for the following input signals:
(a) x is a unit step delayed by 10, i.e. x(n) = 0 for n ≤ 9 and x(n) = 1 for n ≥ 10.
(b) x is a unit step delayed by 15.
(c) x alternates between +1 and -1, i.e. x(n) = 1 for n odd, and x(n) = −1 for n
even. Hint: Try computing cos(πn) for n ∈ N.
(d) Comment on what this system does. Qualitatively, how is the output signal
different from the input signal?
12. T The following system is similar to problem 11, but time is continuous. Now
X = Y = [R → R] and the system F : X → Y is defined as follows. For all x ∈ X
and t ∈ R
1 t
Z
(F(x))(t) = x(s)ds.
10 t−10
Show that if x is the sinusoidal signal
∀t ∈R x(t) = sin(ωt),
then y is also sinusoidal
∀ t ∈ R, y(t) = A sin(ωt + φ).

88 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

You do not need to give precise expressions for A and φ, but just show that the
result has this form. Also, show that as ω gets large, the amplitude of the output
gets small. Higher frequencies, which represent more abrupt changes in the input,
are more attenuated by the system than lower frequencies.
Hint: The following fact from calculus may be useful:
Z b
1
sin(ωs)ds = (cos(ωa) − cos(ωb)).
a ω
Also, the identity in the footnote on page 76 might be useful to show that the output
is sinusoidal with the appropriate frequency.
13. E Suppose that f : R → R and g : R → Z such that for all x ∈ R,
if x > 0

 1
g(x) = 0 if x = 0
−1 if x < 0

and
f (x) = 1 + x.
(a) Define h = g ◦ f .
(b) Suppose that
F : [R → R] → [R → R]
G : [R → R] → [R → Z]
such that for all s ∈ [R → R] and x ∈ R,
(F(s))(x) = f (s(x))
(G(s))(x) = g(s(x))
where f and g are as given above. Sketch a block diagram for H = G ◦ F,
where you have one block for each of G and F. Label the inputs and outputs
of your blocks with the domain and range of the functions in the blocks.
(c) Let s ∈ [R → R] be such that for all x ∈ R,
s(x) = cos(πx).
Define u where
u = (G ◦ F)(s).
Give the domain, range, and assignment rule for u.

Lee & Varaiya, Signals and Systems 89


EXERCISES

14. T Let D = DiscSignals = [Z → R] and let

G: D×D → D

such that for all x, y ∈ D and for all n ∈ Z,

(G(x, y))(n) = x(n) − y(n − 1).

Now suppose we construct a new system H as follows:

H
x
y G

Define H (as much as you can).

15. T Consider a similar system H to that in the previous problem,

H
x
y G

but where now x ∈ R+ and y ∈ R+ . The inputs and outputs are no longer signals,
but rather just non-negative real numbers. So G : R+ × R+ → R+ . Block diagrams,
of course, work just as well for such simpler functions.
In this problem, we explore fixed points by considering a classic algorithm for
calculating the square root of a non-negative real number. Let the function G above
be given by
∀ x, y ∈ R+ , G(x, y) = 0.5(y + x/y). (2.20)

(a) Show that for a given x ∈ R+ , if the fixed point exists, then H : R+ → R+ is
given by √
∀ x ∈ R+ , H(x) = x.

90 Lee & Varaiya, Signals and Systems


2. DEFINING SIGNALS AND SYSTEMS

(b) To use the system above to calculate a square root, we simply start with a
guess for y, say 1, and calculate G(x, y) repeatedly until it converges to a
stable value for y. That stable value is the fixed point. Do this calculation for
x = 4 and for x = 12, repeating the evaluation of G until you obtain a close
approximation to the true square root. You may want to use Matlab for this.

Lee & Varaiya, Signals and Systems 91

You might also like