Download presentation
Presentation is loading. Please wait.
1
EECS 20 Chapter 21 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
2
EECS 20 Chapter 22 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.) x 1 x 2 x 3 x 4 y 1 y 2 y 3
3
EECS 20 Chapter 23 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.
4
EECS 20 Chapter 24 Defining Functions: Declarative Assignment Example: x Î Reals + f(x) = ! 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) = x 2 are declarative, since we naturally identify the () 2 operation with the way it is computed. y=0 x -y 2
5
EECS 20 Chapter 25 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) = x 2 Procedures are called imperative definitions since they provide a constructive method to match domain and range elements.
6
EECS 20 Chapter 26 Defining Functions: Tables Domain elements and range elements may be paired up explicitly using a table. Example: DomainRange 1G 2P 3L 4Q 5B A table is an imperative definition, since the function is explicitly constructed. Tables can represent functions that cannot be described using typical mathematical language.
7
EECS 20 Chapter 27 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 Reals 2. 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.
8
EECS 20 Chapter 28 Defining Functions: Composition A new function can be constructed by taking the composition of previously defined functions. The formal definition: Given previously defined functions f 1 : X ® Y f 2 : Y ® Z xx Î X(f 2 é f 1 )(x) = f 2 (f 1 (x)) f 2 é f 1 is a function. What are its domain and range? The operator é is a system. What are its domain and range? f 2 é f 1 : X ® Z é : [X ® Y] ‰ [Y ® Z] ® [X ® Z]
9
EECS 20 Chapter 29 Defining Functions: Composition Example: Consider the signals and systems from Lecture 2. We can express DigitizedSound using function composition: DigitizedSound = Computer(MicOutput) = Computer(Microphone(Voice)) = Computer é Microphone (Voice) Voice MicOutputDigitizedSound time ® pressuretime ® voltage{T, 2T, …, n(T)} ® Integers16 Microphone Computer [time ® pressure] ® [time ® voltage] [time ® voltage] ® [{T, 2T, …, n(T)} ® Integers16]
10
EECS 20 Chapter 210 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) = x 2 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 real- valued).
11
EECS 20 Chapter 211 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) = x 2 the pair (cos, cos 2 ) 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).
12
EECS 20 Chapter 212 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.
13
EECS 20 Chapter 213 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 : [Naturals 0 ® Reals] ® [Naturals 0 ® Reals] defined by " x Î [Naturals 0 ® Reals], y = MovingAvg(x) satisfies y(n) = (x(n) + x(n-1))/2 " n Î Naturals 0 This system could represent the two day average of a stock price, for example.
14
EECS 20 Chapter 214 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) = x 2 Here, a typical output y(t) = f(x(t)) = x(t) 2. The output y(t) depends only on x(t).
15
EECS 20 Chapter 215 Defining Functions: Block Diagrams Instead of keeping my lovely drawings of systems from Lecture 2, I can represent the systems using blocks: VoiceMicOutputDigitizedSound MicrophoneComputer The function composition is still apparent: DigitizedSound = Computer(MicOutput) = Computer(Microphone(Voice)) = Computer é Microphone (Voice)
16
EECS 20 Chapter 216 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: VoiceMicOutput DigitizedSound Microphone Computer Volume Adjustor 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))
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.