ECG feature extraction

Status
Not open for further replies.

sureka

Newbie level 5
Joined
Dec 16, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
55
Hi,I am doing a project on 'Detection on sleep stages using ecg'. I am in need of matlab code for extracting the time domain and frequency domain parameters for each 1minute segment of an ECG signal.Can anyone help with the code???
Kindly reply to this mail ra.narmathaa92@gmail.com
 

The question seems requiring details. If the signal is decoded, implementation of simple things like RR interval etc should not prove to be difficult. Are you able to get the data in matlab that reproduces the ECG waveform. If so implementation of FFT like algo in Matlab is straight forward as I see.
 
Reactions: sureka

    sureka

    Points: 2
    Helpful Answer Positive Rating
I have learned how to slow my heart rate while staying awake. So I will be able to fool your circuit.

People who do "meditation" might do the same.
 
yes sir..i am able to read the file in matlab which is in .dat format..i downloaded it from physionet..can u help me with the code to detect the RR peaks?
 

Once the data is read, it can be displayed and some threshold can be decided. conventionally 30 to 40% of peak works well. The data is scanned and duration between two consecutive rising "R" peaks serves as RR interval. Alternatively, one keeps scanning the data array to locate two consecutive peaks and the interval between two consecutive peaks is the RR interval. In standard ECG dat files data is sampled at 250 ro 300 Hz so the time can directly be calculated as each point corresponds to 4 or 3.333 ms respectively. Hope this helps resolving RR calculation.
 
thank you sir..i understand the concept..but i am in need of a matlab code to implement this..
 

If you can provide a link to a typical data, may be from physionet, it will make the things move faster. I will try to write a simple crude code to do this.
It would be preferable that the data does not have base line wandering else this will also have to be addressed.

- - - Updated - - -

If you can provide a link to a typical data, may be from physionet, it will make the things move faster. I will try to write a simple crude code to do this.
It would be preferable that the data does not have base line wandering else this will also have to be addressed.
I will take some dummy data and send the code shortly.
 
Reactions: sureka

    sureka

    Points: 2
    Helpful Answer Positive Rating
Here is the matlab code.
The code can be cleaned up, for clarity of actual working explicit stepwise details are retained.
Part of some (real) dummy data from a study is used
It has 800 points, sampling rate is 350Hz, Sampling time is 4 ms (each point corresponds to 4ms).
the plot is shown below. There are three peaks and thus 3 RR intervals. Detailed points can be inspected in the attached zip file using the Excel file with data and plot.



the data file, actual code are also attached in the zip file attached.
Screenshot showing the code and results is shown in the screenshot.


- - - Updated - - -

This one minute data will include only one (PQRS) and RR would by issue, frequency domain is OK but better if you go with a larger time interval to include sizable data.

- - - Updated - - -

I have learned how to slow my heart rate while staying awake. So I will be able to fool your circuit.

People who do "meditation" might do the same.

I am interested to know more about this can some one share more info. I have seen one individual who made his pulse actually stop, I could not understand, but now I feel may be that was not illusion.
 

Attachments

  • ECG_RR1.zip
    13.4 KB · Views: 124
Thank you very much sir..the data which we use is from the apnea ECG database of physionet..for ex:a01..
 

Sureka,
Did you test it does it serve the purpose you are looking for?
 

nice reply sir

- - - Updated - - -

Sir, i have checked the programs ECG_RR2.m file detects the RR peak, but i was unable to figure out the use of ECG_RR1.
 
If you compare them, it is noticed that the ECG_RR1 is the intermediate form of the ECG_RR2.m in final form. The earlier one can be deleted (it should have been) as the whole folder is zipped with all supporting information like Excel files etc.
 
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…