B I O E N 4 6 8 / 5 6 8 Lectures 1-2 Analog to Conversion Binary numbers Biological Signals & Data Acquisition In order to extract the information that may be crucial to understand a particular biological event or system, analog signal processing techniques and digital signal processing techniques can be combined in a sophisticated data acquisition system. 1
Signal pathway Sensor body Analog Signal Conditioning Control Analog to (A/D) to Analog Signal Processing Modeling Analysis Storage Display Analog / continuous Types of Processing Analog: filtering, triggering, amplifying / Discrete : filtering, averaging, spectral analysis, correlation, statistical analysis, interpretation Sensors Transducers convert one energy domain to another Sensors typically mech/chem/optical electronic Actuators typically electric/electronic mech/chem/etc. Act via Modulation of applied power, e.g. photodetector, strain gauges Transduction of power in measured system, e.g. EKG, EMG, capacitive microphones Signal pathway Sensor body Analog Signal Conditioning Control Analog to (A/D) to Analog Signal Processing Modeling Analysis Storage Display 2
Analog signal conditioning Amplify: multiplicative increase in voltage* Filter: modify amplitude as a function of frequency* Trigger: Convert signal transitions into clock pulses *Output/input function should be linear wrt amplitude Signal pathway Sensor body Analog Signal Conditioning Control Analog to (A/D) to Analog Signal Processing Modeling Analysis Storage Display Analog to digital conversion Continuous discrete because we use discrete computers Quantize amplitude by increments of v (floating pt.) Sample in time at intervals of t = 1/f S What we measure: v(t) after amplifier & low pass filter What get from ADC: c(n), c and n integers How we interpret it: v c(n t) v n (t n ) Sensor body Analog Signal Conditioning Control Signal pathway Analog to (A/D) to Analog Signal Processing Modeling Analysis Storage Display 3
Source of the ECG Superior vena cava Sinoatrial node Internodal paths Atrioventricular node Bundle of His Right bundle branch The ECG a measure of the electrical activity of the heart. Continuous from the heart, but discrete in our plot. Voltage (mv) time Time ECG seconds mv 0.000 0.065 0.008 0.095 0.016 0.135 0.024 0.085 0.032 0.055 0.040-0.015 4
More Analog to digital conversion What we really get when we convert A to D is a sequence of numbers. We need to store t 0 and t in order to recover timing LabVIEW waveform Might also want v and amplifier gain Signal pathway Sensor body Analog Signal Conditioning Control Analog to (A/D) to Analog Signal Processing Modeling Analysis Storage Display processing Processes: filtering, frequency transformation, scaling, event detection, counting, statistical analysis, control Hardware: Logic array, microcontroller, microprocessor Software: MATLAB, Excel, R, C, ImageJ, LabVIEW Signal pathway Sensor body Analog Signal Conditioning Control Analog to (A/D) to Analog Signal Processing Modeling Analysis Storage Display 5
Converting continuous to discrete Analog signals need be digitized before they can be stored in digital formats and later digitally processed. The conversion can be performed by using an Analog-to- Converter (ADC). This is where we use binary numbers. Binary numbers in A-to-D Conversion Computers, and hence ADCs, use binary numbers Each binary number is composed of 1s and 0s; each binary digit is one bit The number of possible values in a b-bit number is 2 b 2 3 = 8, 2 8 = 256, 2 12 = 4096, 2 16 = 65,536 Usually count 0 2 b 1 6
Binary Decimal Hexadecimal Binary Decimal Hexadecimal 0001 1 1 1010 10 A 0010 2 2 1100 12 C 0011 3 3 1111 15 F 0100 4 4 0101 5 5 Binary Decimal Hex 0110 6 6 0001 1010 26 1A 1000 8 8 0011 0110 54 36 1001 9 9 1111 1111 255 FF B I O E N 4 6 8 (text) 42 49 4F 45 4E 34 36 38 (hex) 3 4 3 6 3 8 0011 0100 0011 0110 0011 1000 or 316 (integer) = 0000 0001 0011 1100 7
Analog-to- Conversion The computer can store the numbers as: Unsigned Integers (whole numbers) Signed integers (positive and negative) Floating point numbers (mantissa and exponent) Integers usually 8, 16, or 32 bits FP numbers Single precision (32-bit) Double precision (64-bit) Analog-to- Converter (ADC) is really a Continuous-to-discrete converter Assume input range 0 < v in < 10 V Quantized into 2 12 = 4096 parts 9,007.56 4095 Analog (mv) 12-bit ADC 7.34 4.88 2.44 < 2.44 3 2 1 0 8
The ECG a measure of the electrical activity of the heart. Continuous from the heart, but discrete in our plot. Voltage (mv) time Time ECG seconds mv 0.000 0.065 0.008 0.095 0.016 0.135 0.024 0.085 0.032 0.055 0.040-0.015 Within ADC int16 2130 3113 4424 2785 1802-492 v = c v ADC output float or int 65 95 135 85 55-15 t = n t Assume 16-bit ADC over ± 1 V range v = 2000 mv / 2 16 =.00305 mv f s = 125 Hz = 1/(0.008 sec) Amplifier gain 1000 V/V Time ECG seconds mv 0.000 65 0.008 95 0.016 135 0.024 85 0.032 55 0.040-15 Divide by amp gain Time ECG seconds mv 0.000 0.065 0.008 0.095 0.016 0.135 0.024 0.085 0.032 0.055 0.040-0.015 9
Analog-to- Conversion An ADC has a finite resolution. Suppose the ADC has b bits resolution and the input peak-to-peak voltage range is V pp. Then the smallest quantizable voltage, represented by the least significant bit (LSB), is q = V pp / 2 b. b usually from 8 to 16 Analog-to- Conversion For a 12-bit ADC device with a maximum input voltage range [0,,+10] volts (V pp =10), the smallest detectable voltage is: q = 10 /2 12 V = 10/4096 V 2.44 mv The range [0 +10] is the dynamic range 0 V (analog) integer 0 (digital) +10 V (analog) 4096 1 (digital) 10
USB-6008 / 6009 USB-6008 ADS7871 What we really get when we convert A to D is a sequence of numbers. We need to store t 0 and t in order to recover timing Might also want v and amplifier gain ADS7871 in USB-6008 / 6009 USB-6008 ADS7871 11
Data I/O with software MATLAB provides DAQ toolbox and GUI generator LabVIEW (National Instruments, Austin) Inherently a combination of user interface, data I/O interface, and signal manipulator Motto: The Software is the Instrument. LabVIEW tradeoffs Strengths Continuous operation Quick programming (once you know how) Designed for data flow, in form and function Choice of complexity of functions Industry standard, very well supported License for UW -> low software cost Weaknesses Array handling Time axis on plots NI hardware is pricey; LabVIEW expensive for research/industry 12