How can I increase sampling rate of PPG data using spline interpolation?

19 views (last 30 days)
I have PPG (heart-rate) data that was collected using a sampling rate of 100 Hz. Before performing any analyses, I need to re-sample the data to 300 Hz using cubic spline interpolation.
The data are saved in text files in column vector format. The file I am working with now is saved as PPG001 and has been imported into my workspace.
I was able to successfully increase the sampling rate to 300 with the following code:
x = PPG001;
p = 3;
q = 1;
y = resample(x,p,q);
Because linear interpolation is set as the default, how do I add a 'spline' function to ensure that the resample function uses cubic spline interpolation?
I tried this, unsuccessfully:
x = PPG001;
t = 1:39811;
fs = 100;
p = 3
q = 1
y = resample(x,t,fs,p,q,'spline');
This is the error message I get:
Error using resample Too many input arguments.
Error in Untitled4 (line 7) y = resample(x,t,fs,3,1,'spline');
Thanks, in advance, for your help!

Accepted Answer

Star Strider
Star Strider on 11 Aug 2015
I would not resample raw EKG signals with anything other than linear interpolation. To do so risks obscuring or distorting small-amplitude deflections such as Q-waves and S-waves, and creating artefacts in the R-waves and ST-segments.
If your data are simply rates and not raw EKG, and you want to do a spline interpolation, I would use the interp1 function specifying the 'spline' method. One possibility:
x = PPG001;
t = 1:39811;
fs = 100;
t_interp = linspace(min(t), max(t), 3*length(t));
x_interp = interp1(t, x, t_interp, 'spline');
The ‘x_interp’ data should be what you want. To plot the interpolated data, use both vectors:
plot(t_interp, x_interp)
NOTE: Since I don’t have your data, this is untested code.
  2 Comments
William McCuddy
William McCuddy on 11 Aug 2015
Thanks star-strider!
I am interested in looking at heart-rate variability with photoplethysmography (PPG), so I really just need to be able to accurately detect peaks in the signal that correspond to heart-beats. The papers I have read state that sampling rates of at least 250 Hz are most ideal. One paper in particular stated that data collected at 100 Hz would be acceptable if a parabolic interpolation is used to refine the R-wave fiducial point (<http://circ.ahajournals.org/content/93/5/1043.long).
This is a sort of rouge project of mine, which I am very interested in discussing. This project differs widely from my lab mates and department colleagues, so I am open to pretty much any constructive criticism I can get.
The next step will be to write the interpolated data to a text file and then create a loop to perform the same action on multiple directories and sub-directories.
Star Strider
Star Strider on 11 Aug 2015
My pleasure.
I remember that paper from a while back, when I was interested in HRV, primarily in assessing diabetic autonomic neuropathy. (My interest in photoplethysmography was primarily in using the waveform for assessment of arterial compliance, so I attempted to use the waveforms to estimate the parameters of an arterial model. That actually requires simultaneously recording two waveforms at different distances from the heart, something that my computer with MATLAB could not then do. I haven’t revisited the issue in the past five years.)
The important thing to consider is that the paper uses EKG and ‘NN’ intervals (normal-normal, defined as a QRS complex preceded by a normal P-wave) for its analyses. Photoplethysmography does not give you the EKG information, so it would be confounded by atrial flutter or fibrillation, or ectopic QRS complexes. There is likely nothing in the waveform that would allow you to distinguish normal from abnormal ventricular excitations.
With respect to sampling frequency, the 250 Hz or higher sampling frequency definitely applies to EKG recordings, but for photoplethysmographic recordings, 100 Hz is likely sufficient. It is important to be able to distinguish the dicrotic notch, the beginning and end of the systolic waveform, and the exponential decay between the end of the dicrotic notch and the beginning of the next systole.
So I would not use photoplethysmography for HRV, since it does not give you sufficient information to distinguish normal from abnormal ventricular contractions.
However, it would be extremely valuable for assessing vascular compliance, likely as important in assessing cardiovascular health as HRV, only different. One survey article is ‘Methods and Devices for Measuring Arterial Compliance in Humans’ AHJ 2002; 15:743–753. A thorough PubMed search would likely provide you with additional resources. The only problem with it (with respect to MATLAB, at least without the Data Acquisition Toolbox that I don’t have) remains the problem of collecting waveforms simultaneously from two separate photoplethysmogram sensors, or an EKG and two sensors.
I apologise for ‘raining on your parade’ with respect to using photoplethysmography for HRV studies. However the concerns I raised would be the same as a reviewer or your faculty adviser would raise, so I feel it appropriate to raise them now.
I instead encourage you to use it to investigate arterial compliance, especially if you can develop a novel and computationally efficient method to do so. I would set as a goal making it suitable for screening studies in outpatients, that would ideally make it as easy as current blood pressure screening. Considering that it is done routinely along with blood pressure screening, a way to use blood pressure and a measure of arterial compliance together to create a new clinical indicator of vascular health could add significant value to the combined information.

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 11 Aug 2015
See my attached spline demo. Adapt as needed.

Categories

Find more on ECG / EKG in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!