Download presentation
Presentation is loading. Please wait.
Published byTracey Taylor Modified over 10 years ago
1
AD/DA Converter National Instruments NI USB-6009 BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Feb 12 Lesson 4 - NI USB-6009. - Matlab structures and loops.
2
Test On February 26, test from Matlab lessons 1, 2, 3 and 4. Notes and laptops not allowed during the test. 21% of your grading. To prepare for the test, study PowerPoints 1, 2, 3, 4 for the Matlab programming (except the audio functions wavread, wavplay, and audioplayer); PowerPoints 3 and 4 for the AD/DA conversion.
3
Analog to Digital Conversion Digital Output Signal Analog Input Signal
4
Sampling Biological Analog Waveforms Oximetry sampling rate 10-550 S/s S/s – Samples per second Data Acquisition from an analog source is important in Biomedical Engineering Functional MRI (FMRI), sampling rate 1-5 S/s
5
USB 6009 Analog-to-digital and digital-to-analog Converter Can receive voltage signal from -10V to 10V Accuracy = 7.73mV 14 bits resolution, each sample is represented by 14 bits Max sampling rate is 48 kS/s (48 kHz) 1 kS/s = 1000 samples/second Can output 5V signal
6
What’s in the box?
7
OpAmp, microcontroller and a number of other electronic components are integrated circuits. Integrated Circuit (IC), chip, or a microchip - a set of electronic circuits on one small chip of semiconductor material. usually crystal silicon, Si, (not to be confused with the rubber-like silicone).
14
Successive approximation ADC SAR = successive approximation register DAC = Digital-to-Analog converter EOC = end of conversion Digital Output Signal Analog Input Signal S/H = sample & hold Discretized signal
15
Resolution of ADC ADC resolution is given by the number of bits, e.g. 3 bits 2 (# of bits) - the number of discrete voltage levels of ADC Examples: ADC with a resolution of 3 bits has 2 3 = 8 discrete levels (figure). NI6009 has 14-bit resolution, and 2 14 = 16,384 discrete levels.
18
Matlab structures A structure allows to save multiple kinds of data under a single variable. Example: % Apostrophes (' ') indicate text string >> s1.Name = 'Carlos'; >> s1.Age = 24; >> s1.Grades = [3.2 3.1 2.9] s1 = Name: 'Carlos' Age: 24 Grades: [3.2000 3.1000 2.9000]
19
Structure name fields values s1 = Name: 'Carlos' %string value Age: 24 %scalar Grades: [3.2000 3.1000 2.9000] %vector To access an individual field: >> s1.Grades ans = 3.2000 3.1000 2.9000
20
Matlab loop with FOR for Repeat statements a specific number of times Syntax for variable = expression statements end Example : for n=1:4 %n = [1 2 3 4] v(n) = 10^(n-1) end
21
>> for n=1:4 v(n) = 10^(n-1) % v(n) is the n-th element of v end v = 1 v = 110 v = 110100 v = 1101001000
22
Quiz 6 - FOR loop Calculate the sum 1/1 0 + 1/2 1 + 1/3 2 +....1/9 8 + 1/10 9. % Run Matlab script: s = 0; for n= 1:10 s = s + 1/n^(n-1) end % Answer sum = 1.6285
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.