Search for question
Question

4) We will now look at sensor data taken from an electrocardiogram (ECG) recording, which converts voltage on the

skin surface to a digital code using an ADC. As with the data we looked at in Studio #3, this comes from the open-

source MIT-BIH database on Physionet (although it is a different recording). The recorded ECG data is saved in

HW2_Workbook.xlsx. A few notes:

.

In the first column, we have the sample number - the sensor ADC makes a voltage measurement 128 times

per second, so the elapsed time between each sample is approximately 7.81 ms (e.g. 1/128).

In the second column, we have a binary representation of the ADC voltage measurement. For positive

numbers, this will look like normal binary encoding. For negative numbers, this uses an encoding scheme

called "Two's Complement"; the details of this aren't important for now, but you are welcome to read more

about this online. This binary format is standard for Excel, so we can use built-in functions to manage it.

For the ADC recording, the smallest step (ie. least significant bit, LSB) is 0.005mV (e.g. 5uV).

a) First, we can convert ADC code the decimal values using the =BIN2DEC() function. Go ahead and do this

in the "ECG ADC Code (Decimal)" column. If you do this correctly, the first few values should be -10, -13,

and -9. If you look down the column, you should also see a high peak value (local maximum) between samples

25 and 40; which sample number is this, and what is the peak value?

b) If the ADC step size is 0.005mV, as described above, the original voltage recorded at each sample during the

ECG measurement can be calculated (reconstructed) by multiplying the decimal ADC code by the step size.

Go ahead and do this in the "ECG (mV)" column. What is the maximum voltage you see in the data set?

c) To figure out the elapsed time at each sample, we can just multiply the sample number by the time step, which

as described above is 1/128 7.18ms. Go ahead and do this in the "Elapsed Time (s)" column. Note that you

can use (1/128) directly in your Excel calculations, and you don't need to approximate - Excel will manage the

rounding, and this is more accurate.

d) Finally, create a straight-line scatter plot of ECG (mV) vs Elapsed Time (s) for the first 5s of ECG recording.

Make sure all axes are labeled, fonts and font sizes are clear and consistent, and overall formatting is

professional. Also, for this plot, turn off the markers, so we just see the overall ECG waveform. Be sure to

include a copy of this plot directly in your homework solution PDF that you upload.