Module 5 Lecture Slides 6up PDF
Module 5 Lecture Slides 6up PDF
3. Defined Power Spectrum for continuous and discrete forms Stimulus Response
Physiological
4. Reviewed “Symmetry” conditions and the autocorrelation function System
6. Spectral averaging
• A system model should be able to determine the
7. Defined Signal Bandwidth behavior of the system in response to a range of
stimuli: to calculate a system’s response to any input.
1
10/5/2016
http://www.eyebrainpedia.com/En/Oculomotricite/MvtVergIntro.html
2
10/5/2016
3
10/5/2016
System Elements
Systems Analysis and Systems Models
A typical systems element (or entire system) is shown graphically
as a box, or sometimes as a circle when an arithmetic process is
• Systems models usually represent processes
involved.
using so-called “black box” components.
• Each element of a systems model consists only of
a mathematically defined input-output
relationship and is represented by a geometrical
shape, usually a rectangle.
Two such elements are shown above.
• No effort is made to determine what is actually
inside the box, hence the term black box: only the The inputs and outputs of all elements are signals with a well-
element’s relationship between input and output is defined direction of flow or influence.
of importance.
These signals and their direction of influence are shown by
lines and arrows connecting the system elements.
4
10/5/2016
The Classic Feedback System Feedback Signaling is the basis for Homeostasis
The mathematical description of each element is either an algebraic
term or an arithmetic operation, in this case subtraction. G and H are Homeostasis (from Greek: ὅμοιος, hómoios, "similar", and στάσις, stásis,
assumed to be linear algebraic functions, so they produce an output "standing still") is the property of a system that regulates its internal
that is the product of a function times the input. environment and tends to maintain a stable, relatively constant condition of
properties such as temperature or pH. It can be either an open or closed
system.
The system shown is Feedfoward Pathway
a classic feedback It was defined by Claude Bernard and later by Walter B. Cannon in 1926,
system because the 1929 and 1932.
output is coupled to
the input via the Typically used to refer to a living organism, the concept came from that of
lower pathway milieu intérieur that was created by Claude Bernard and published in 1865.
Multiple dynamic equilibrium adjustment and regulation mechanisms make
homeostasis possible
Feedback Pathway
Claude Bernard was a French physiologist. He was the first to Some Examples of Physiological Feedback Systems
define the term milieu intérieur (now known as homeostasis, a term coined
by Walter Bradford Cannon). Historian I. Bernard Cohen of Harvard
University called Bernard "one of the greatest of all men of science". Among
many other accomplishments, he was one of the first to suggest the use of
blind experiments to ensure the objectivity of scientific observations
Hypertension control using a drug Sodium
Nitroprusside (SNP). IEEE
Claude Bernard
1813 – 1878
5
10/5/2016
Output = Goverall x Input. The solution found in this problem is known as the “feedback
equation:”
For the upper box: G Out S ;
1 Out G
and for the lower box: H S3 Out where S1 In S 3 In 1 GH
This equation will be used in later analyses of more complex
Rearranging: S1 Out G ; S 3 Out x H systems.
G and H can be anything as long as they can be treated
Since S1 In S 3 Substituting in the above: Out G In Out x H
algebraically.
When the individual elements contain differential or integral
Rearranging: Out In(G) Out x GH; Out( 1 GH) In x G operations in their input/output relationships, special techniques are
Out G used to change calculus operations into algebraic manipulations.
In 1 GH This equation and the general strategy to find this equation applies
even when the system contains more complicated elements.
10
Example 5.2 Results
% Example 5.2 Example to evaluate and unknown process is linear. 8
Output
% The output to a sine wave
6
t = 0:2*pi/500:2*pi; % Sine wave time function, 500 points input is sinusoidal, but the
x(t) and y(t)
100
Analysis: 80
The plot of sinusiodal output
The first instruction generates the time vector. amplitudes is a straight line
60
A ‘for-loop’ is used to generate sine waves with amplitudes indicating the process_x is a
40
The function process_x produces an output signal, y, and the peak Input Amplitude
value of the output is plotted. Deriving the exact input/output equation for an unknown process
using external signals is known as “system identification.”
6
10/5/2016
• Analog models represent the physiological process • System models emphasize component interaction,
using elements that are, to some degree, analogous to particularly with regard to information flow, and
those in the physiological process. clearly show the overall organization.
• Good analog models can represent the system at a • Influence between elements is explicitly shown by
lower level, and in greater detail, than systems models. lines with arrows.
• Analog models provide better representation of • This can greatly clarify the control structure of a
secondary features such as energy use, which is complex system.
usually similar between analog elements and the real- • The most significant advantage of the systems
world components these elements represent. approach is what it does not represent:
• In analog models, the interaction between components It allows the behaviors of biological processors to
may not be obvious from inspection of the model. be described quantitatively without requiring details
of the underlying physiological mechanism.
.
• Phasor analysis combines complex representation • All signals in such an LTI system can be described by the same
of sinusoids with the fact that calculus operations general equation:
(integration and differentiation) change only the x(t) = A cos(ωt + θ) = A cos(2πft + θ)
magnitude and phase of a sinusoid. where the values of A and θ can be modified by the system
elements, but the value of ω (or f) will be the same throughout
• This analysis assumes the signals are in sinusoidal
the system.
steady-state.
• A single complex number or variable should be able A cos(t ) Re Aej (t ) Re Aejejt
to describe the amplitude and phase of a sinusoid.
7
10/5/2016
8
10/5/2016
Example 5.3 Find the derivative of x(t) = 10 cos (2t + 20) Phasor Notation
using phasor analysis.
Solution: Convert x(t) to phasor representation (represented as • A shorthand notation is common for the phasor
x(jω)), multiply by jω, then take the inverse phasor transform: description of a sinusoid. Rather than write Vejθ, we
simply write V θ (stated as V and at an angle of θ).
10 cos(2t 20) 10ej 20 • Capital letters are usually used for the variable.
dx( j ) • Frequency is in radians/sec, ω, rather than in Hz.
j 10ej 20 j 210ej 20 j 20ej 20
dt • Hence, the time-phasor transformation for variable v(t)
j 20e 20ej 20ej 90 20 cos(2t 20 90) 20 cos(2t 110)
j 20
can be stated as:
v(t) V(ω) = V θ
Since cos(x) = sin(x + 90) = -sin(x - 90), this can also be written
as -20 sin(2t + 20), which is obtained from straight differentiation.
For example, the phasor representation of 20 cos (2t + 110)
would be written as 20 110.
9
10/5/2016
Example 5.5 Find the output of the system in the last example Example 5.5 Solution (cont)
for fluid balance if the input signal is FIN(t) = 0.5 sin(0.3t + 20)
ml/min. Solving for Out(ω) and then substituting in 0.5 -70 for
In(ω) and letting ω = 0.3:
Note that time has been scaled to hours even though the input is in
ml/min. Out ( )
20
In ( )
20
0.5 70 10 70
1 j 20 1 j 20(0.3) 1 j6
70 ml/min
1
FIN(t) = 0.5 cos(0.1t – 70) FIN(ω) = 0.5
Substituting and solving:
From the solution to Example 5.4, the transfer function is: 10 70
PA ( ) 1.64 150
Out ( ) 20 6.0880
In( ) 1 j 20 Converting to the time domain: PA(t) = 1.64 cos(0.3t -150) mmHg
80
td
360 f 2 3600.3 2 4.65 hrs
360
Solution: We first need to find the transfer function.
So the response is delayed 4.65 hrs from the stimulus due to the long In all of these problems, the best strategy is to find the equivalent
delays in transferring fluid into the blood. feedforward gain, G, and then apply the feedback equation to find the
As with many physiological systems, generating a sinusoidal stimulus, in overall transfer function.
this case a sinusoidal variation in fluid intake, is challenging. Note the internal feedback system with input In’ and output Out’.
So we need to apply the feedback equation twice.
10
10/5/2016
Example 5.7
The Spectrum of the Transfer Function (cont) Use MATLAB to plot the magnitude and phase of the transfer
function giving the relationship between applied external pressure
This figure shows the and airway flow for a person on a respirator in an intensive care
spectrum of a system. 1 Magnitude Transfer Function unit (ICU).
At the lower frequencies, Spectrum
|TF(f)|
This transfer function was derived by Khoo (2000) for typical lung
there is no change in signal 0.5
parameters, but could be modified for specific patients.
amplitude but some change
0
in phase as the signal 0 50 100 150 200 250
Frequency (Hz) Q ( ) 9.52 j (1 j 0.0024 ) l/min
passes through the system
This does not mean that 0
Phase Transfer Function Spectrum P ( ) 1 0.00025 2 j 0.155 mmHg
Phase TF(f)
-100
the output of the system
contains energy at those -200
where Q(ω) is airway flow in l/min and P(ω) is the pressure applied
lower frequencies; it -300
by the respirator in mmHg.
contains the same energy -400
0 50 100 150 200 250
as the input. Frequency (Hz) Transfer functions derived from biological systems usually have
inputs and outputs in different units, as is the case here.
At the higher frequencies, any energy in the input signal is reduced in Transfer functions from electronic systems usually have the same
the output signal and there is a large phase shift. units in the numerator and demoninator so they are dimensionless.
11
10/5/2016
12
10/5/2016
The Constant Gain Primitive: TF(ω) = G Derivative and Integral Primitive (also known as)
Isolated Zero or Pole Primitive: jω or 1/jω
Magnitude spectral properties are easily determined:
Magnitude spectral properties plot as a straight line when
|TF(ω)| = 20 log(G)
plotted against log ω:
|TF(ω)|dB = | 20 log TF(ω)| = 20 log G
|TF(jω)|dB = 20 log|jω| = 20 log ω (derivative)
The magnitude spectrum plots as a straight line.
|TF(1/jω)|dB = 20 log|1/jω| = - 20 log ω (integral)
Phase characteristics are zero (the angle of a real constant is
zero). Phase spectral properties just add a constant to the phase plot
TF 0
Hence a constant term adds a constant to the magnitude plot j 90;(Derivative) 1 j 90 (Integral)
and nothing to the phase plot.
The symbols for these
The symbol for this element is elements are usually
usually drawn as a circle or box drawn as boxes with
with input and output arrows. input and output
arrows.
30
Derivative (zero)
This function plots as a straight line when plotted against log ω .
20
To find the slope of this line, note that when ω = 10 the transfer jω
function in dB equals 20 log (10) = 20 dB, and when ω = 100 it 10
Magnitude (db)
13
10/5/2016
(1+j )
The greatest error 10 + 3 dB 1 1 j 1 1 0 deg.
TF (low) lim
Magnitude (db)
occurs when ω
exactly equals ω1.
At that frequency
0
TF (high) lim
1 1 j 1 j 1 90 deg.
the value of the
-10
- 3 dB
1/(1+j )
magnitude of the -20
• These are both straight lines at 0 and 90 deg.
first-order term is
3 dB.
-30
• In this case, the assumption is that ‘much much less than’
-40 -2
means an order of magnitude, so that the low-frequency
-1 0 1 2
10 10 10
Frequency (rad/sec)
10 10
asymptote is assumed to be valid from 0.1 ω1 on down.
2 3 dB
• By the same reasoning the high-frequency asymptote is
TF ( 1) 20 log 1 j 1 20 log 1 j 20 log assumed to be valid from 10 ω1 and up.
1
Again the
80
(1+j ) 100
TF ( )
greatest
60
1 j 0.1
difference 40
between 20
Phase (deg.)
the 0
Solution This transfer function is actually a combination of two
asymptotes elements: a gain term of 100 and a first-order term where ω1 is
and the equal to 1/0.1 = 10.
-20
actual -40
when ω 1/(1+j )
-80 magnitude spectrum so that 0 dB is equal to 20 log(100) = 40 dB.
equals ω1.
-100
10
-2
10
-1 0
10 10
1
10
2
The rescaling will account for the gain term. The gain term has no
Frequency (rad/sec)
influence on the phase plot so this may be plotted directly.
TF ( 1) 1 j 1 1 1 j 45 deg.
14
10/5/2016
n
• A major difference between the plots of the first- and
second–order primitives occurs when ω = ωn as shown
1 2 in the next slide.
20 log
n
40 log
n dB
Second-order term: 1/(1-(ω/ωn)2 + j2δω/ωn) Second-order term: 1/(1-(ω/ωn)2 + j2δω/ωn) Magnitude Plot
Magnitude (cont)
The magnitude function at ω = ωn is not a constant, but depends on δ:
specifically, it is -20 log (2δ).
1
TF ( n ) 20 log
1 j 2
n
2
1
20 log 20 log( 2 ) dB
j 2
If δ is less than 1.0 then the function is negative at ω = ωn, or
positive if the second-order term is in the denominator as is usually
the case.
For low values of δ, the magnitude curve is approximated as
The value of δ radically alters the shape of the magnitude curve, so it curving up (in this case) to meet the -20 log (2δ) point at ω=ωn
must be taken into account when plotting.
15
10/5/2016
TF (n)
1
1 n n j 2 n n
2
1
90 deg.
j 2
lim 1
TF (high ) n
1 j 2 n
n
2
So the phase at ω = ωn is 90 deg., half way between the two
asymptotes.
1 The phase plot is shown in the next slide.
180 deg.
2
16
10/5/2016
the manual
0.0 .1
method
-20 db/decade 1
0.0
provides more
1 j -45
system. 1 1 10 1
20 log (2 ) 0.0
= 0.01 = 0.01
0.0 Sharpness
= 1.0 depends
= 1.0 on
Bode Plots: Combining Multiple Elements The Bode Plot: Dissecting the Magnitude
To convert the general equation to magnitude in dB:
• Complex systems may contain a number of the
elements describe above. TF ( ) 20 log
1
n1
2
Gj 1 j 1 j 21 ....
n1
j 1 j 1
j 22
2
...
• The spectrum of multiple elements connected in 2 n2 n2
series can be obtained from the transfer functions in This general equation assumes that terms higher than second-
dB of the individual elements. order can be factored into first- or second-order terms.
• Complex single transfer functions can also be plotted Note that multiplication and division in Eq. 5.53 becomes
if it is broken down into the four primitives described. addition and subtraction after taking the log, so Eq. 5.54 can be
expanded to:
• A general transfer function is written as:
TF ( ) dB 20 log(G ) 20 log j 20 log 1 j 1 20 log 1 n1 j 21 n1 ...
2
TF ( )
1
Gj 1 j 1 j 21 ....
n1
2
n1
20 log j 20 log 1 j 2 20 log 1 n2 j 2 2 n2 ....
2
j 1 j
1 j 22
2
...
2 n2 n2 where the upper line is the expanded version of the numerator
and the lower line is the expanded version of the denominator.
The Bode Plot: Magnitude (cont) The Bode Plot: Magnitude (cont)
• Usually only the asymptotes and a few other
• Aside from the constant term, the upper and lower important points (such as the value of a second-
second lines of the expanded general magnitude order term at ω = ωn) are plotted.
equation have the same form except for the sign:
• Then the overall curve is completed freehand by
numerator terms are positive connecting the asymptotes and critical points.
denominator terms are negative.
• This approach is termed the “Bode plot” technique,
• Each term in the summation is a Bode primitive as and the individual format types are called Bode plot
emphasized by the horizontal brackets. “primitives.”
• This suggests that the magnitude spectrum of any • Although the resulting Bode plot is only
transfer function can be obtained by plotting each approximate and often somewhat crude, it is
individual element, then adding the curves usually sufficient to represent the general spectral
graphically. characteristics of the transfer function.
17
10/5/2016
Bode Plot: Dissecting the Phase Example 5.11 Find the magnitude and phase curves (Bode plots)
for the Transfer Function:
The phase frequency characteristics are obtained by taking the
angle of the Transfer Function 100 j
TF ( )
Gj 1 j 1 j 21
2
1 j1 1 j.1
1 n1 n1
TF ( )
2
j 1 j 1 j 2 2
n2
2
n2
Solution: The transfer function contains four elements: a constant,
This leads to a function composed of additions and subtractions an isolated zero (i.e., a jω in the numerator), and two first-order
of the angles of the Bode plot primitives: terms in the denominator.
For the magnitude curve, plot the asymptotes for all but the
TF ( ) = G j 1
j 2
1 1 n1 j
21
n1 constant term. Add these asymptotes together graphically to get an
overall asymptote. At the end, use the constant term to scale the
value of the vertical axis.
- j 1 j 1 j 2 2 2
2
2 n2 n For the phase plot, construct the asymptotes for the two first-order
denominator elements, then rescale the axis by +90 deg to account
The phase transfer function also consists of individual for the jω in the numerator.
components that add or subtract as emphasized by the brackets.
40
30
j
20
10
Magnitude (db)
1/(1+j.1 )
-10
-20
1/(1+j1 )
-30
-40
-1 0 1 2 3
10 10 10 10 10
Frequency (rad/sec)
Example 5.12 Find the magnitude and phase curves using Bode Example 5.12 (cont)
plots and MATLAB for the transfer function:
To plot the magnitude asymptotes, it is first necessary to determine
101 j 2 ω1, ωn, and δ from the associated coefficients:
TF ( )
j 1 0.04 2 j.04
101 j 2
TF ( )
j 1 0.04 2 j.04
Solution Bode Plot: The transfer function contains four
elements: a constant, a numerator first-order term, an isolated
pole in the denominator, and a second-order term in the
denominator. For 1: 1 1 0.5 rad / sec
1 2;
For the magnitude curve, plot the asymptotes to all terms but 1
For n: n2 .04; n 1 = 5 rad / sec
the constant, then add these up graphically. Use the constant 0.4
term to scale the value of the vertical axis. 2 .04n = .04(5) 01
For : n .04; 2 2 .
For the phase curve, plot the asymptotes of the first-order and
second-order terms, then rescale the vertical axis by 90 deg. to 20 log(2 ) = 14 db
account for the jω term in the denominator.
18
10/5/2016
Example 5.12 MATLAB Solution The Transfer Function and the Fourier Transform
The transfer function can be used to find the output to any
Only the range of the frequency vector and the MATLAB statement single sinusoidal input.
defining the transfer function have been changed
• Fourier series decomposition can be used to break down any
% periodic or aperiodic signal into a series of sinusoids.
w = .005:.1:500; % Define frequency vector • Combining the two, we can determine the output of a network
%Define transfer function to very complex signals using a multi-step process:
TF = 10*(1+j*2*w)./(j*w.*(1 ‐ .04*w.^2 + j*.04*w));
……the rest of the code is the same as Example 5.7……. 1) Decompose the signals into sinusoids;
2) Multiply the sinusoids of the Transfer Function to get the
Clearly the code in this example could be easily modified to plot any output sinusoids
transfer function of any complexity.
3) Sum the output sinusoids using the inverse Fourier
The results of the code were superimposed on the pervious Bode Transform.
plots.
vin(t) Vin(ω) Vout(ω) v(t)out
FFT TF(ω) IFFT Plot
Example 5.13 Find the output of a system having the transfer Example 5.13 Solution
function below when the EEG signal shown previously is theinput.
Plot both input and output signals in both the time and frequency load eeg_data; % Load EEG data (in variable eeg)
domain. N = length(eeg);
fs = 50; % Sample frequency is 50 Hz
Vout ( ) 1
TF ( ) t = (1:N)/fs; % Construct time vector for plotting
Vin ( ) 1 .05 2 j.1 f = (0:N‐1)*fs/N;
…….plot and label EEG time data…….
Solution: Follow the sequence outlined in the last slide Vin = (fft(eeg)); % Decompose data: step 1
1. The EEG data by first decomposing it into individual sinusoids % Get output using Fourier components: step 2
using the MATLAB fft command giving us Vin(ω). Vout = Vin./(1 ‐ .002*(2*pi*f).^2 + j*.003*2*pi*f); %
vout = ifft(Vout); % Convert output to time domain: step 3
2. The output from all these sinusoids is then determined from the ……..plot and label system output in the time domain…….
transfer function: Vout(ω)= TF(ω) Vin(ω). …….plot signal spectrum of input (Vin)…….
3. This frequency domain output is converted back into the time …….plot signal spectrum of output (Vout)……..
domain using the inverse Fourier Transform command, ifft.
The program then plots the time domain reconstruction, vout(t).
19
10/5/2016
|In (f)|
EEG
signals at the 0 system is shown
input and output to eliminate 1
-1
of the system. frequencies
-2 0
The system 0 2 4 6 8 10 12 14 16 above 5 Hz and 0 5 10 15 20 25
|Out (f)|
EEG
range. 0 5
-0.5
-1 0
0 2 4 6 8 10 12 14 16 0 5 10 15 20 25
Time (sec) Frequency (Hz)
• If the input signals can be restricted to steady-state • Here, the transfer function uses phasors and can only
sinusoids, phasor techniques represent these deal with sinusoidal signals, but the transfer function
elements by algebraic equations that are functions concept is extended to a wider class of signals in the
only of frequency. next chapter.
• Phasors represent steady-state sinusoids as a single • The transfer function provides a direct link to a system’s
complex number. spectrum either using MATLAB, or a manual graphical
technique based on Bode plot methods.
• Using phasors, the calculus operation of
differentiation can be implemented in algebra simply • With the aid of these Bode plot methods, the transfer
as multiplication by jω, where j = 1 and ω is function can be derived from the spectrum.
frequency in radians.
• Integration becomes division by jω.
Summary (cont)
• The transfer function can provide the output of the
system to any input signal as long as that signal can
be decomposed into sinusoids.
1. First transform the signal into its frequency
domain representation using Fourier series
decomposition.
2. Multiply the frequency signal spectrum by the
transfer function to obtain the frequency domain
representation of the output signal.
3. Reconstruct the time domain signal through
application of the inverse Fourier Transform to
the output signal spectrum.
20