TLTE.3120 Computer Simulation in Communication and Systems (5 ECTS) Lecture 8 28.10.2015 Timo Mantere http://www.uwasa.fi/~timan/TLTE3120/ UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features We cannot go through all the possibilities of Matlab and Simulink in this course, so most important is to know where to get help when you start doing real things with Matlab Basically most of the things you need to know is available in Mathworks homepage http://se.mathworks.com/ Use find there with proper keywords and you probably find what you are looking for, lot of examples and example codes UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Matlab tutorial videos available Data analysis and visualization http://se.mathworks.com/products/matlab/description3.html Programming and algorithm development http://se.mathworks.com/products/matlab/description4.html Application development http://se.mathworks.com/products/matlab/description5.html UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Simulink tutorial videos available Simulink key features Building the model Simulating the model Analyzing simulation results Managing projects Connecting to hardware http://se.mathworks.com/products/simulink/features.html#key_features Videos http://se.mathworks.com/products/simulink/videos.html Examples http://se.mathworks.com/examples/product-group/matlab-signalprocessing-and-communications UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Features important to our students Digital signal processing toolbox http://se.mathworks.com/products/dsp-system/ Control system toolbox http://se.mathworks.com/products/control/ Communications system toolbox http://se.mathworks.com/products/communications/ Also: Design and simulate radio systems http://se.mathworks.com/products/simrf/ Radio frequency toolbox http://se.mathworks.com/products/rftoolbox/ LTE toolbox http://se.mathworks.com/products/lte-system/ UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Features important to our students Digital filter design http://se.mathworks.com/discovery/filter-design.html Filterbuilder http://se.mathworks.com/help/dsp/gs/design-a-filter-using-filterbuilder.html Type filterbuilder Select filter type Select features View filter response UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Filter design with Matlab, example, copy paste parts s1=[20, 30, -10, 40, 40, 30, 20] %first signal s2=[20, 30, 40, 0, -1, 0, 40, 30, 20] %second signal b1=fir1(3,0.5) %create FIR filter with fir1 [b2, a]=butter(3,0.5) %create IIR filter freqz(b2,a,100,1000) %frequency response of IIR filter %hold %freqz(b1,1,100,1000) %frequency response of FIR filter %filter 1. signal with FIR and IIR filters F1=filter(b1,1,s1) %FIR filter a=1 I1=filter(b2,a,s1) %filter 2. signal with FIR and IIR filters F2=filter(b1,1,s2) I2=filter(b2,a,s2) UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Filter design with Matlab, example 2 N=50; %fir degree %create rectangular window window=ones(N+1,1); %frequncies and responses for drawing f=[0 1]; m=[0 1]; %fir filter creation with fir1 or fir2 function b=fir2(N, f, m, window) %b=fir2(N, f, m, window); %calclate fir attenuation [h,w]=freqz(b,1,1000); %draw frequncy response, wanted and obtained plot(f,m,w/pi,abs(h)) legend('Ideal','fir2 Designed'); title('Comparison of Frequency Response Magnitudes'); %freqz(b,1,512) %attenuation UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Filter design with Matlab, example 3 % Define bandbass wn=[0.2 0.6]; N=50; %FIR degree window=ones(N+1,1); b=fir1(N, wn, window) %Fir %attenuation [h,w]=freqz(b,1,512) %frequncies for calulating responses f=[0 0.2 0.2 0.6 0.6 1]; m=[0 0 1 1 0 0]; %draw wanted and obtained response plot(f,m,w/pi,abs(h)) legend('Ideal','fir1 Designed'); title('Comparison of Frequency Response Magnitudes'); %freqz(b,1,512) UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Also available other filter models e.g. Butterfield % Generate low pass filter eg. len=10, Fn=0.5 [b,a]=butter(len,Fn); Chebyshev Cheby1 [b,a] = cheby1(N,R,Wp) Chepy2 [b,a] = cheby2(N,R,Wst) Elliptic [b,a] = ellip(N,Rp,Rs,Wp) UNIVERSITY of VAASA Telecommunication Engineering Group Matlab features Matlab C code generation C conversion can be done with codegen command Help codegen Examples: http://se.mathworks.com/examples/matlab-coder/1866-c-code-generationfor-a-matlab-kalman-filtering-algorithm#1 http://se.mathworks.com/examples/search?utf8=%E2%9C%93&q=C+Code +Generation+for+a+MATLAB UNIVERSITY of VAASA Telecommunication Engineering Group Simulation of communication systems Communication systems have become more and more complex over the years Systems requires more analyses during the design phase Analyses must be done fast and cost-effectively These things have lead to the computer based simulations UNIVERSITY of VAASA Telecommunication Engineering Group Simulation of communication systems Communication systems can be analyzed and evaluated e.g. by Based on formulas and their calculations (usually simplified models) Waveform-level simulations Hardware prototyping and measurements (quite costly) Combinations of previous Usually simulation based evaluation is most flexible, one can combine mathematics with models or measured data Communication system could be whatever, satellite-based, terrestrial wireless, optic cables, Ethernet, etc. UNIVERSITY of VAASA Telecommunication Engineering Group Simulation of communication systems Different simulation techniques are used to evaluate performance, e.g. At network level flow of packets and messages over the network is simulated, calculating throughput, packet loss, response time, resource utilization etc Communication links are measured in terms of error characteristics, bit error rate etc. Link could contain different parts that are simulated separately; modulators, encoders, filters, amplifiers, decoders, demodulators, etc. Also the hardware parts can be simulated by using hardware description language like VHDL UNIVERSITY of VAASA Telecommunication Engineering Group Simulation of communication systems Quite often the simulation results are presented as Scope Y-T plot X-Y plot Frequency curve Frequency response curve (filter, channel) Eye diagram Error rate plot (SNR) I-Q plot (real-imaginary axis) UNIVERSITY of VAASA Telecommunication Engineering Group A Refreshment of System Analysis UNIVERSITY of VAASA Telecommunication Engineering Group Introduction: What is a Signal? Signals describe quantities that change. This change can be with time, frequency, location, ..etc. Figure (1) in the next slide shows signal x(t) changes with time, this signal represent voice signal for word “Finland”. Figure (2) shows signal y(f) which represents certain signal in frequency domain Figure (3) shows signal z(n) which represents the grades of one of one of telecommunication courses in the University of Vaasa UNIVERSITY of VAASA Telecommunication Engineering Group Introduction: What is a Signal? 0.4 0.9 0.3 0.8 0.2 0.7 0.1 0.6 0 y(f) 0.4 -0.2 0.3 -0.3 0.2 -0.4 Figure (1) -0.5 -0.6 0 0.2 0.4 0.6 0.8 1 time [2] 1.2 1.4 1.6 1.8 Figure (2) 0.1 2 0 -2 -1.5 -1 -0.5 0 0.5 frequency [Hz] 1 1.5 2 4 x 10 4 3 Number of students x(t) 0.5 -0.1 Figure (3) 2 1 UNIVERSITY of VAASA0 0 Telecommunication Engineering Group1 2 3 Grade 4 5 Introduction: What is a Signal? A signal is a function or sequence of values that represent information. The signals can be classified according to various criteria as shown in the table: Continuous (in time) discrete (in time) Amplitude-continuous Amplitude-discrete analogue digital Real-valued Complex-valued Uni-dimensional Multi-dimensional Deterministic stochastic UNIVERSITY of VAASA Telecommunication Engineering Group Introduction: What is a Signal? E.g. signal processing s = importdata('test.wav') soundsc(s.data,s.fs) plot(s.data) plot(s.data(:,1)) 0.6 0.6 0.4 0.4 0.2 0.2 0 0 -0.2 -0.2 -0.4 -0.4 -0.6 -0.8 % load sound sample % play sample % plot sound sample % plot first channel -0.6 0 2 4 6 8 10 12 4 x 10 UNIVERSITY of VAASA Telecommunication Engineering Group -0.8 0 2 4 6 8 10 12 4 x 10 Introduction: What is a Signal? E.g. spectral density DF=fft(s.data(:,1)); % Fourier transform of 1. channel N=length(s.data); % Length FF= DF.*conj(DF)/N; % spectral density f = s.fs/N*(0:(N-1)/2); % s.fs sample rate plot(f,FF(1:length(f))); 3.5 3 See signal processing examples 2.5 http://se.mathworks.com/products/signal/index.html 2 1.5 1 0.5 UNIVERSITY of VAASA Telecommunication Engineering Group 0 0 0.5 1 1.5 2 2.5 4 x 10 Introduction: What is a System? A system is the abstraction of a process or object that puts a number of signals into some relationship. Usually, we can classify system’s signals as input and output signals. Input signals exist independently of the system and are not affected by the system; instead the system reacts to these signals. Output signals carry information generated by the system, often as a response to input signals. x System y Single Input, Single Output (SISO) UNIVERSITY of VAASA Telecommunication Engineering Group x1 x2 xM System y1 y2 yN Multiple Input - Multiple Output (MIMO) Derivative Notation Following notations of derivative are equivalent: dx(t ) x '(t ) x(t ) dt dx 2 (t ) x ''(t ) x(t ) 2 dt dx 3 (t ) x '''(t ) x (t ) 3 dt Usually the last form (x with dots) is favored in system analysis UNIVERSITY of VAASA Telecommunication Engineering Group Example: Static and Dynamic Models A system is called dynamic, if its state is a function of its previous states. For example: The effect of external force F to object location x can be derived from the force balance equation (m is a mass, k is a spring constant and B is a damping coefficient) F(t) x(t) m B k mx(t ) Bx (t ) kx (t ) F (t ) A system is called static, if its current state does not depend on previous state For example: the effect of temperature T to pressure p in closed and isolated tank can be derived from the ideal gases law (n is the molar amount, V volume and R gas constant) p(t )V nRT (t ) UNIVERSITY of VAASA Telecommunication Engineering Group p(t) T(t) n V Example: Static and Dynamic Models In the simulations plotted on the right side, the external force in the mechanic system and the temperature in the gas tank model are changed step-vise In a dynamic system, the response will change long after the input has already stabilized. One can not define the respose just by knowing the input at the same time moment. In a static system the input and the response are changing only on same time monents, and the system response can be defined just by knowing the input at the same time moment Mass location External force Pressure Temperature UNIVERSITY of VAASA Telecommunication Engineering Group Linear and Nonlinear Systems A system is linear, if it satisfies the following two conditions: 1) If input u1 generates response y1, then input Ku1 generates response Ky1 (K is a constant). 2) If input u1 generates response y1 and input u2 generates response y2, then input (u1+u2) generates response (y1+y2). UNIVERSITY of VAASA Telecommunication Engineering Group Linear and Nonlinear Systems In general, a differential equation is linear, if each term in it has a form constant(variable or variable’s derivative) For example: y (t ) 3 y (t ) 5 y (t ) 2u1 (t ) u1 (t ) 3u2 (t ) 2u2 (t ) The real systems are usually nonlinear, but one can often approximate them by using linearization UNIVERSITY of VAASA Telecommunication Engineering Group Continuous Time and Discrete Time Models Dynamic, continuous time models are described by using differential equations and differential equation groups For example, the damped oscillator differential equation mx(t ) Bx (t ) kx (t ) F (t ) Dynamic, discrete time models are described by using difference equations and difference equation groups For example, a rate formula: y (t k 1) 107 . y (t k ) u(t k 1) UNIVERSITY of VAASA Telecommunication Engineering Group Time Variant and Time Invariant Systems In time variant systems the model parameters are changing as a function of time Further analysis of time variant systems is out of the scope of this course m(t ) x (t ) Bx (t ) kx (t ) F (t ) In time invariant systems the model parameters are assumed to be constants over time Most of the real-world systems are time variant (worning, dirt and dust, changing environmental conditions etc.), but in many cases the effect of time invariance is so small that it can be ignored in the model UNIVERSITY of VAASA Telecommunication Engineering Group State-Space Representation There always exist a first order differential equation group which is equivalent to higher order differential equation The solution is not unique; usually there are several first order groups equivalent to higher order differential equation State-space representation is a compact way to present higher order differential equations System state in a certain time moment is a complete system description. If we know the initial state as well as all input values after the initial state, we can define system state and output values in every time moment. That makes state space representation well suitable for modeling. State space representation is also applied in the context of multivariable systems UNIVERSITY of VAASA Telecommunication Engineering Group State-Space Representation In state-space representation, a higher order differential equation (or a group of higher order differential equations) is represented as a group of first order differential equations The number of first order equations will be equal to the order of the higher order differential equation There are several ways to select the state variables state-space representation is not unique UNIVERSITY of VAASA Telecommunication Engineering Group State-Space Representation The general form of the state-space representation is x(t)=f(x(t),u(t) y(t)=g(x(t),u(t)) x(t) contains the state variables, u(t) control (input) variables and y(t) output variables These variables can be either matrices or scalars f(x(t),u(t)) is the system equation which describes the system dynamics g(x(t),u(t)) is the output equation which describes how system output depends on states and on control input If u(t) has a scaler value u(t) and y(t) has a scalar value y(t), the system is SISO. The dimension of state matrix x(t) can still be higher. UNIVERSITY of VAASA Telecommunication Engineering Group Example: A Fluid Flow System (1/5) In a flow process a liquid one which have C 1 F1(t) a chemical consentration C1 is mixed with liquid two which have a chemical concentration C2. We are targeting to have a production (flow F) of such a product, which concentration is C by controlling the flows F1 and F2. There is a free flow from the mixing tank to the air pressure the outflow is propotional to the square root of the tank surface level: F (t ) k h(t ) UNIVERSITY of VAASA Telecommunication Engineering Group C 2 F2 (t) h(t) C(t) A C(t) F(t) Example: A Fluid Flow System (2/5) Form a differential equations for mass balance (will be simplified to volume balance) and for concentration balance: dh(t ) dV (t ) A F1 (t ) F2 (t ) F (t ) dt dt dC (t )V (t ) C F (t ) C F (t ) C (t ) F (t ) 1 1 2 2 dt UNIVERSITY of VAASA Telecommunication Engineering Group Linear State-Space Representation If the system is linear, variables and parameters can be separated. In that case the standard form of the state-space representation is X(t) x (t ) f (x(t ), u(t )) Ax(t ) Bu(t ) R S y(t ) g(x(t ), u(t )) Cx(t ) Du(t ) Y(t) T A is system matrix, B control matrix, C output matrix and D direct effect matrix. It is often so that there is no direct effect. In that case D = 0 (so-called strictly proper system). UNIVERSITY of VAASA Telecommunication Engineering Group Linear State-Space Representation A differential equation group x1 a11 x1 x a x 2 21 1 xn an1 x1 a1n xn b11u1 b1mum a2 n xn b21u1 b2 mum ann xn bn1u1 bnmum Can be represented as a matrix equation x1 a11 xn an1 a1n x1 b11 ann xn bn1 x Ax Bu UNIVERSITY of VAASA Telecommunication Engineering Group b1m u1 bnm um Example: a Circuit Board (1/4) A model for the circuit board illustrated on the left Input is v0(t), outputs are voltages v1(t) ja v2(t). Equations for the capacitors and currents are C1 dv1 (t ) dv (t ) i3 (t ), C2 2 i2 (t ) dt dt Kirchoff I Kirchoff II vR1 (t ) R1i1 (t ), vR 2 (t ) R2i2 (t ) i1 (t ) i2 (t ) i3 (t ) v0 (t ) v1 (t ) i ( t ) 1 R1 v0 (t ) vR1 (t ) v1 (t ) v0 (t ) R1i1 (t ) v1 (t ) v ( t ) v ( t ) v ( t ) v ( t ) R i ( t ) v ( t ) 1 R2 2 1 2 2 2 i (t ) v1 (t ) v2 (t ) 2 R2 UNIVERSITY of VAASA Telecommunication Engineering Group Example: a Circuit Board (2/4) Since the system input and system responses are all voltages, it is reasonable to eliminate the currents from the equations. v0 (t ) v1 (t ) v1 (t ) v2 (t ) 1 dv1 (t ) 1 i ( t ) i ( t ) i ( t ) 1 3 2 dt C1 C1 R1C1 R2C1 dv2 (t ) 1 i (t ) v1 (t ) v2 (t ) 2 dt C2 R2C2 dv1 (t ) 1 1 1 1 v ( t ) v ( t ) 1 2 v0 (t ) dt R1C1 R2C1 R2C1 R1C1 dv2 (t ) 1 v (t ) 1 v (t ) 1 2 dt R C R C 2 2 2 2 UNIVERSITY of VAASA Telecommunication Engineering Group Example: a Circuit Board (3/4) We got first order differential equation group dv1 (t ) 1 1 1 1 v1 (t ) v2 (t ) v0 (t ) dt R1C1 R2C1 R2C1 R1C1 dv2 (t ) 1 v (t ) 1 v (t ) 1 2 dt R C R C 2 2 2 2 Capasitor voltages are natural choise to be the state variables. Select the output to be only the voltage of the latter capasitor v2: v1(t) v (t ) O L , x(t ) M P , u(t ) v (t ), v ((t) t )Q N 1 0 22 UNIVERSITY of VAASA Telecommunication Engineering Group y ( t ) v2 ( t ) Example: a Circuit Board (4/4) By applying these selections we will get 1 1 1 1 x2 (t ) u (t ) x1 (t ) R2C1 R1C1 x(t ) R1C1 R2C1 f (x(t ), u (t )) 1 1 x1 (t ) x2 (t ) R2C2 R2C2 y (t ) x2 (t ) g (x(t ), u (t )) and finally 1 1 1 1 x(t ) R1C1 R2C1 R2C1 x(t ) R C u (t ) Ax(t ) Bu (t ) 1 1 1 1 0 R2C2 R2C2 UNIVERSITY of VAASA y ( t ) 0 Engineering 1 x(t ) 0Group u (t ) Cx(t ) Du (t ) Telecommunication Finding the State Variables How to select the state variables? Make such a selection, which is physically reasonable (like in the previous examples) Use derivative operator p (so-called p-technique) Use chanonical forms Physically reasonable state variable selection is usually the easiest way Applying chanonical forms is just applying of a straightforward formula, but it might be difficult to see the physical meaning of the state variables UNIVERSITY of VAASA Telecommunication Engineering Group Method 3: Use Chanonical Forms (2/2) Apply chanonical forms mx(t ) Bx(t ) kx(t ) F (t ) x(t ) mB x(t ) mk x(t ) m1 F (t ) A result by using controllable chanonical form is similar with the one achieved by using derivative operator y(t ) mB y(t ) mk y(t ) 0u(t ) m1 u(t ) y(t ) a1 y(t ) a2 y(t ) b1u (t ) b2u (t ) mB 1 0 a1 1 b1 x(t ) 1 u (t ) x(t ) u(t ) x(t ) k x (t ) a2 0 b2 m m 0 y (t ) 1 0 x(t ) y (t ) 1 0 x(t ) UNIVERSITY of VAASA Telecommunication Engineering Group The Dimensions of the Linear State-Space Representation The system order is the same as the sum of the order of the differential equations which describe the system. It is also the dimension of the system matrix A. The number of inputs (control signals) is nu The number of outputs is ny System order is nS The dimensions of the linear state-space representation are as follows: x(t ) A x(t ) B u(t ) nS 1 nS nS nS 1 nS nu nu 1 y (t ) C x(t ) D u(t ) ny 1 ny nS nS 1 ny nu nu 1 UNIVERSITY of VAASA Telecommunication Engineering Group Solutions in Time and Laplace Domains Time domain problem y(t ) 2 y(t ) et y(0) 1 Laplace-domain problem 1 sY ( s) y (0) 2Y ( s) s 1 y (0) 1 UNIVERSITY of VAASA Telecommunication Engineering Group Time domain solution y (t ) et Laplace-domain solution 1 Y ( s) s 1 Laplace-transform F(s) is a Laplace transform of time domain function f(t). The Laplacetransform and its inverse transform are defined as follows: F (s) L f (t ) f (t )e st dt f (t ) L1 F ( s) 0 1 b j 2 j b j F ( s)e st ds The following two theorems can be applied, if the respective limits exist: Final value theorem lim f (t ) lim sF ( s) Initial value theorem lim f (t ) lim sF ( s) t t 0 s 0 s The most usual Laplace-transforms and inverse transforms are tabulated UNIVERSITY of VAASA Telecommunication Engineering Group Laplace-transforms (1/5) Laplace-transform Inverse Laplace transform F (s) f (t ) T1 C1 F1 ( s ) C2 F2 ( s ) C1 f1 (t ) C2 f 2 (t ) T2 F ( s a) e at f (t ) T3 ta 0, f (t a ), t a T4 f (at ) T5 f (t )t T6 e as F (s) 1 s F a a d F ( s) ds UNIVERSITY of VAASA Telecommunication Engineering Group Laplace-transforms (2/5) Laplace-transform Time-domain function F ( )d f (t ) s t f ( ) f F1 ( s ) F2 ( s ) 1 2 1 t (t )d T7 T8 0 sF ( s ) f (0) s 2 F ( s ) sf (0) f (0) s n F ( s ) s n 1 f (0) s n 2 f (0) t 1 1 F ( s ) f ( )d s s0 UNIVERSITY of VAASA Telecommunication Engineering Group f (t ) T9 f (t ) T10 f ( n ) (t ) T11 f ( )d T12 f ( n 1) (0) t t 0 0 Laplace-transforms (3/5) Laplace-transform Laplace-transform Time domain 1 1 s 1 s2 1 s n 1 1 sa 1 ( s a)2 1 ( s a ) n 1 1 s(s a) (t ) M1 1 M2 t M3 tn n! M4 e at M5 te at M6 n at t e n! 1 1 e at a UNIVERSITY of VAASA M7 M8 Telecommunication Engineering Group 1 ( s a )( s b) 1 s ( s a )( s b) a s2 a2 s s2 a2 a ( s b) 2 a 2 sb ( s b) 2 a 2 sa sb Time domain 1 e bt e at M9 a b 1 1 ae bt be at M10 ab ab(b a ) sin( at ) M11 cos(at ) M12 e bt sin(at ) M13 e bt cos(at ) M14 (t ) (a b)e bt M15 Impulssi Askel Penger UNIVERSITY of VAASA Telecommunication Engineering Group Diracin delta UNIVERSITY of VAASA Telecommunication Engineering Group Deterministic Test Functions Following signals u(t) are often used as system inputs Unit impulse function (Dirac delta function) ; t 0 u (t ) (t ) 0; t 0 Unit step function U(t) = 0; t <0 = 1; t >0 U ( s) ( s) 1 U s ( s) 1 s Unit ramp function U(t) = 0; t <0 = t; t >0 UNIVERSITY of VAASA Telecommunication Engineering Group U r ( s) 1 s2 Example: Damped Oscillator The differential equation of the damped oscillator: F(t) mx(t ) Bx (t ) kx (t ) F (t ) x(t) m Solve the system response (output), when K=5 x(0) 1 k x(0) 1 B=2 F (t ) 2 (t ) (impulse) M=1 In time domain the model is x(t ) 2 x (t ) 5x(t ) 2 (t ) UNIVERSITY of VAASA Telecommunication Engineering Group B Example: Damped Oscillator Solve location X(s) from the Laplace-transformed expression: X ( s) s3 s 1 2 s 1 2 s2 2 s 5 ( s 1) 2 2 2 ( s 1) 2 2 2 ( s 1) 2 2 2 Then solve x(t) by computing the inverse Laplace transform back to the time domain: x(t ) L1 X (s) et cos(2t ) et sin(2t ) et sin(2t ) cos(2t ) UNIVERSITY of VAASA Telecommunication Engineering Group Zero-State and Zero-Control Responses System response can be divided to the part y0(t) (zerocontrol response) caused by system initial values and to the part yu(t) caused by the external input (zero-state response). Linear system response is a sum of these two parts: y ( t ) yu ( t ) y0 ( t ) System response is equal to zero-control response y0(t) if the external inputs ui(t) = 0. System response is equal to zero-state response yu(t), if all system initial values y(n)(0) and ui(n)(0) are zeros. Term ”response” refers often to zero-state response, in other words system response to some external input UNIVERSITY of VAASA Telecommunication Engineering Group Example: Damped Oscillator Zero-control response starts from the system initial state (location 1, velocity -1) Zero-state response starts from zero once the external force starts to effect System response is a sum of these two components UNIVERSITY of VAASA Telecommunication Engineering Group Transfer Function One of the crucial topics in system analysis is to analyze that how external signals and disturbances affect the system response System transfer function is system response divided by system external input in Laplace-domain: Y ( s) G ( s) U ( s) It follows from the definition that if system initial values are zero, system output in Laplace-domain is given by Y ( s) G( s) U ( s) UNIVERSITY of VAASA Telecommunication Engineering Group U(s) G(s) Y(s) h e rsTransfer äi ti fcner vResponse t ao s f t Input Transfer Function A differential equation (or equation group) characterizing the system is first Laplace-transformed and then Y(s) / U(s) is solved. If we have several input and output variables (MIMO-model), we will get a transfer function matrix UNIVERSITY of VAASA Telecommunication Engineering Group Transfer Function General form of the linear differential equation is y ( n ) (t ) a1 y ( n1) (t ) an1 y (1) (t ) an y(t ) b1u( n1) (t ) bn1u(1) (t ) bn u(t ) Laplace-transform gives (initial values are assumed to be zero) s n a1s n 1 an 1s an Y (s ) b1s n 1 Then it is easy to solve the transfer function b1s n1 bn 1s bn Y ( s) G(s) n U ( s) s a1s n1 an 1s an UNIVERSITY of VAASA Telecommunication Engineering Group bn 1s bn U (s ) Static Gain System static gain quantifies how much signal is strengthtened of faded once it goes through the system For unit step respons, the static gain describes in which level the system response will set (asymptotic stable system) For unit ramp response, the static gain gives the response angular coefficient in continuous state (asymptotic stable system) Static gain can be solved as a limit of system transfer function. It can be solved also for nonstabile systems, but in that case there is no physical connection to system response end value. System static gain is given by For stabile system k limG(s) lim y(t ) s 0 UNIVERSITY of VAASA t Telecommunication Engineering Group l q k lim G( s) s0 From State-Space Representation to Transfer Function A transfer function can be counted directly from the state-space representation such that G(s) C( sI A)1 B D If the direct effect term D = 0, the formula is simplified to G(s) C( sI A)1 B UNIVERSITY of VAASA Telecommunication Engineering Group Example: Damped Oscillator Solve unit step response by using a transfer function 1 s 1 0 G ( s ) C( sI A ) B 1 0 1 5 s 2 s 2 1 0 1 0 1 5 s 1 2 2 s 2s 5 s 2s 5 1 The response is 1 y(t ) L Y ( s) L G (s)U (s ) L 2 s ( s 2 s 5) 1 1 15 1 et cos(2t ) 12 et sin(2t ) UNIVERSITY of VAASA Telecommunication Engineering Group 1 1 U ( s) s