data acquisition - massachusetts institute of technologyalumni.media.mit.edu/~emunguia/pdf/arithmia...

22
Data acquisition Question 1 Draw a block diagram to illustrate how the data was acquired. Be sure to include important parameter values The block diagram illustrating how the signal was acquired is shown in figure 1. Figure 1 Block diagram illustrating how the signal was acquired Question 2 If you examine the data, you will notice that the ECG data values have been rounded to the nearest milivolt. Is this a result of the 16-bit quantization, or was additional resolution lost after the quantization, explain. This is because of the 16-bit quantization because the quantization round quantizer output xQ[n] to kQ where the Q is the quantization step, and k is the integer closest to x[n]/Q. This is, we are going from a continuous signal to a finite signal (that only takes discrete values). Question 3 Consider the analog filter used in the data acquisition. (a) Why was the signal filtered to exclude frequencies above 100Hz prior to sampling? The signal was filtered to exclude frequencies above 100Hz because we wanted to avoid aliasing due to signals above 100Hz. For example, to avoid high frequency noise above 100Hz. Also, the sampling rate is 250Hz. Band limiting the signal at 100Hz, make us to over sample the signal a little bit so that we are able to better reconstruct the signal (remember that a signal can be reconstructed if it was sampled at least at the double of the highest frequency). With a sampling rate of 250Hz we are still able to reconstruct signals of 125Hz. Finally, because the bandwidth of the ECG signal is believed to be between 0.5Hz and 100Hz. Some doctors argue that the really important frequencies are contained between 0.1 and 50Hz. (b) Consider what would have happened if this analog filter had not being used. Assume that the ECG signal is effectively band limited to 50Hz and that the only noise id due to the third and sixth harmonics of 60Hz power noise (at 180Hz and 360Hz). Does sampling the unfiltered analog ECG signal at 250Hz "filter out " the power line noise? When sampling the signal at 250Hz, we are able to reconstruct signals of 125Hz. Even though the

Upload: others

Post on 06-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Data acquisition

Question 1 Draw a block diagram to illustrate how the data was acquired. Be sure to includeimportant parameter values

The block diagram illustrating how the signal was acquired is shown in figure 1.

Figure 1 Block diagram illustrating how the signal was acquired

Question 2 If you examine the data, you will notice that the ECG data values have beenrounded to the nearest milivolt. Is this a result of the 16-bit quantization, or was additionalresolution lost after the quantization, explain.

This is because of the 16-bit quantization because the quantization round quantizer output xQ[n] tokQ where the Q is the quantization step, and k is the integer closest to x[n]/Q. This is, we are goingfrom a continuous signal to a finite signal (that only takes discrete values).

Question 3 Consider the analog filter used in the data acquisition.

(a) Why was the signal filtered to exclude frequencies above 100Hz prior to sampling?

The signal was filtered to exclude frequencies above 100Hz because we wanted to avoid aliasingdue to signals above 100Hz. For example, to avoid high frequency noise above 100Hz.

Also, the sampling rate is 250Hz. Band limiting the signal at 100Hz, make us to over sample thesignal a little bit so that we are able to better reconstruct the signal (remember that a signal can bereconstructed if it was sampled at least at the double of the highest frequency). With a sampling rateof 250Hz we are still able to reconstruct signals of 125Hz.

Finally, because the bandwidth of the ECG signal is believed to be between 0.5Hz and 100Hz.Some doctors argue that the really important frequencies are contained between 0.1 and 50Hz.

(b) Consider what would have happened if this analog filter had not being used. Assume thatthe ECG signal is effectively band limited to 50Hz and that the only noise id due to the thirdand sixth harmonics of 60Hz power noise (at 180Hz and 360Hz). Does sampling the unfilteredanalog ECG signal at 250Hz "filter out " the power line noise?

When sampling the signal at 250Hz, we are able to reconstruct signals of 125Hz. Even though the

Page 2: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

signals of noise at 180Hz and 360Hz, these are still introducing noise to our signal. This is becauseof the aliasing phenomenon. We eliminate most of the noise due to 180 and 360Hz, but the lowfrequency components of these signals are still adding noise to our sampled signal (I am assumingthat the noisy signals at 180Hz and 360Hz are not pure sinusoidal as it normally is).

Signal Conditioning/Noise Reduction

The first thing I did was to find a typical 10 seconds segment of clean data, 10 seconds segment ofnoisy data and examine the frequency content to have an idea of what low and high cutofffrequencies I could use to eliminate as much noise as possible and still be able to conserve as muchenergy as possible of the original signal. I got this segment from the file called janet.txt. The signalsand their frequency contents can be seen in figure 2.

Figure 2. Clean and noisy segment of 10 seconds of signal of the janet file

Question 4 Describe your bandpass filter. Including plots of your filter's impulse response andfrequency response (in dB versus Hz)

In this step, I experimented with almost all the MATLAB functions for FIR filter design.I wanted to choose the filter that have the best transition band (slope) and sidelobe magnitude in itsfrequency response.

Page 3: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Filter Function Filter design method usedfir1 windowing methodfir2 Frequency Sampling methodfirls The least squares design method

remez the Equiripple design method

The second step was to make a graph of all the frequency response of the filters in order to decidewhich one was the most suitable for use in this application. The frequency response of the filterscan be seen in Figure 3 for low-frequency cutoff of 3Hz and a high-frequency cutoff of 30Hz.

Figure 3 Magnitude of the frequency response of all the filters designed

In my point of view, the filter that offers the best tradeoff between transition band slope (howsimilar it is to the ideal filter) and the magnitude of the sidelobes magnitude is the fir1 filter. Thefilter response of the fir1 filter can be seen in figure 4.

Figure 4. Magnitude of the frequency response of the filter designed using the Fir1 MATLABfunction

Page 4: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

What were the desired specifications for the filter?How did you decide on those specifications?

In order to select the desired specifications, I played with the low and high-cutoff frequencies of thebandpass filter.

First, I tried setting the low-frequency cutoff (FL) to the following values: 1, 2, 3, 5 and 10Hz.Frequencies under 2 Hz does not completely eliminate the baseline fluctuations. The filtered signalusing FL = 1Hz can be seen in Figure 5. Frequencies over 3Hz eliminate too much low frequenciesthat the QRS signal starts deforming (distortioning). This can be seen in figure 6.

Figure 5. low-frequency cutoff of 1Hz

Figure 6. low-frequency cutoff of 10Hz

Page 5: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Secondly, I tried playing with the high-cutoff frequency(FH) using values of 80, 50, 40, 30 and20Hz. My analysis showed that using frequencies over 40 Hz does not really eliminate the highfrequency noise. This effect can be seen in figure 7. Frequencies under 30 Hz deform (distortion)the form of the QRS signal. This can be seen in figure 8.

Figure 7. high-frequency cutoff of 50Hz

Figure 8. high-frequency cutoff of 20Hz

Finally, I decided to use the following specifications that in my point of view, are the optimal onesfor this application.

Page 6: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

The specifications of the filter are the following:

Filter order 200Low cutoff frequency (FL) 2.3HzHigh cutoff frequency (FH) 30Hz

I chose these specifications because these cutoff frequencies eliminate the baseline fluctuations (lowfrequencies) and at the same time does not eliminate too many high frequencies maintaining theQRS signal sharp enough for clinical diagnosis. These cutoff frequencies also maintain most of theenergy in the signal. The filtered signal containing low frequency noise can be seen in figure 9 andthe filtered signal containing high frequency noise in figure 10.

Figure 9. Filtered signal originally (low frequency noise segment) FL= 3Hz and FH = 30Hz.

Figure 10. Filtered signal originally (segment with high frequency noise) FL = 3Hz, FH = 30Hz.

Page 7: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

What filter design technique did you use?

Since I used the function fir1 to design the FIR filter, I used the windowing method for designingfilters.

How well does your actual filter meet the desired specifications as well as any tradeoffs youencountered in the design process?

As I mentioned earlier, I tried to find a balance between the low and high cutoff frequencies wereable to eliminate as much noise as possible but without distortioning the original QRS signal. I alsoused a tradeoff between the transition bandpass section of the filter (slope) and the sidelobesmagnitude of the frequency response of the filter so that the original QRS signal were notdistortioned too much.

Question 5. Describe the effect of your bandpass filter on both, the clean data and noisy data.Include plots of the clean and noisy data in both the time and frequency domain before andafter filtering and make relevant comparisons.

The plot of the clean and noisy segments of the signal in the time is shown in figures 9 and 10. Theplots in the frequency domain can be seen in figure 11.

Figure 11. Plot of the time and frequency domain of the clean and noisy data of the signal.

Another way to appreciate the filtering operation is to plot the frequency contents of the noisysignal after and before the filtering step in the same plot. This can be seen in figure 12.

Page 8: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Figure 12. Frequency contents of the noisy segment of the signal after and before the filtering step.

Question 6. What are the limitations of this bandpass filtering approach? (if it were possibleto implement an ideal filter with any desired specifications, would you expect to remove all ofthe noise?)

If we were able to implement an ideal filter with any desired specifications, we could not be able toremove all the noise. Consider noise that has low and high frequency components. Imagine that thelow frequency components are between 10 and 200Hz and we want to filter a signal between 0.1and 100Hz. Using a filter between 1 and 100Hz is going to eliminate the high frequencycomponents of the noise, but not the low frequency components contained between 10 and 100Hz.This is, we are only going to be able to eliminate the noise if we are willing to throw away oursignal. In other words, we are never going to completely eliminate all noise in a signal by filtering.

Ventricular Arrhythmia Detection

Objective: detect life threatening arrhythmias such as Ventricular fibrillation and ventricularfluttering.

Question 7. Explain your choice of parameters (window length, window shape, and FFTlength) used with the spectrum function. What is the effective frequency resolution (in Hz) ofthe spectral analysis that you performed?

The parameters that I used with the spectrum signal are the following:

Window length 512Window Shape Hamming

FFT length 512

First of all, I chose the hamming window because this shape of window is the one that gives thebest tradeoff between frequency and amplitude resolution.

Page 9: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Please remember that the frequency resolution is determined by the window length and shape, andthe amplitude resolution is primarily determined by the window shape.

I chose the FFT length to be the length of the window length because this is the minimummeaningful length for spectrum analysis.

Increasing the FFT length will provide a more closely spaced frequency samples of the underlyingDTFT. In general, the DFT (FFT) provides more information about the underlying DTFT when weincrease the DFT (FFT) length.

I chose the window length accordingly to the following statements: The mainlobe is inverselyproportional to the window length. Also remember that a narrower mainlobe produces a betterfrequency resolution. Thus, we conclude that a desirable characteristic of our window is to be longenough but without exceeding the number of points of our signal .

The frequency resolution is the following:

4/M = F/Fs

F = 4(Fs)/M

where M is the length of the window Thus, we have:

F = 4(250)/512 = 1.95Hz

Question 8. How do the ventricular arrhythmia segments differ from the normal segments inboth, the time and frequency domain? (include relevant plots)

The first thing that I did in this step is to read the files n_422.bin and n_424.bin using the readecgfunction. Once I had the data of both files in memory, I consulted the files atr_n422.txt andatr_n424.txt (which have an expert evaluation of the QRS signal) so that I could make sure I wasgoing to get one segment of normal QRS signal and one of ventricular fibrillation/flutteringsegment for each file. I calculated the spectrum of each segment (10 seconds) and I plotted thesegment in the frequency and time domain. The plot of the normal and fibrillation/flutteringsegments in the time domain for file n_422 can be seen in figure13. The plot of the frequencycontents of the same segments for file n_422 is shown in figure 14. The plot of the normal andfibrillation/fluttering segments for file n_424 can be seen in figure15. The frequency contents forthe same segments of file n_424 are shown in figure16.

Page 10: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Figure 13. Normal and fibrillation/fluttering segment for file n_422.bin

Figure 14. Frequency contents of Normal and fibrillation/fluttering segment for file n_422.bin

Page 11: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Figure 15. Normal and fibrillation/fluttering segment for file n_424.bin

Figure 16. Frequency contents of Normal and fibrillation/fluttering segment for file n_424.bin

Page 12: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

After analyzing the "normal" and ventricular fibrillation/fluttering signals in the time and frequencydomain, I found the following characteristics in the signals

"Normal" segment

Before continuing, I would like to point out that I consider a Normal signal all the signals that donot have ventricular fibrillation or ventricular fluttering. Having said that, the characteristics are thefollowing

Time domain

The signals could have noise(low or high frequencies) or tachycardia for example, but we are stillable to more or less distinguish the QRS signals. We are still able to say that what we are looking atan electrocardiographic signal.

Frequency domain

The signal seems to have a more or less smooth decaying form. It has no peaks in the frequencydomain that could represent frequencies with high contain of energy. There are no drastic changesin the power distribution of the signal.

Ventricular fibrillation/fluttering segment

Time domain

The signal look like being oscillating. It resembles a sinusoidal waveform. At the same time, thesignal sometimes seems to oscillate more with baseline fluctuations. We can see this in figure 17.

Figure 17. Ventricular arrhythmia which seems to oscillate with baseline fluctuations.

Page 13: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Frequency domain

The signal have a peak located between the frequencies of 3Hz and 6.5Hz. This peak is reallyobvious, indicating that there exist high energy components there. It is really important to mentionthat I was not able to find this peak in normal segments of the signals and that this is the basis of myarrhythmia detector program.

This peak is consistent with the theory seen in class, because in class we saw that ventricularfluttering occurs at frequencies of 3.333Hz and 5Hz (200-300 beats/min) Ventricular fibrillationoccurs at frequencies of 5Hz(sinusoid period of 200mS).

Question 9. Describe your approach to distinguish ventricular arrhythmias from normalrhythms. First, present a quantitative description, explaining the general rationale for themetric. Then give a more quantitative description of the metric, with attention to areas ofuncertainty of variability. Include a block diagram of flowchart of your system ifappropriate. What are the advantages and disadvantages of your metric? Under whatconditions do you expect it to perform well and under what conditions might it fail? Pleaseinclude the matlab code for your ventricular arrhythmia detection as an appendix to your labreport

My approach to detecting the ventricular fibrillation/fluttering is based on the analysis of the signalin the frequency domain and based on the main difference that I found between the normal andfibrillation/fluttering segments.

Remembering the characteristics of the fibrillation/fluttering segments in the frequency domain wehave that the segments have a peak located between the frequencies of 3Hz and 6.5Hz. This peak isreally obvious, indicating that there exist high-energy components there. This peak can be foundusing the spectrum function in matlab which calculates the Power Spectrum Density of the signal(adding the calculation 10*logP).

Since we are interested in detecting the ventricular fibrillation/fluttering in real time, it is necessaryto chop the signal in segments for individual analysis. I decided to chop the original signal insegments of 10 seconds. This means that at most, we are going to need to wait 10 seconds to detectthe ventricular fibrillation/fluttering in real time. I am assuming that a 10 second delay is not longenough to cause the dead of a patient. An example of the chopped signal is shown in figure 18.

It is important to note that when I chop the signal, I chop it in overlapping segments. For example,the first segment goes from 0 to 10 Sec, the second from 5 to 15, the third from 10 to 20 and soforth. The idea in the overlapping segments is the following:

Imagine that for some reason, the frequency components of the ventricular fluttering/fibrillationwere located precisely between the first and second segment. Then, since the frequency componentswere going to be spitted between segment one and segment two, the arrhythmia detector could notbe able to detect the arrhythmia in this part of the signal. Overlapping the segments by half of lengthof the segment (5sec), we warrantee that we are always going to be able to analyze the frequency

Page 14: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

components of all the signal. Figure 19 is illustrating the overlapping chopping of the signal.

Figure 18. Graph showing the step of splitting the signal in chunks of 10 Seconds Overlapping oneanother by half of the period (5 Sec). Just for the first 3 chunks of the total signal.

Figure 19. Illustration of the overlapping of the signal using windows to chop the signal

Once I have chopped the signal in 10 second segments, I use the spectrum function to calculate thepower spectrum density of the signal. Since my detector is based on the existence of the peak in thefrequency domain located between 3 and 6.5 Hz, my detector measures how peaky is the peakcalculating a ration between to areas. In order to do this, the following steps are necessary:

1)._search for the maximum amplitude value between 2.3Hz and 8 Hz (where the peak is moreprobable to exist if the segment has ventricular fibrillation/fluttering).

2)._calculate the area under peak-epsilon and peak+epsilon. Epsilon is an increment founded by

Page 15: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

trial and error. In my detector, this epsilon has a value of 1.5 Hz. We are going to call this areaarea1.

To exemplify this, imagine that the peak was found at F=4Hz. Then, with an epsilon equal to1.5Hz, we are going to calculate the area between 2.5 and 5.5Hz. In order to calculate the area underthis interval, we need to calculate the integral between this interval. Since the data is discrete, theintegral is just the summation of all the values between this interval.

3)._We calculate the area under the interval 2.3Hz and 8Hz. This interval is the original interval atwhich we searched for the maximum value (the peak). We are going to call this area area2.

4)._Once we have the two areas, we calculate the ratio area1/area2. This ratio is always going to beless than one and is going to give us an idea of how peaky the peak is.

5)._Finally, we can find a threshold by trial and error analyzing and plotting our segmented signals(60 plots per signal) which gives the best results in detecting the arrhythmias.

Steps 1, 2 and 3 can be seen in the sketch of figure 20.

Figure 20. Graphical example of the calculations of the areas under the peak of the ventricularfibrillation/fluttering in the frequency domain.

The overall steps that my arrhythmia detector calculates are shown in the block diagram shown infigure 21.

Page 16: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Figure 21. Example of the analysis of the peak in a normal segment of the file n_422.bin

Now that I have explained how my arrhythmia detector works, I am going to show how it analyzesthe segments of the signals by showing analysis for two segments for the N_422.bin and N_424.binfiles. The exaples can be seen in figures 21,22,23 and 24.

Figure 21. Example of the arrhythmia detection in a normal segment of the file n_422.bin. Note that

Page 17: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

the value of the ratio is 0.59 (high because is a segment with tachycardia)

Figure 22. Example of the arrhythmia detection in a segment with ventricular fibrillation of the filen_422.bin. Note that the value of the ratio is 0.66

Figure 23. Example of the arrhythmia detection in a normal segment of the file n_424.bin. Note that

Page 18: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

The value of the ratio is 0.44.

Figure 24 Example of arrhythmia detection in a segment with ventricular fibrillation of the filen_424.bin. Note that the value of the ratio is 0.65

Nothe: the asterisc (*) in figures 21, 22, 23 and 24 means the area1 region (peak-epsilon, peakand peak+epsilon). The green circles means area2 (from 2.3 to 8Hz)

Now that we have seen figures 21, 22, 23, and 24 we can set up the threshold for the ration in myarrhythmia detector. From all the experiments that I ran plotting the frequency and time domain forall the segments from signals stored in files n_422.bin and n_424.bin, my foundings were thefollowing:

Type of signal/segment Treshold for ratioNormal signal 0.30 to 0.59

Ventricular fibrillation/fluttering 0.61 to 0.75Tachycardia 0.53-0.54

Then, since I am interested in only detecting Ventricular fibrillation/fluttering, I set the treshold ofratio to 0.61.

Page 19: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

Results of the detection

Question 10. How well does your detector perform? Include plots and/or other figures andtables to represent the output of your system compared with the expert classification. Doesyour detector produce false alarms? Missed detections. Or both? Under what conditions isyour detector more prone to errors?

First, I would like to point the advantages of using the ration between area1 and area2 as a metricfor detecting Ventricular fibrillation/fluttering. The first and most important characteristic is that thedetector is able to detect the Ventricular fibrillation/fluttering even in the first segment of our signal.Another approaches for detecting arrhythmias involve assuming that the first segment of signal isnormal, and then uses this first segment of the signal to set the a treshold. This approach does notallow to detect the arrhythmia in the first segment and also it never detects the arrhythmia if the firstsegment of the signal already contains arrhythmia (the electrodes were connected to a patientsuffering from arrhythmia since the beginning). This is not a problem at all for my detector, sincethe metric used for the detection the comparison between to areas within the same segment of thesignal being analyzed.

Now, I show the results of running my arrhythmia detector for the files n_422, n_424, n_426 and429. After this, a discussion about the problems of my detector is done.

The output of the detector is a matrix called alarm which list the following information:

First Row Shows “1” (the alarm is on )Second Row The sample number of the beginning of the segmentThird Row The sample number of the last sample of the segment

file n_422.bin “Episode of ventricular fibrillation”alarm =

1 10001 12500 1 11251 13750 1 12501 15000 1 13751 16250 1 15001 17500 1 16251 18750 1 17501 20000 1 18751 21250 1 20001 22500 1 21251 23750 1 22501 25000 1 23751 26250 1 25001 27500 1 26251 28750 1 27501 30000 1 28751 31250 1 30001 32500 1 31251 33750 1 32501 35000 1 33751 36250 1 35001 37500

Page 20: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

1 36251 38750 1 37501 40000 1 38751 41250 1 40001 42500 1 41251 43750 1 42501 45000 1 48751 51250 1 50001 52500 1 52501 55000 1 53751 56250 1 55001 57500 1 56251 58750 1 57501 60000 1 58751 61250 1 62501 65000 1 63751 66250 1 65001 67500 1 66251 68750 1 67501 70000 1 68751 71250 1 70001 72500 1 71251 73750 1 72501 75000

file n_424 “Episode of ventricular fibrillation”alarm =

1 1251 3750 1 2501 5000 1 3751 6250 1 17501 20000 1 26251 28750 1 27501 30000 1 28751 31250 1 30001 32500 1 31251 33750 1 32501 35000 1 33751 36250 1 35001 37500 1 36251 38750 1 37501 40000 1 38751 41250 1 40001 42500 1 41251 43750 1 42501 45000 1 43751 46250 1 45001 47500 1 46251 48750 1 47501 50000 1 48751 51250 1 50001 52500

file n_426 “Ventricular fibrillation and low frequency noise”alarm =

1 25001 27500 1 26251 28750 1 27501 30000 1 40001 42500 1 41251 43750 1 48751 51250 1 61251 63750 1 63751 66250 1 70001 72500

Page 21: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

1 72501 75000

File n_429 “Ventricular flutter (2 episodes) and ventricular tachycardia”alarm =

1 27501 30000 1 62501 65000 1 63751 66250

File n_421 Normal sinus “Normal sinus rhythm with noise”alarm =

1 5001 7500 1 58751 61250

Comparing the results with the atr_n4XX.txt files which are diagnosis of the signals contained inthe files n_4XX.bin done by experts, I can conclude that my alarm detector is not often triggered bynoise. We can see this from the results of running the detector in the file n_421.bin which is just thenormal sinus signal with noise. We can see that in this file, my detector only turned on the alarmtwo times.

We can also see from the results of running the detector in the file n_422, that the detector is oftentriggered by the tachycardia. This can be explained looking at the thresholds found by trial and errorin which the ratio value for the tachycardia is really close to the threshold for the arrhythmias.

Fortunately, the detector almost never missed detections and when it missed detections, the alarmturned on at least one time in the correct segment (segment tagged as arrhythmia by the experts).

Question 11. If you had more time to work in this problem, how would you attempt toimprove the detector?

If I had more time to work in this problem, I would check that when calculating the areas, the rangeof area2 is dynamically relocated, so that the area1 is never touching the limits of area2. I will alsoadd a matching filter. I am sure that using a matching filter could improve the arrhythmia detection.I would improve the detector so that it could also detect tachycardias. This would be more or lesseasy, since I observed ratio values of 0.53-0.54 when the tachycardia is present. I would not onlyanalyze the signal using the matlab spectrum function, but also, a filterbank. Then, I would compareboth approaches to see which one detect better the arrythmia or probably use the filterbank toimprove the arrhythmia detector.

Question 12. What is the most important thing that you learned from the lab exercise?

I learned a very interesting application of signal processing, and the most important thing, an

Page 22: Data acquisition - Massachusetts Institute of Technologyalumni.media.mit.edu/~emunguia/pdf/arithmia detector.pdf · 2016-01-04 · Data acquisition Question 1 Draw a block diagram

application that can save lifes. I learned a lot from matlab, signal processing, the physiology of thehearth and characteristics of the QRS signal.

Question 13. What did you like/dislike the most about this lab exercise?

At the beginning, I was not familiar with matlab. It took me a lot of time and effort to get familiarwith it. Most of the time spent in this lab was looking at the matlab help and looking how thecommands work in the internet