Documente Academic
Documente Profesional
Documente Cultură
Imagine that you are asked to design a system to steer a car straight down the middle of a lane.
Easy, right? Figure out some way to sense the position of the car within its lane. Then, if the car
is right of center, turn the steering wheel to the left. As the car moves so that it is less to the right,
turn the steering wheel less to the left. If it is left of center, turn the steering wheel to the right.
This sort of proportional controller works well for many applications – but not for steering, as can
be seen below.
straight ahead?
steer right
steer right
steer right
straight ahead?
steer left
steer left
Figure 5.1 Simple (but poor) algorithm for steering: steer to the left in proportion to how far the
car is to the right, and vice versa.
Exercise 5.1. Can you explain why the car is oscillating left-to-right and back?
It is relatively easy to describe better algorithms in terms that humans would understand: e.g.,
Stop turning back-and-forth! It is not so easy to specify exactly what one might mean by that, in
a way that it could be automated.
In this chapter, we will develop a Signals and Systems framework to facilitate reasoning about the
dynamic behaviors of systems. This framework will enable construction of simple mathematical
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 144
models that are useful in both analysis and design of a wide range of systems, including the
car-steering system.
signal signal
system
in out
Figure 5.2 Signals and Systems: the system consumes an input signal and generates an output
signal.
This diagram represents a system with one input and one output. Both the input and output
are signals. A signal is a mathematical function with an independent variable (most often it will
be time for the problems that we will study) and a dependent variable (that depends on the
independent variable). The system is described by the way that it transforms the input signal
into the output signal. In the simplest case, we might imagine that the input signal is the time
sequence of steering-wheel angles (assuming constant accelerator-pedal position) and that the
output signal is the time sequence of distances between the center of the car and the midline of
the lane, and that the output sequence
Representing a system with a single input signal and a single output signal seems too simplistic
for any real application. For example, the car in the steering example (figure 5.1) surely has more
than one possible output signal.
Pause to try 5.1. List at least four possible output signals for the car-steering problem.
Possible output signals include (1) its three-dimensional position (which could be represented by
a 3D vector p̂(t) or by three scalar functions of time), (2) its angular position (again a 3D vector
or three scalar functions of time), (3) the rotational speeds of the wheels (and whether or not they
are sliding), (4) the temperature of the tires (and whether they are about to rupture), and many
other possibilities.
The important point is that the first step in using the signals and systems representation is ab
straction: we must choose the output(s) that are most relevant to the problem at hand and abstract
away the rest.
To understand the steering of a car, one vital output signal is the lateral position po (t) within the
lane, where po (t) represents the distance (in meters) from the center of the lane. That signal alone
tells us a great deal about how well we are steering. Consider a plot of po (t) that corresponds to
figure 5.1, as follows.
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 145
po (t)
The oscillations in po (t) as a function of time correspond to the oscillations of the car within its
lane. Thus, this signal clearly represents an important failure mode of our car steering system.
Is po (t) the only important output signal from the car-steering system? The answer to this ques
tion depends on your goals. Analyzing a system with this single output is likely to give important
insights into some systems (e.g., low-speed robotic steering) but not others (e.g., NASCAR). More
complicated applications may require more complicated models. But all useful models focus on
the most relevant signals and ignore those of lesser significance. 26
Throughout this chapter, we will focus on systems with one input signal and one output signal (as
illustrated figure 5.2). When multiple output signals are important for understanding a problem,
we will find that it is straightforward to generalize the methods and results developed here for
single-input and single-output systems to systems with multiple inputs and outputs.
The steering controller turns the steering wheel to compensate for differences between our desired
position in the lane, pi (t) (which is zero since we would like to be in the center of the lane) and
our actual position in the lane po (t). Let e(t) = pi (t) − po (t). Thus we can think about the
steering controller as having an input e(t) and output φ(t).
In the composite system, the steering controller determines φ(t) which is the input to the car. The
car generates po (t), which is subtracted from pi (t) to get e(t) (which is the input to the steering
controller). The triangular component is called an inverter: its output is equal to −1 times its
input. More generally, we will use a triangle symbol to indicate that we are multiplying all the
values of the signal by a numerical constant, which is shown inside the triangle.
26
There are always unimportant outputs. Think about the number of moving parts in a car. They are not all important
for steering!
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 146
−1
The dashed-red box in the previous figure illustrates modularity of the signals and systems ab
straction. Three single-input, single-output sub-systems (steering controller, car, and inverter)
and an adder (two inputs and 1 output) are combined to generate a new single-input (pi (t)),
single-output (po (t)) system. A principal goal of this chapter is to develop methods of analysis
for the sub-systems that can be combined to analyze the overall system.
x[n] = x(nT )
which we call the sampling relation. Sampling converts a signal of continuous domain to one of
discrete domain.
While our primary focus will be on time signals, sampling works equally well in other domains.
For example, images are increasingly processed as arrays of pixels accessed by integer-valued
rows and columns, rather than as continuous brightness fields, indexed by real-valued spatial
coordinates.
If the car-steering problem in figure 5.1 were solved in discrete time, we could describe the system
with a diagram that is very similar to the previous continuous-time diagram. However, only
discrete time instants are considered
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 147
−1
and the output position is now only defined at discrete times, as shown below.
po [n]
1 if n = 0
δ[n] =
0 otherwise
That is, it has value 1 at index n = 0 and 0 otherwise, as shown below:
δ
1
0 n
Our first operation will be scaling, or multiplication by a scalar. A scalar is any real number. The
result of multiplying any signal x by a scalar c is a signal, such that:
(c · X)[n] = c · X[n]
That is, the resulting signal has a value at every index n that is c times the value of the original
signal at that location. Here are the signals 4δ and −3.3δ.
4δ −3.3 δ
4
0 n
0 n
−3.3
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 148
The next operation is the delay operation. The result of delaying a signal X is a new signal RX
such that:
RX[n] = X[n − 1]
That is, the resulting signal has the same values as the original signal, but delayed by one step.
You can also think of this, graphically, as shifting the signal one step to the R ight. Here is the
unit sample delayed by 1 and by 3 steps. We can describe the second signal as RRRδ, or, using
shorthand, as R3 δ.
Rδ R3 δ
1 1
0 n 0 n
That is, the value of the composite signal at step n is the sum of the values of the component sig
nals. Here are some new signals constructed by summing, scaling, and delaying the unit sample.
3δ + 4Rδ − 2R2 δ
4
δ + R2 δ + R4 δ
1 0 n
0 n
Note that, because each of our operations returns a signal, we can use their results again as ele
ments in new combinations, showing that our system has true compositionality. In addition, we
can abstract, by naming signals. So, for example, we might define Y = 3δ + 4Rδ − 2R2 δ, and then
make a new signal Z = Y + 0.3RY , which would look like this:
Z = Y + 0.3RY
5
0 n
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 149
Be sure you understand how the heights of the spikes are determined by the definition of Z.
It is important to remember that, because signals are infinite objects, these combination opera
tions are abstract mathematical operations. You could never somehow ’make’ a new signal by
calculating its value at every index. It is possible, however, to calculate the value at any particular
index, as it is required.
Advancing
If we allow ourselves one more operation, that of ’advancing’ the signal one step (just
like delaying, but in the other direction, written L for left-shift), then any signal can be
composed from the unit sample, using a (possibly infinite) number of these operations.
We can demonstrate this claim by construction: to define a signal V with value vn at index n, for
any set of integer n, we simply set
X
∞ X
∞
n
v0 δ + vn R δ + v−n Ln δ ,
n=1 n=1
which can be verified by checking that this relation holds for all n:
(c(X1 +X2 ))[n] = c(X1 [n]+X2 [n]) = cX1 [n]+cX2 [n] = (cX1 )[n]+(cX2 )[n] = (cX1 +cX2 )[n]
X1 X1 c
X2 X2 c
Exercise 5.4. Verify that R distributes over addition and multiplication by checking that
the appropriate relations hold at some arbitrary step n.
These algebraic relationships mean that we can take any expression involving δ, R, + and · and
convert it into the form
(ao + a1 R1 + a2 R2 + . . . + aN RN )δ
That is, we can express the entire signal as a polynomial in R, applied to the unit sample. In fact,
we have already seen plots of signals expressed in this form.
Sinusoidal signals
We just saw how to construct complicated signals by summing unit sample signals that
are appropriately scaled and shifted. We could similarly start with a family of discretely-
sampled sinusoids as our primitives, where
X[n] = cos(Ωn)
cos(0.2n) cos(1.0n)
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 151
The second plot may seem confusing, but it’s just a sparsely sampled sinusoid. Note that signals
constructed from even a single sinusoid have non-zero values defined at an infinity of steps; this
is in contrast to signals constructed from a finite sum of scaled and shifted unit samples.
S2 = R10 S1
S3 = S1 + S2
The blue line is the S1 , the green line is the same signal, delayed by 10, which is S2 , and the red
line is their sum.
1.099
-1.09
0 100
We’ll refer to −1/σ as the time constant, Ω as the (discrete) frequency, and φ as the phase. Note
that ordinary exponentials fall into this family (with Ω and φ set to 0) and plain sinusoids fall
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 152
into it (with σ set to 0). Here are two examples of the general class; we will say that the first one
is diverging and the second one, converging.
At each sample point, we compute the squared difference between the actual value yi and the
desired value f(i); then we take the average of these squared errors, and finally take the square
root. The units of this error are the units of the original signal.
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 153
5.5.3 Ten-Ninety
A very rough way to measure how quickly a signal converges to a value is to compute its “ten”
and “ninety” points. This only makes sense for a signal that is converging. If f(y) measures the
distance of a sample value y from a target value, then the “ten” point is the index of the first
sample, yi , for which f(yi ) < (1 − 0.1)f(y0 ). The “ninety” point is the index of the first sample,
yi , for which f(yi ) < (1 − 0.9)f(y0 ). These points are, intuitively, the steps at which the error is
reduced by ten percent, and then by ninety percent.
Here is an example signal, Y[n] = e−0.02n . It reaches 10 percent of the way to 0 at step 6 and 90
percent of the way at step 116:
1. Find the downward crossings of the signal. Those are places where the signal goes from being
above z to below it; that is, indices k where s[k] > z and s[k + 1] 6 z. These crossings mark
whole cycles of the signal.
2. Find the sizes of the gaps between the crossings; these are the lengths of each of the cycles.
3. Return the mean of the gap sizes.
If there are no cycles, then either the signal is aperiodic or the zero was not chosen appropriately.
5.5.5 Exponential fit
If the signal is aperiodic, then we might conjecture that it has an exponential form. Often, it will
be some ’zero’ constant z, plus an exponential; so we’d like to try to characterize our data as well
as possible with the form
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 154
y[n] = z + bcn = z + ec ln bn
This process is a little bit complicated, but it comes down to considering the values
fitting a line y = mx + d to them, to get parameters m and d, and then letting b = em and c = ed
The figures below show exponential fits to the peaks (maximum values) between crossings
5.5.6 Filtering
Filtering is a process used to remove noise or to smooth a signal. Given a function f of some
number k values, we can imagine filtering a signal with f by applying it to successive windows
of k values and using the result as the value of the new signal. More formally, Let Y be the new
signal and X be the old one. Then
There are many different choices of filters (functions f); two common ones are mean and median.
A box or mean filter is defined as:
1 X
k
fmean (vk−1 , . . . , v0 ) = vk ;
k−1
i=0
that is, it is just the mean of the values. Another useful filter is the median filter. It uses the median
function for f.
Here is a signal read in from a file.
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 155
Median 3 Mean 3
Here it is with median and mean filters of size 5 and 50. Think about why the mean-filtered
version is smoother than the median-filtered one, and why the tops of the median-50-filtered
signal are flat.
Chapter 5 Signals and Systems 6.01— Fall 2009— November 16, 2009 156
Median 5 Mean 5
Median 50 Mean 50
Exercise 5.7. What polynomial in R corresponds to filtering with a mean filter of size 5?
Exercise 5.8. Is there a polynomial in R that corresponds to filtering with a median filter
of size 3? Why or why not?
MIT OpenCourseWare
http://ocw.mit.edu
Fall 2009
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.