Mathematical Language

Download Report

Transcript Mathematical Language

Defining Signals and Systems
Last time we
• Introduced mathematical notation to help define sets
• Learned the names of commonly used sets (Reals, etc.)
• Created multi-dimensional sets using set product
• Used notation to define domain & range for common signals
• Saw multiple ways to define a particular set
Today we will
• List common ways to define functions (signals or systems)
• Touch on declarative vs. imperative definitions
• Talk about domain and range of systems
• Consider several common ways of defining systems
EECS 20 Chapter 2
1
Review: Functions
Recall that a function defines a relationship between two sets: the
domain and the range.
Each element in the domain is paired with one element in the range.
More than one element in the domain may be paired with the same
element in the range. (If not, the function is one-to-one).
Not all of the elements in the range get paired with elements in the
domain (If all range elements are paired, the function is onto.)
x1 x2 x3 x4
EECS 20 Chapter 2
y1
y2
y3
2
Defining Functions: Declarative Assignment
We can define the particular relationship between the domain
and range using a declarative assignment:
 x  X, f(x) = mathematical expression in x
Here, we define the range element f(x) associated with each
domain element x.
This type of definition specifies the function, but does not
necessarily tell us how to compute f(x) for each x in X.
Definitions with this property are called declarative.
EECS 20 Chapter 2
3
Defining Functions: Declarative Assignment
Example:
 x  Reals+
x
-y2
f(x) = !
y=0
e
dy
There is no way to tell what f(x) is for a particular x if we are
not given a method of computation (table, program, etc).
It is much harder to tell that definitions like
 x  Reals+
f(x) = x2
are declarative, since we naturally identify the ()2 operation
with the way it is computed.
EECS 20 Chapter 2
4
Defining Functions: Procedures
The relationship between domain elements and range elements
may be constructed using a procedure (given in familiar language)
Example: What function is defined by this MATLAB procedure?
for x = [1, 2, 3, 4, 5]
f = x*x
end
 x  {1, 2, 3, 4, 5}
f(x) = x2
Procedures are called imperative definitions since they provide a
constructive method to match domain and range elements.
EECS 20 Chapter 2
5
Defining Functions: Tables
Domain elements and range elements may be paired up explicitly
using a table.
Example:
Domain
Range
1
G
2
P
3
L
4
Q
5
B
EECS 20 Chapter 2
A table is an imperative definition,
since the function is explicitly
constructed.
Tables can represent functions that
cannot be described using typical
mathematical language.
6
Defining Functions: Graphs
Another way to specify pairing between domain and range
elements is with a graph. Formally, a graph is defined as:
graph(f) = {(x, f(x)) | x  X}
The graph of a function is itself a set.
We have all practiced drawing graphs from declarative algebraic
definitions where the domain X is Reals or Reals2.
It is difficult to depict functions with other domain sets using a
graph.
Data that cannot be described algebraically can often be
described with a graph.
EECS 20 Chapter 2
7
Defining Functions: Composition
A new function can be constructed by taking the composition
of previously defined functions.
The formal definition: Given previously defined functions
f1 : X  Y
f2 : Y  Z
x  X
(f2  f1)(x) = f2(f1(x))
f2  f1 is a function. What are its domain and range?
f2  f1 : X  Z
The operator  is a system. What are its domain and range?
EECS 20 Chapter 2
 : [X  Y]  [Y  Z]  [X 
Z]
8
Defining Functions: Composition
Example: Consider the signals and systems from Lecture 2.
Voice
MicOutput
time  pressure
time  voltage
Microphone
[time  pressure]
 [time  voltage]
DigitizedSound
Computer
{T, 2T, … , n(T)}
 Integers16
[time  voltage]
 [{T, 2T, … , n(T)}  Integers16]
We can express DigitizedSound using function composition:
DigitizedSound = Computer(MicOutput)
= Computer(Microphone(Voice))
EECS 20 Chapter 2
= Computer  Microphone (Voice)
9
Defining Systems: Declarative Assignment
We have just seen that composition can be used to define
systems. For example, we could define a new system that
records voice digitally:
DigitalRecorder = Computer 
Microphone
We can define a system using declarative assignment:
 x  [RealsReals]
f(x) = x2
This is not the same as
 t  Reals
f(t) = x(t)2
In the first case,
f : [RealsReals]  [RealsReals+].
In the second case, f : Reals  Reals+ (assuming x is realvalued).
EECS 20 Chapter 2
10
Defining Systems: Input-Output Pairs
Systems map an input function to an output function.
The pairing of a particular input with its associated output is
called a behavior.
Example: For the system
 x  [RealsReals]
f(x) = x2
the pair (cos, cos2) is a behavior.
In theory, a system could be defined by listing behaviors in a
table, or graphing them. This is generally difficult or impossible
given the complicated nature of the domain and range (both are
sets of functions).
EECS 20 Chapter 2
11
Defining Systems: Differential Equations
One may make declarative definitions which do not have the form
 x  X, f(x) = mathematical expression in x .
The output of a function for a particular input may not be obvious.
Example: A particle is moving in a straight line, with mass m and
position given by y(t). A force u(t) is applied to the particle.
The system Particle has the position of the particle, y(t) as output.
The inputs are the force u(t) and initial conditions y(0) and y’(0).
The system may be defined using a differential equation:
 (u, y(0), y’(0))  [RealsReals]  Reals  Reals,
y = Particle(u, y(0), y’(0)) satisfies y’’(t) = u(t) / m  t 
Reals.
EECS 20 Chapter 2
12
Defining Systems: Difference Equations
A difference equation is like a differential equation; it
involves functions whose domain is a set of discrete points in
time (discrete-time signal) rather than a function defined on
a continuous time interval (continuous-time signal).
Example: Consider the moving average system MovingAvg
MovingAvg : [Naturals0Reals]  [Naturals0Reals]
defined by
 x  [Naturals0Reals],
y = MovingAvg(x) satisfies y(n) = (x(n) + x(n-1))/2  n  Naturals0
This system could represent the two day average of a stock
price, for example.
EECS 20 Chapter 2
13
Systems With and Without Memory
MovingAvg is an example of a system with memory.
The output at a particular point n, y(n), depends on the
“present” value of the input, x(n), as well as a “past” value of
the input, x(n-1).
A system is said to be memoryless if the output y(n) or y(t)
depends only on the current value of the input, x(n) or x(t).
An example of a memoryless system is
 x  [RealsReals]
f(x) = x2
Here, a typical output y(t) = f(x(t)) = x(t)2 . The output y(t)
depends only on x(t).
EECS 20 Chapter 2
14
Defining Functions: Block Diagrams
Instead of keeping my lovely drawings of systems from Lecture 2,
I can represent the systems using blocks:
Voice
Microphone
MicOutput
Computer
DigitizedSound
The function composition is still apparent:
DigitizedSound = Computer(MicOutput)
= Computer(Microphone(Voice))
= Computer  Microphone (Voice)
EECS 20 Chapter 2
15
Defining Functions: Block Diagrams
Suppose I want the computer to automatically make the digital
recording louder if it senses that my voice is too soft.
A feedback signal called Volume could be added to tell the
computer to scale the digital samples to reach a specified average
volume:
Voice
Microphone
MicOutput
Volume
DigitizedSound Volume
Adjustor
Computer
DigitizedSound cannot be written directly as a function of Voice.
An implicit definition like the differential equation can be used to
define DigitizedSound in terms of the input Voice and the systems:
DigitizedSound = Computer(Microphone(Voice),VolumeAdjustor(DigitizedSound))
EECS 20 Chapter 2
16