ad/da converter national instruments ni usb-6009 bme 1008 introduction to biomedical engineering...
Post on 17-Dec-2015
229 Views
Preview:
TRANSCRIPT
AD/DA ConverterNational Instruments NI USB-6009
BME 1008 Introduction to Biomedical EngineeringFIU, Spring 2015
Feb 12Lesson 4
- NI USB-6009.- Matlab structures and loops.
TestOn 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.
Analog to Digital Conversion
Digital Output Signal Analog Input Signal
Sampling Biological Analog Waveforms
Oximetrysampling rate 10-550 S/sS/s – Samples per second
Data Acquisition from an analog source is important in Biomedical Engineering
Functional MRI (FMRI), sampling rate 1-5 S/s
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
What’s in the box?
• 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).
Successive approximation ADCSAR = successive approximation registerDAC = Digital-to-Analog converter
EOC = end of conversion
Digital Output Signal
Analog Input Signal
S/H = sample & hold
Discretized signal
Resolution of ADC ADC resolution is given by the number of bits, e.g. 3 bits2(# of bits) - the number of discrete voltage levels of ADC
Examples: ADC with a resolution of 3 bits
has 23 = 8 discrete levels (figure).
NI6009 has 14-bit resolution, and 214 = 16,384 discrete levels.
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]
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.Gradesans =
3.2000 3.1000 2.9000
Matlab loop with FORfor
Repeat statements a specific number of times Syntaxfor variable = expression
statements end
Example : for n=1:4 %n = [1 2 3 4] v(n) = 10^(n-1) end
>> for n=1:4v(n) = 10^(n-1) % v(n) is the n-th element of
vend
v = 1
v = 1 10
v = 1 10 100
v = 1 10 100 1000
Quiz 6 - FOR loop
Calculate the sum 1/10 + 1/21 + 1/32 + ....1/98 + 1/109.
% Run Matlab script:s = 0;for n= 1:10
s = s + 1/n^(n-1)end
% Answer sum = 1.6285
top related