Goals of this activity include the following:
A. Introduce Simulink tools for modeling of ECG signals. Simple to use, yet complex processing behind the scenes.
B. Understand time domain measurements of ECG signals
C. Introduction to frequency domain signal processing and filtering of ECG signals
The first part of this Flash Lab investigated the "Signal Visualization and Measurements in MATLAB" exercise in the DSP Systems Toolbox which illustrates how to visualize and measure signals in the time and frequency domain in MATLAB® using a time scope and spectrum analyzer. Upon executing the MATLAB code, it lead to the creation of the ECG signal seen in the image below. This signal is in the time domain, with 11 peaks of which 8 of them have values for their amplitude listed below the image of the signal. Each of these peaks represents a heartbeat and using the data of the time distance between the peaks of these heartbeats allows for the calculation of the average heart rate of the ECG signal as seen in the image below, the average heart rate of the ECG has been calculated using a period of 60 sec/min it is possible to determine the frequency of heartbeats within that time. The final image below is a DSP diagram which indicates the inputs, filter parameters, and outputs from this exercise.
The second part of this Flash Lab investigated the "Removing High-Frequency Noise from an ECG Signal" exercise in the DSP Systems Toolbox which illustrates how to low pass filter an ECG signal that contains high frequency noise. Running the MATLAB script leads to the creation of two signals in the time scope within the time domain, one which is the noisy signal and another which is the filtered signal. The noisy signal contains the smoothed ECG signal along with high frequency noise; moreover, the signal is filtered using a minimum-order lowpass filter and a minimum-order highpass filter to create the filtered signal. The noisy signal appears to have a number of squiggly lines of signal tightly compacted along the ECG signal while the filtered signal is smooth with only one solid line and no squiggly lines along the signal where noise would have been observed. The outputs running the MATLAB script can be seen in the image below where the noisy signal and filtered signal graphs can be seen. The final image below is a DSP diagram which indicates the inputs, filter parameters, and outputs from this exercise. The DSP diagram of this exercise differs from the DSP diagram of the exercise in part one. The inputs of the first exercise are more specific as a sine wave is created with a fundamental frequency, sampling frequency, and the 100 Hz sine wave is seen over 5 seconds with a one-second white noise interval while the second exercise contains none of those inputs. Additionally, the ECG function is used differently as 2700 samples are created in the first one with an unspecified length while in the second one the length is specified but, the number of samples is not. In terms of filters, both exercises use the Savitzky-Golay filter o smoothen the ECG signal but, in the first exercise it extends the data to contain 11 periods of the signal while in the second the data is not extended and approximately three periods are viewed. Additionally, the second exercise a minimum-order lowpass and minimum-order highpass filter are used to further filter the signal. In terms of outputs, both exercises output an ECG signal; however, in the first one 11 periods of the signal are seen while in the second only three periods are seen. The first exercise outputs only one ECG signal the appears very compacted while the second outputs two ECG signals which show the noisy signal and the filtered signal.