Question: A. Using C++ language, implement the QRS detection algorithm FS1 (picture below) with the following modification: - Divide the ECG signal (mV) by the sampling

A. Using C++ language, implement the QRS detection algorithm FS1 (picture below)

A. Using C++ language, implement the QRS detection algorithm FS1 (picture below)

with the following modification: - Divide the ECG signal (mV) by the

with the following modification: - Divide the ECG signal (mV) by the sampling frequency (fs = 250 Hz). - Since the first and second derivatives of a signal are sensitive to high frequency noise, smooth the ECG signal, X[n], using the following 3-point moving average filter (Hanning filter) prior to differentiation. sampling frequency (fs = 250 Hz). - Since the first and second - Include a blanking period of 0.1 second. - Hence, for the protocol:

-i. Divide the original ECG signal by the sampling frequency, fs = 250 Hz.

-ii. Smooth the scaled ECG signal X[n] using the above Hanning filter.

-iii. Obtain the absolute values of the first and second derivatives of the smoothed ECG signal using the FS1 algorithm, where X in the two equations is the smoothed ECG signal.

-iv. Obtain Y2[n], the scaled sum of the absolute values of the first and second derivatives, as described in the FS1 algorithm

-v. QRS peak is detected at time ti if:

1. Y2[i] threshold = 1.0, and

2. at least 6 of the next 8 points meet or exceed this threshold.

-vi. Once a QRS is detected, apply a blanking period of 0.1 second (i.e., skip searching for QRS for the next 0.1 second).

B. The main program should: - Prompt the user to enter the file name, check if file exists, and if so read in data from the file.

- the file is a .txt file and has two columns separated by spaces

- the first column is time in scientific notation

- the second column is the ECG signal in scientific notation

-here is a screenshot of what the file looks like:

derivatives of a signal are sensitive to high frequency noise, smooth the - Make use of the EXIT statement to terminate the program if the file does not exist, and EOF statement to test for an end-of-file condition and to automatically determine the number of data points in each column. - Make use of dynamic memory allocation. - For a given data file, write to an output file (with appropriate messages and units) the number and locations (times in sec) of QRS detected, and the average heart rate (in beats per minute)

I) FSI: This algorithm is a simplification of the QRS detection scheme presented by Balda [9]. The absolute values of the first and second derivative are calculated from the ECG: YO(n) = ABS(x(n + 1)-X(n-1)] 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!