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

Similar documents
6.555 Lab1: The Electrocardiogram

EE 422G - Signals and Systems Laboratory

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

(i) Understanding of the characteristics of linear-phase finite impulse response (FIR) filters

Discrete Fourier Transform (DFT)

Digital Filters IIR (& Their Corresponding Analog Filters) Week Date Lecture Title

Signal Processing Toolbox

Signal Processing for Digitizers

B.Tech III Year II Semester (R13) Regular & Supplementary Examinations May/June 2017 DIGITAL SIGNAL PROCESSING (Common to ECE and EIE)

FFT 1 /n octave analysis wavelet

Electrical & Computer Engineering Technology

Digital Filtering: Realization

THE CITADEL THE MILITARY COLLEGE OF SOUTH CAROLINA. Department of Electrical and Computer Engineering. ELEC 423 Digital Signal Processing

Concordia University. Discrete-Time Signal Processing. Lab Manual (ELEC442) Dr. Wei-Ping Zhu

ME scope Application Note 01 The FFT, Leakage, and Windowing

Chapter 2: Digitization of Sound

Lab 4 Digital Scope and Spectrum Analyzer

LAB #7: Digital Signal Processing

Biosignal filtering and artifact rejection. Biosignal processing I, S Autumn 2017

EE 464 Short-Time Fourier Transform Fall and Spectrogram. Many signals of importance have spectral content that

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

Pre-Lab. Introduction

Changing the sampling rate

Advanced Digital Signal Processing Part 2: Digital Processing of Continuous-Time Signals

Experiment 2 Effects of Filtering

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

Fourier Signal Analysis

Design of FIR Filters

Final Exam Practice Questions for Music 421, with Solutions

Introduction to Wavelet Transform. Chapter 7 Instructor: Hossein Pourghassem

ENGR 210 Lab 12: Sampling and Aliasing

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Noise estimation and power spectrum analysis using different window techniques

Forced Oscillation Detection Fundamentals Fundamentals of Forced Oscillation Detection

Signals. Continuous valued or discrete valued Can the signal take any value or only discrete values?

Moving from continuous- to discrete-time

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

ECEGR Lab #8: Introduction to Simulink

Objectives. Abstract. This PRO Lesson will examine the Fast Fourier Transformation (FFT) as follows:

LABORATORY - FREQUENCY ANALYSIS OF DISCRETE-TIME SIGNALS

INTEGRATED APPROACH TO ECG SIGNAL PROCESSING

Structure of Speech. Physical acoustics Time-domain representation Frequency domain representation Sound shaping

Problem Set 1 (Solutions are due Mon )

Outline. Introduction to Biosignal Processing. Overview of Signals. Measurement Systems. -Filtering -Acquisition Systems (Quantisation and Sampling)

Contents. Introduction 1 1 Suggested Reading 2 2 Equipment and Software Tools 2 3 Experiment 2

Chapter 2 Analog-to-Digital Conversion...

Laboratory Experiment #1 Introduction to Spectral Analysis

Introduction. In the frequency domain, complex signals are separated into their frequency components, and the level at each frequency is displayed

CG401 Advanced Signal Processing. Dr Stuart Lawson Room A330 Tel: January 2003

Advanced Lab LAB 6: Signal Acquisition & Spectrum Analysis Using VirtualBench DSA Equipment: Objectives:

Chapter 4 SPEECH ENHANCEMENT

Introduction. sig. ref. sig

Time and Frequency Domain Windowing of LFM Pulses Mark A. Richards

Islamic University of Gaza. Faculty of Engineering Electrical Engineering Department Spring-2011

Digital Filters FIR and IIR Systems

PART II Practical problems in the spectral analysis of speech signals

LLS - Introduction to Equipment

Amplitude Modulation Effects in Cardiac Signals

NOISE REDUCTION OF 15-LEAD ELECTROCARDIOGRAM SIGNALS USING SIGNAL PROCESSING ALGORITHMS WEI LIU. Bachelor of Science. Tianjin University

Getting Started. MSO/DPO Series Oscilloscopes. Basic Concepts

Sampling and Reconstruction

CS3291: Digital Signal Processing

Final Exam Solutions June 7, 2004

Team proposals are due tomorrow at 6PM Homework 4 is due next thur. Proposal presentations are next mon in 1311EECS.

Signal Processing. Naureen Ghani. December 9, 2017

Understanding Digital Signal Processing

DSP Laboratory (EELE 4110) Lab#10 Finite Impulse Response (FIR) Filters

Modeling and Analysis of Systems Lecture #9 - Frequency Response. Guillaume Drion Academic year

Biosignal filtering and artifact rejection. Biosignal processing, S Autumn 2012

Design of FIR Filter for Efficient Utilization of Speech Signal Akanksha. Raj 1 Arshiyanaz. Khateeb 2 Fakrunnisa.Balaganur 3

SIGNALS AND SYSTEMS LABORATORY 13: Digital Communication

Fourier Transform Pairs

Designing and Implementation of Digital Filter for Power line Interference Suppression

DFT: Discrete Fourier Transform & Linear Signal Processing

Intermediate and Advanced Labs PHY3802L/PHY4822L

UNIT-3. Electronic Measurements & Instrumentation

Laboratory Assignment 1 Sampling Phenomena

ADSP ADSP ADSP ADSP. Advanced Digital Signal Processing (18-792) Spring Fall Semester, Department of Electrical and Computer Engineering

A Finite Impulse Response (FIR) Filtering Technique for Enhancement of Electroencephalographic (EEG) Signal

Signals, sampling & filtering

F I R Filter (Finite Impulse Response)

Fourier Theory & Practice, Part I: Theory (HP Product Note )

EE390 Final Exam Fall Term 2002 Friday, December 13, 2002

Experiment 6: Multirate Signal Processing

Some key functions implemented in the transmitter are modulation, filtering, encoding, and signal transmitting (to be elaborated)

Discrete-Time Signal Processing (DTSP) v14

Journal of Asian Scientific Research SIGNALS SPECTRAL ANALYSIS AND DISTORTION MEASUREMENTS USING AN OSCILLOSCOPE, A CAMERA AND A PC. A. A.

Biomedical Instrumentation B2. Dealing with noise

Precalculations Individual Portion Introductory Lab: Basic Operation of Common Laboratory Instruments

Advanced Digital Signal Processing Part 5: Digital Filters

ALMA Memo 452: Passband Shape Deviation Limits Larry R. D Addario 2003 April 09

University Tunku Abdul Rahman LABORATORY REPORT 1

Signals & Systems for Speech & Hearing. Week 6. Practical spectral analysis. Bandpass filters & filterbanks. Try this out on an old friend

4. Design of Discrete-Time Filters

DIGITAL FILTERS. !! Finite Impulse Response (FIR) !! Infinite Impulse Response (IIR) !! Background. !! Matlab functions AGC DSP AGC DSP

Window Functions And Time-Domain Plotting In HFSS And SIwave

George Mason University ECE 201: Introduction to Signal Analysis

A Lower Transition Width FIR Filter & its Noise Removal Performance on an ECG Signal

Digital Processing of Continuous-Time Signals

Spring 2014 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #2. Filter Analysis, Simulation, and Design

Transcription:

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

signals of noise at 180Hz and 360Hz, these are still introducing noise to our signal. This is because of the aliasing phenomenon. We eliminate most of the noise due to 180 and 360Hz, but the low frequency components of these signals are still adding noise to our sampled signal (I am assuming that 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 of noisy data and examine the frequency content to have an idea of what low and high cutoff frequencies I could use to eliminate as much noise as possible and still be able to conserve as much energy as possible of the original signal. I got this segment from the file called janet.txt. The signals and 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 and frequency 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 its frequency response.

Filter Function Filter design method used fir1 windowing method fir2 Frequency Sampling method firls 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 decide which one was the most suitable for use in this application. The frequency response of the filters can 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 (how similar it is to the ideal filter) and the magnitude of the sidelobes magnitude is the fir1 filter. The filter 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 MATLAB function

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 the bandpass 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 signal using FL = 1Hz can be seen in Figure 5. Frequencies over 3Hz eliminate too much low frequencies that 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

Secondly, I tried playing with the high-cutoff frequency(fh) using values of 80, 50, 40, 30 and 20Hz. My analysis showed that using frequencies over 40 Hz does not really eliminate the high frequency 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 ones for this application.

The specifications of the filter are the following: Filter order 200 Low cutoff frequency (FL) 2.3Hz High cutoff frequency (FH) 30Hz I chose these specifications because these cutoff frequencies eliminate the baseline fluctuations (low frequencies) and at the same time does not eliminate too many high frequencies maintaining the QRS signal sharp enough for clinical diagnosis. These cutoff frequencies also maintain most of the energy in the signal. The filtered signal containing low frequency noise can be seen in figure 9 and the 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.

What filter design technique did you use? Since I used the function fir1 to design the FIR filter, I used the windowing method for designing filters. How well does your actual filter meet the desired specifications as well as any tradeoffs you encountered in the design process? As I mentioned earlier, I tried to find a balance between the low and high cutoff frequencies were able to eliminate as much noise as possible but without distortioning the original QRS signal. I also used a tradeoff between the transition bandpass section of the filter (slope) and the sidelobes magnitude of the frequency response of the filter so that the original QRS signal were not distortioned 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 and after 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. The plots 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 noisy signal after and before the filtering step in the same plot. This can be seen in figure 12.

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 possible to implement an ideal filter with any desired specifications, would you expect to remove all of the noise?) If we were able to implement an ideal filter with any desired specifications, we could not be able to remove all the noise. Consider noise that has low and high frequency components. Imagine that the low frequency components are between 10 and 200Hz and we want to filter a signal between 0.1 and 100Hz. Using a filter between 1 and 100Hz is going to eliminate the high frequency components 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 our signal. 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 ventricular fluttering. Question 7. Explain your choice of parameters (window length, window shape, and FFT length) used with the spectrum function. What is the effective frequency resolution (in Hz) of the spectral analysis that you performed? The parameters that I used with the spectrum signal are the following: Window length 512 Window Shape Hamming FFT length 512 First of all, I chose the hamming window because this shape of window is the one that gives the best tradeoff between frequency and amplitude resolution.

Please remember that the frequency resolution is determined by the window length and shape, and the 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 minimum meaningful length for spectrum analysis. Increasing the FFT length will provide a more closely spaced frequency samples of the underlying DTFT. In general, the DFT (FFT) provides more information about the underlying DTFT when we increase the DFT (FFT) length. I chose the window length accordingly to the following statements: The mainlobe is inversely proportional to the window length. Also remember that a narrower mainlobe produces a better frequency resolution. Thus, we conclude that a desirable characteristic of our window is to be long enough 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 in both, 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 readecg function. Once I had the data of both files in memory, I consulted the files atr_n422.txt and atr_n424.txt (which have an expert evaluation of the QRS signal) so that I could make sure I was going to get one segment of normal QRS signal and one of ventricular fibrillation/fluttering segment for each file. I calculated the spectrum of each segment (10 seconds) and I plotted the segment in the frequency and time domain. The plot of the normal and fibrillation/fluttering segments in the time domain for file n_422 can be seen in figure13. The plot of the frequency contents of the same segments for file n_422 is shown in figure 14. The plot of the normal and fibrillation/fluttering segments for file n_424 can be seen in figure15. The frequency contents for the same segments of file n_424 are shown in figure16.

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

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

After analyzing the "normal" and ventricular fibrillation/fluttering signals in the time and frequency domain, 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 do not have ventricular fibrillation or ventricular fluttering. Having said that, the characteristics are the following Time domain The signals could have noise(low or high frequencies) or tachycardia for example, but we are still able to more or less distinguish the QRS signals. We are still able to say that what we are looking at an electrocardiographic signal. Frequency domain The signal seems to have a more or less smooth decaying form. It has no peaks in the frequency domain that could represent frequencies with high contain of energy. There are no drastic changes in 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, the signal 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.

Frequency domain The signal have a peak located between the frequencies of 3Hz and 6.5Hz. This peak is really obvious, indicating that there exist high energy components there. It is really important to mention that I was not able to find this peak in normal segments of the signals and that this is the basis of my arrhythmia detector program. This peak is consistent with the theory seen in class, because in class we saw that ventricular fluttering occurs at frequencies of 3.333Hz and 5Hz (200-300 beats/min) Ventricular fibrillation occurs at frequencies of 5Hz(sinusoid period of 200mS). Question 9. Describe your approach to distinguish ventricular arrhythmias from normal rhythms. First, present a quantitative description, explaining the general rationale for the metric. Then give a more quantitative description of the metric, with attention to areas of uncertainty of variability. Include a block diagram of flowchart of your system if appropriate. What are the advantages and disadvantages of your metric? Under what conditions do you expect it to perform well and under what conditions might it fail? Please include the matlab code for your ventricular arrhythmia detection as an appendix to your lab report My approach to detecting the ventricular fibrillation/fluttering is based on the analysis of the signal in the frequency domain and based on the main difference that I found between the normal and fibrillation/fluttering segments. Remembering the characteristics of the fibrillation/fluttering segments in the frequency domain we have that the segments have a peak located between the frequencies of 3Hz and 6.5Hz. This peak is really obvious, indicating that there exist high-energy components there. This peak can be found using 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 necessary to chop the signal in segments for individual analysis. I decided to chop the original signal in segments of 10 seconds. This means that at most, we are going to need to wait 10 seconds to detect the ventricular fibrillation/fluttering in real time. I am assuming that a 10 second delay is not long enough 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 so forth. The idea in the overlapping segments is the following: Imagine that for some reason, the frequency components of the ventricular fluttering/fibrillation were located precisely between the first and second segment. Then, since the frequency components were going to be spitted between segment one and segment two, the arrhythmia detector could not be able to detect the arrhythmia in this part of the signal. Overlapping the segments by half of length of the segment (5sec), we warrantee that we are always going to be able to analyze the frequency

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 one another 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 the power spectrum density of the signal. Since my detector is based on the existence of the peak in the frequency domain located between 3 and 6.5 Hz, my detector measures how peaky is the peak calculating 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 more probable 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

trial and error. In my detector, this epsilon has a value of 1.5 Hz. We are going to call this area area1. To exemplify this, imagine that the peak was found at F=4Hz. Then, with an epsilon equal to 1.5Hz, we are going to calculate the area between 2.5 and 5.5Hz. In order to calculate the area under this interval, we need to calculate the integral between this interval. Since the data is discrete, the integral 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 at which 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 be less 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 ventricular fibrillation/fluttering in the frequency domain. The overall steps that my arrhythmia detector calculates are shown in the block diagram shown in figure 21.

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 analyzes the segments of the signals by showing analysis for two segments for the N_422.bin and N_424.bin files. 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

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 file n_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

The value of the ratio is 0.44. Figure 24 Example of arrhythmia detection in a segment with ventricular fibrillation of the file n_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, peak and 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 my arrhythmia detector. From all the experiments that I ran plotting the frequency and time domain for all the segments from signals stored in files n_422.bin and n_424.bin, my foundings were the following: Type of signal/segment Treshold for ratio Normal signal 0.30 to 0.59 Ventricular fibrillation/fluttering 0.61 to 0.75 Tachycardia 0.53-0.54 Then, since I am interested in only detecting Ventricular fibrillation/fluttering, I set the treshold of ratio to 0.61.

Results of the detection Question 10. How well does your detector perform? Include plots and/or other figures and tables to represent the output of your system compared with the expert classification. Does your detector produce false alarms? Missed detections. Or both? Under what conditions is your detector more prone to errors? First, I would like to point the advantages of using the ration between area1 and area2 as a metric for detecting Ventricular fibrillation/fluttering. The first and most important characteristic is that the detector 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 is normal, and then uses this first segment of the signal to set the a treshold. This approach does not allow to detect the arrhythmia in the first segment and also it never detects the arrhythmia if the first segment of the signal already contains arrhythmia (the electrodes were connected to a patient suffering from arrhythmia since the beginning). This is not a problem at all for my detector, since the metric used for the detection the comparison between to areas within the same segment of the signal being analyzed. Now, I show the results of running my arrhythmia detector for the files n_422, n_424, n_426 and 429. 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 segment Third 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

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

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 in the files n_4xx.bin done by experts, I can conclude that my alarm detector is not often triggered by noise. We can see this from the results of running the detector in the file n_421.bin which is just the normal sinus signal with noise. We can see that in this file, my detector only turned on the alarm two times. We can also see from the results of running the detector in the file n_422, that the detector is often triggered by the tachycardia. This can be explained looking at the thresholds found by trial and error in 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 alarm turned 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 to improve the detector? If I had more time to work in this problem, I would check that when calculating the areas, the range of area2 is dynamically relocated, so that the area1 is never touching the limits of area2. I will also add 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 less easy, since I observed ratio values of 0.53-0.54 when the tachycardia is present. I would not only analyze the signal using the matlab spectrum function, but also, a filterbank. Then, I would compare both approaches to see which one detect better the arrythmia or probably use the filterbank to improve 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

application that can save lifes. I learned a lot from matlab, signal processing, the physiology of the hearth 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 familiar with it. Most of the time spent in this lab was looking at the matlab help and looking how the commands work in the internet