Biosignals and Systems Prof Nizamettin AYDIN naydinyildiz edu
Biosignals and Systems Prof. Nizamettin AYDIN naydin@yildiz. edu. tr naydin@ieee. org http: //www. yildiz. edu. tr/~naydin 1
A typical biomedical measurement system 2
Biological Systems • A system is a collection of processes or components that interact for some common purpose. • Many systems of the human body are based on function such as the cardiovascular system, pulmonary system, renal system, or on endocrine system, and the nervous system. • The study of classical physiology and many medical specialties are structured around human physiological systems (cardiology, neurology, ophthalmology, nephrology, pulmonology, gastroenterology endocrinology). 3
Systems can be studied from two main perspectives: • Microscopic systems analysis approach: – The fine structure of a system is taken into account. – This approach is an extremely difficult to analyze because of the complexity and large number of variables in the mathematical description of the system. • Muscles are a good example. • A model of a muscle must consider its components – – fibrin, actin, myosin, and the level of action potential • in building up the comprehensive description of the system operation. 4
Systems can be studied from two main perspectives: • Macroscopic system analysis method: – This method is the most common and most useful approach in system analysis. – In this approach, the system is characterized in terms of subsystems and components. • Macroscopic analysis requires that the system be broken into a number of individual components. • The various components are described in sufficient detail and in a manner so that the system operation can be predicted. • The crux is the description of the component behavior, which is done in terms of a mathematical model. 5
• The purpose of an engineering analysis of a system is to determine the response of the system to some input signal or excitation. • Response studies are used to: – – – establish performance specifications; aide in selection of components; uncover system deficiencies (i. e. , instabilities); explain unusual or unexplained behavior; establish proper direction and ranges of variables for the experimental program. • The final system design requires a combined analytical and experimental approach; and – analytical studies are invaluable in the interpretation of results. 6
• To study and analyze a system properly, the means by which energy is propagated through the system must be studied. – Evaluation of energy within a system is done by specifying how varying qualities change as a function of time within the system. • A varying quantity is referred to as a signal. – Signals measure the excitation and responses of systems – Signals are indispensable in describing the interaction among various components/subsystems. – Complicated systems have multi-inputs and multioutputs, which do not necessarily have to be of the same number. – Signals also carry information and coding. • Systems analysis is used to find the response to a specific input or range of inputs when – the system does not exist and is possible only as a mathematical model; – experimental evaluation of a system is more difficult and expensive than analytical studies (i. e. , ejection from an airplane, automobile crash, forces on lower back); and – study of systems under conditions too dangerous for actual experimentation (i. e. , severe weather conditions). 7
• System representation is performed by means of specifying relationships among the systems variables, which can be given in various forms, for example, graphs, tabular values, differential equations, difference equations, or combinations. • There are two main questions one needs to ask: – What is the appropriate model for a particular system? – How good a representation does the model provide? • A system as defined in engineering terms is “a collection of objects interacting with each other to accomplish some specific purpose. ” • Thus, engineers tend to group or classify systems to achieve a better understanding of their excitation, response, and interactions among other system components. 8
The general conditions for any physical system can be reflected by the following general model equation • The necessary conditions for any physical system: – for an excitation (input) the function x(t)=f(φ) exists for all t < t 0 – the corresponding response (output) function y(t)=f(φ) must also exist for all t < t 0. • These conditions are important because natural physical system cannot anticipate an excitation and responds before the excitation is applied. • Classifying a signal typically involves answering several questions about the system, as shown in the next slide. 9
When classifying a system, the following questions should be considered: • What is the order of the system? – The order of a system is the highest order derivative. • Determining the order of a system is important because it also characterizes the response of the system. • Is it a causal or noncausal system? – A Causal System is defined as a physical system whose present response does not depend on future values of the input, – Non-causal System does not exist in the real world in any natural system. • Is it a linear or nonlinear system? – A linear system is a system that possesses the mathematical properties of associative, commutative, and distributive. • Is it a fixed or time-varying system? – A fixed system means that coefficients do not vary with time, whereas a time-varying system means that coefficients do vary with time. 10
When classifying a system, the following questions should be considered: • Is it a lumped or distributed parameter system? – A lumped parameter system is defined as a system whose largest physical dimension is small compared to the wavelength of the highest significant frequency of interest. – A distributed parameter system is defined as a system whose dimensions are large (NOT Small) compared to the shortest wavelength of interest. Distributedparameter systems are generally represented by partial differential equations. • For example, waveguides, microwave tubes, and transmission lines (telephone and power lines) are all distributed parameter systems, because of their physical lengths • Is it a continuous or discrete time system? – Continuous-Time Systems are those that can be represented by continuous data or differential equations, whereas Discrete Time Systems are represented by sampled digital data. • Is it an instantaneous or a dynamic system? – An Instantaneous System is defined as a system that has no memory, which means that the system is not dependent on any future or past value of excitation. – If a system response depends on past value of excitation, then the system is classified as a Dynamic System, which has memory (meaning it stores energy). 11
Biosignals • Irrespective of the type of biological system, its scale, or its function, we must have some way of interacting with that system. • Interaction or communication with a biological system is done through biosignals. • Signals are variations in energy that carry information. • The variable that carries the information (the specific energy fluctuation) depends upon the type of energy involved (as shown in the Table on the next graph. ) 1212
Biosignals (Energy Types) 13
Biotransducers • A “transducer” is a device that converts energy from one form to another. • In signal processing applications, the purpose of energy conversion is to transfer information, not to transform energy. • In physiological measurement systems, transducers may be – input transducers (or sensors) • they convert a non-electrical energy into an electrical signal. • for example, a microphone. – output transducers (or actuators) • they convert an electrical signal into a non-electrical energy. • For example, a speaker. 14
Biotransducers (continued) 15
Signal Encoding: Analog-to Digital Conversion Continuous (analog) signal ↔ Discrete signal x(t) = f(t) ↔ Analog to digital conversion ↔ x(n) = x(1), x(2), x(3), . . . x(n) 16
Analog-to Digital Conversion • ADC consists of four steps to digitize an analog signal: 1. 2. 3. 4. § § Filtering Sampling Quantization Binary encoding Before we sample, we have to filter the signal to limit the maximum frequency of the signal as it affects the sampling rate. Filtering should ensure that we do not distort the signal, ie remove high frequency components that affect the signal shape. 17
18
Sampling • Analog signal is sampled every TS secs. • Ts is referred to as the sampling interval. • fs = 1/Ts is called the sampling rate or sampling frequency. • There are 3 sampling methods: – Ideal - an impulse at each sampling instant – Natural - a pulse of short width with varying amplitude – Flattop - sample and hold, like natural but with single amplitude value • The process is referred to as pulse amplitude modulation PAM and the outcome is a signal with analog (non integer) values 19
More classifications • • Over sampling Exact sampling Undersampling Regular sampling Irregular sampling Linear sampling Logarithmic sampling 20
21
Sampling Theorem Fs 2 fm According to the Nyquist theorem, the sampling rate must be at least 2 times the highest frequency contained in the signal. 22
Nyquist sampling rate for low-pass and bandpass signals 23
Recovery of a sampled sine wave for different sampling rates 24
Quantization • Sampling results in a series of pulses of varying amplitude values ranging between two limits: a min and a max. • The amplitude values are infinite between the two limits. • We need to map the infinite amplitude values onto a finite set of known values. • This is achieved by dividing the distance between min and max into L zones, each of height = (max - min)/L 25
Quantization Levels • The midpoint of each zone is assigned a value from 0 to L-1 (resulting in L values) • Each sample falling in a zone is then approximated to the value of the midpoint. 26
Quantization Zones • Assume we have a voltage signal with amplitutes Vmin=-20 V and Vmax=+20 V. • We want to use L=8 quantization levels. • Zone width = (20 - -20)/8 = 5 • The 8 zones are: -20 to -15, -15 to -10, -10 to -5, -5 to 0, 0 to +5, +5 to +10, +10 to +15, +15 to +20 • The midpoints are: -17. 5, -12. 5, -7. 5, -2. 5, 7. 5, 12. 5, 17. 5 27
Assigning Codes to Zones • Each zone is then assigned a binary code. • The number of bits required to encode the zones, or the number of bits per sample as it is commonly referred to, is obtained as follows: nb = log 2 L • Given our example, nb = 3 • The 8 zone (or level) codes are therefore: 000, 001, 010, 011, 100, 101, 110, and 111 • Assigning codes to zones: – 000 will refer to zone -20 to -15 – 001 to zone -15 to -10, etc. 28
Quantization and encoding of a sampled signal 29
Quantization Error • When a signal is quantized, we introduce an error the coded signal is an approximation of the actual amplitude value. • The difference between actual and coded value (midpoint) is referred to as the quantization error. • The more zones, the smaller which results in smaller errors. • BUT, the more zones the more bits required to encode the samples -> higher bit rate 30
Analog-to-digital Conversion Example An 12 -bit analog-to-digital converter (ADC) advertises an accuracy of ± the least significant bit (LSB). If the input range of the ADC is 0 to 10 volts, what is the accuracy of the ADC in analog volts? Solution: If the input range is 10 volts then the analog voltage represented by the LSB would be: Hence the accuracy would be ±. 0024 volts. 31
Data types 26 Eylul 2 k 11 • Our first requirement is to find a way to represent information (data) in a form that is mutually comprehensible by human and machine. – Ultimately, we will have to develop schemes for representing all conceivable types of information language, images, actions, etc. – We will start by examining different ways of representing integers, and look for a form that suits the computer. – Specifically, the devices that make up a computer are switches that can be on or off, i. e. at high or low voltage. Thus they naturally provide us with two symbols to work with: we can call them on & off, or (more usefully) 0 and 1. 32
Signal • An information variable represented by physical quantity. • For digital systems, the variable takes on discrete values. • Two level, or binary values are the most prevalent values in digital systems. • Binary values are represented abstractly by: – – digits 0 and 1 words (symbols) False (F) and True (T) words (symbols) Low (L) and High (H) and words On and Off. • Binary values are represented by values or ranges of values of physical quantities 33
Number Systems – Representation • Positive radix, positional number systems • A number with radix r is represented by a string of digits: An - 1 An - 2 … A 1 A 0. A- 1 A- 2 … A- m + 1 A- m in which 0 £ Ai < r and. is the radix point. • The string of digits represents the power series: (å i = n - 1 (Number)r = i=0 Ai r )+( å j = - 1 i j = - m Aj r ) j (Integer Portion) + (Fraction Portion) 34
Decimal Numbers • “decimal” means that we have ten digits to use in our representation (the symbols 0 through 9) • What is 3546? – it is three thousands plus five hundreds plus four tens plus six ones. – i. e. 3546 = 3. 103 + 5. 102 + 4. 101 + 6. 100 • How about negative numbers? – we use two more symbols to distinguish positive and negative: + and 35
Unsigned Binary Integers Y = “abc” = a. 22 + b. 21 + c. 20 (where the digits a, b, c can each take on the values of 0 or 1 only) N = number of bits Range is: 0 i < 2 N - 1 Problem: • How do we represent negative numbers? 3 -bits 5 -bits 8 -bits 0 00000 1 00001 00000001 2 010 00000010 3 011 00000011 4 100 00000100 36
Two’s Complement • Transformation – To transform a into -a, invert all bits in a and add 1 to the result Range is: -2 N-1 < i < 2 N-1 - 1 Advantages: • Operations need not check the sign • Only one representation for zero • Efficient use of all the bits -16 10000 … … -3 11101 -2 11110 -1 11111 0 00000 +1 00001 +2 00010 +3 00011 … … +15 01111 37
Limitations of integer representations • Most numbers are not integer! – Even with integers, there are two other considerations: • Range: – The magnitude of the numbers we can represent is determined by how many bits we use: • e. g. with 32 bits the largest number we can represent is about +/- 2 billion, far too small for many purposes. • Precision: – The exactness with which we can specify a number: • e. g. a 32 bit number gives us 31 bits of precision, or roughly 9 figure precision in decimal repesentation. • We need another data type! 38
Real numbers • Our decimal system handles non-integer real numbers by adding yet another symbol - the decimal point (. ) to make a fixed point notation: – e. g. 3456. 78 = 3. 103 + 4. 102 + 5. 101 + 6. 100 + 7. 10 -1 + 8. 10 -2 • The floating point, or scientific, notation allows us to represent very large and very small numbers (integer or real), with as much or as little precision as needed: – Unit of electric charge e = 1. 602 176 462 x 10 -19 Coulomb – Volume of universe = 1 x 1085 cm 3 • the two components of these numbers are called the mantissa and the exponent 39
Real numbers in binary • We mimic the decimal floating point notation to create a “hybrid” binary floating point number: – We first use a “binary point” to separate whole numbers from fractional numbers to make a fixed point notation: • e. g. 00011001. 110 = 1. 24 + 1. 23 + 1. 21 + 1. 2 -2 => 25. 75 (2 -1 = 0. 5 and 2 -2 = 0. 25, etc. ) – We then “float” the binary point: • 00011001. 110 => 1. 1001110 x 24 mantissa = 1. 1001110, exponent = 4 – Now we have to express this without the extra symbols ( x, 2, . ) • by convention, we divide the available bits into three fields: sign, mantissa, exponent 40
IEEE-754 fp numbers - 1 s biased exp. 32 bits: 1 8 bits fraction 23 bits N = (-1)s x 1. fraction x 2(biased exp. – 127) • Sign: 1 bit • Mantissa: 23 bits – We “normalize” the mantissa by dropping the leading 1 and recording only its fractional part (why? ) • Exponent: 8 bits – In order to handle both +ve and -ve exponents, we add 127 to the actual exponent to create a “biased exponent”: • 2 -127 => biased exponent = 0000 (= 0) • 20 => biased exponent = 0111 1111 (= 127) • 2+127 => biased exponent = 1111 1110 (= 254) 41
IEEE-754 fp numbers - 2 • Example: Find the corresponding fp representation of 25. 75 • 25. 75 => 00011001. 110 => 1. 1001110 x 24 • sign bit = 0 (+ve) • normalized mantissa (fraction) = 100 1110 0000 • biased exponent = 4 + 127 = 131 => 1000 0011 • so 25. 75 => 0 1000 0011 100 1110 0000 => x 41 CE 0000 • Values represented by convention: – Infinity (+ and -): exponent = 255 (1111) and fraction = 0 – Na. N (not a number): exponent = 255 and fraction 0 – Zero (0): exponent = 0 and fraction = 0 • note: exponent = 0 => fraction is de-normalized, i. e no hidden 1 42
Binary Numbers and Binary Coding • Flexibility of representation – Within constraints below, can assign any binary combination (called a code word) to any data as long as data is uniquely encoded. • Information Types – Numeric • Must represent range of data needed • Very desirable to represent data such that simple, straightforward computation for common arithmetic operations permitted • Tight relation to binary numbers – Non-numeric • Greater flexibility since arithmetic operations not applied. • Not tied to binary numbers 43
Non-numeric Binary Codes • Given n binary digits (called bits), a binary code is a mapping from a set of represented elements to a subset of the 2 n binary numbers. • Example: A Binary Number Color binary code Red 000 Orange 001 for the seven Yellow 010 colors of the Green 011 rainbow Blue 101 Indigo 110 • Code 100 is Violet 111 not used 44
Number of Bits Required • Given M elements to be represented by a binary code, the minimum number of bits, n, needed, satisfies the following relationships: 2 n > M > 2(n – 1) n = log 2 M where x , called the ceiling function, is the integer greater than or equal to x. • Example: How many bits are required to represent decimal digits with a binary code? – 4 bits are required (n = log 2 9 = 4) 45
Number of Elements Represented • Given n digits in radix r, there are rn distinct elements that can be represented. • But, you can represent m elements, m < rn • Examples: – You can represent 4 elements in radix r = 2 with n = 2 digits: (00, 01, 10, 11). – You can represent 4 elements in radix r = 2 with n = 4 digits: (0001, 0010, 0100, 1000). 46
47
Linear Systems Analysis • A linear system has proportionality of response (twice as much in, twice as much out). • Stated mathematically: Differentiation and integration are linear operations, so that processes described by differentiation and integration are linear operations: 48
Analysis of Linear Systems Analysis includes two basic approaches: Analog analysis: individual components are represented by analogous elements. Often these elements show fairly detailed structures, and provide some insight into the way in which a given process is implemented. Systems analysis: provides a more succinct description and often better overall view of the system under study. In addition, the more abstract representation provided by systems models emphasizes behavioral characteristics, and may aid in identifying behavioral similarities between processes that contain quite different elements. 49
Analysis of Linear Systems • The primary difference between analog analysis and systems analysis is the way the underlying physiological processes are represented. • In analog analysis, individual components are represented by analogous elements. Often these elements show detailed structures and provide some insight into the way in which a given process is implemented. • In systems analysis, a whole process can be represented by a single mathematical equation. 50
Analog Modeling and Analysis • In analog analysis, there is a direct relationship between the physiological mechanism and the analog elements used in the model, although the elements may not necessarily be in the same energy modality as the physiological mechanism. • For example, next 2 figures show what appears to be an electric circuit and a mechanical circuit. – Actually the 1 st figure is an early analog model of the cardiovascular system known as the windkessel model. – The 2 nd figure shows an analog model of the skeletal muscle that uses mechanical elements. 51
Analog Modeling and Analysis In this circuit, • voltage represents blood pressure, • current represents blood flow, • RP and CP are the resistance and compliance of the systemic arterial tree, • Z 0 is the characteristic impedance of the proximal aorta. 52
Analog Modeling and Analysis • The muscle's force originates at the contractile element, but this force, F 0, is modified by the muscle mechanical processes before it appears at the output, F. • The internal mechanical processes include the tissue viscosity, a sort of internal friction, the parallel elastic element which represents the elastic properties of the sarcolemma, and the series elastic element that reflects the elastic behavior of muscle tendons. – In real muscle, these elements are nonlinear, but are often approximated as linear providing a linearized skeletal muscle model. 53
Analog Modeling and Analysis Analog models contain 3 different elements differentiated by the physical behavior: where v 1 and v 2 are variables of the system (see next graph). Inertia and capacitive elements store energy while dissipative elements take energy out of the system they are in (i. e. , they dissipate energy. ) 54
Analog Variables Electrical and mechanical systems each have two primary variables: voltage - current and force – velocity. ( These systems are analyzed using different, but related laws of behavior 55
Example 1 -2 A constant force of 4 dynes is applied to a 2 gram mass. Find the velocity of the mass after 5 sec. Solution Inertia is one property of mass that is defined by an integral relationship between the mechanical variables force, F, and velocity, v: To find the velocity of the mass given the force, solve for υ in the above equation by time integrating both sides of the equation: 56
Systems Analysis and Systems Models • Systems models usually represent whole processes using so-called black box components. • Each element of a systems model consists only of an input-output relationship defined by an equation and represented by a geometric shape, usually a rectangle. – No effort is made to determine what is actually inside the box; hence the term black box. – The modeler pays attention to only its overall input-output (or stimulus/response) characteristics. • A typical element in a systems model is shown graphically as a box or sometimes as a circle when an arithmetic process is involved. – The inputs and outputs of all elements are signals with a well-defined direction of flow or influence. These signals and their direction of influence are shown by lines and arrows connecting the system elements. 57
Systems Analysis and Systems Models A system element such as the rectangle above is defined by the Transfer Function: 58
Systems Model (example) • One of the earliest physiological systems models, the pupil light reflex, is shown in the next figure. • It includes two processes. – The pupil light reflex is the response of the iris to changes in light intensity falling on the retina. – Increases or decreases in ambient light cause the muscles of the iris to change the size of the pupil in an effort to keep light falling on the retina constant. • This system was one of the first to be studied using engineering tools. • The two-component system receives light as the input and produces a movement of the iris muscles that changes pupil area, the aperture in the visual optics. 59
Systems Model (example) • The first box represents all of the neural processing associated with this reflex, including the light receptors in the eye. • It generates a neural control signal, which is sent to the second box. • The second box represents the iris musculature, including its geometric configuration. • The input to this second box is the neural control signal from the first box and the output is pupil area. 60
Systems Model (example) The pupil light reflex regulates the light falling on the retina of the eye through a three-neuron reflex arc. The system is a feedback system because changes in the output, the size of the pupil, effect the input, retinal light. 61
Systems Model • The systems model shown in the previous slide demonstrates the strengths and the weaknesses of systems analysis. – By compressing a number of complex processes into a single black box, and representing these processes by a single input-output equation, a systems model can provide a concise, highly simplified representation of a very complex system. – You need not understand how a biological process accomplishes a given task. As long as you can document some of its behavior quantitatively, you can usually construct a system representation. This will allow you to analyze the system's behavior over a large stimulus range or incorporate that process into the analysis of a larger system. • However, this ability to reduce complex processes to a few elements, each represented by a single equation, means that these models do not provide much insight into how the process or processes are implemented by the underlying physiological mechanisms. 62
Feedback Control (example) Find the overall input-output relationship for the systems model below. Assume that the system is in steady-state condition so that all the signals have constant values and the two elements, represented by the equations G and H, are simply gain constants. • In this system, the upper element (the feedforward element) has a Transfer Function of G and the lower element (the feedback element) has a Transfer Function of H. • The output modifies the input after passing through the element H. 63
Feedback Control (continued) The overall Transfer Function, Out/In, can be determined using algebra: This equation is known as the Feedback Equation 64
Noise and Variability • Noise is what you do not want in a system – noise is unwanted variability • Noise often limits the usefulness of a signal. 65
Electronic Noise Electronic noise has energy at all frequencies. To give a number to the amount of noise present, a range of frequencies must be specified. 66
Electronic Noise (continued) • Johnson or thermal noise is produced by resistance sources • The amount of noise generated is related to the resistance and to the temperature (as well as the bandwidth). where R is the resistance in ohms, T the temperature in degrees Kelvin, BW the range of frequencies in Hz, and k is Boltzman’s constant (k = 1. 38 x 1023 J/OK). • If noise current is of interest, the equation for Johnson noise current can be obtained from the above equation in conjunction with Ohm’s law 67
Electronic Noise (continued) • Shot noise is defined as a current noise and is proportional to the baseline current through a semiconductor junction: • When multiple noise sources are present, their voltage or current contributions add as the square root of the sum of the squares (assuming independent sources): For voltages: 68
Example 1 -5 A 20 ma current flows through a both a diode (i. e. , a semiconductor) and a 2 00 Ω resistor. What is the total current noise? Assume a bandwidth of 1 MHz (1 x 106 Hz) and room temperature. (A temperature of 310 OK is often used as room temperature, in which case 4 k. T = 1. 7 x 10 -20 J. ) Solution. Find the shot noise contributed by the diode and the Johnson noise contributed by the resistor, then combine them. 69
Signal-to-Noise Ratio • The Signal-to-noise ratio or SNR is simply the ratio of signal to noise, both measured in RMS (root-mean-squared) amplitude. The SNR is often expressed in “db” where: • To convert from db scale to a linear scale: For example, a SNR of: 20 db means that the RMS value of the signal is 10 times the RMS value of the noise (10 (20/20) = 10) , +3 db indicates a ratio of 1. 414 (10(3/20) = 1. 414), 0 db means the signal and noise are equal, - 3 db means that the ratio is 1/1. 414, and -20 db means the signal is 1/10 of the noise in RMS units. 70
SNR (continued) A sinusoid with added noise at 4 levels of SNR (in db). 71
- Slides: 71