Difference between resampling and interpolation for downsampling RR-Interval?
62 views (last 30 days)
Show older comments
Hello, I want to perform heart rate variability for sleep stages detection,for that i have RR-interval data. I read in the papers that you need to interpolate the RR-interval data with 4Hz (original sampling frequency= 256 HZ). before spectrum analysis. The area of interest of frequency is within 0-1 HZ. Please can some one explain it to me that is interpolation or resampling a correct method for that purpose. If we resample or interpolate the data, does it remove the data points? Does the new interpolated data a good representative of the original data? What are the difference between these two?
0 Comments
Answers (1)
Star Strider
on 2 Sep 2016
I would like to see that paper. I would be genuinely surprised if that is what they wrote.
The difference between interpolation (the interp1 function) and resampling (the resample function) in MATLAB is that resample is designed to resample signals, and so incorporates a FIR anti-aliasing filter. The interp1 function does not, so if you are going to do signal processing with an interpolated signal use resample, not interp1. (By the same token, if you want to do a straightforward interpolation and use resample, the results would not be what you want.)
With a 4 Hz sampling frequency you lose all the detail. If you want to look at a 4 Hz and lower part of your EKG signal, use a lowpass or bandpass filter with an upper frequency cutoff of 4 Hz. (I recommend a bandpass filter with a 0.5 Hz low-frequency cutoff to eliminate d-c offset and low-frequency baseline drift.)
There are several ways to design filters in MATLAB, so consider designfilt. I usually design my own.
See if this filter design will do what you want:
Fs = 256; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
Wp = [1.2 4.0]/Fn; % Filter Passband (Normalised)
Ws = [0.1 5.0]/Fn; % Filter Stopband (Normalised)
Rp = 30; % Passband Ripple (dB)
Rs = 50; % Stopband Ripple (dB)
[n,Wn] = cheb2ord(Wp, Ws, Rp, Rs); % Chebyshev Type II Filter Order
[b,a] = cheby2(n,Rs,Ws); % Chebyshev Type II Transfer Function Coefficients
[sos,g] = tf2sos(b,a); % Second-Order-Section For Stability
figure(1)
freqz(sos, 8192, Fs) % Filter Passband Bode Plot
1 Comment
Michael Pavel
on 27 May 2020
Researchers analazing heart rate variability are typically interested in the frequency content of the R-R interval sequences in the range under 0.5 Hz. So it may not be unreasonable to downsample to 4 Hz. The reason for the raw data sampling frequency of 250 Hz is to locate with a sufficient accuracy the peaks of the R waves.
See Also
Categories
Find more on Multirate Signal Processing 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!