MATLAB: Change in frequency domain with resampling

ecgfrequency domaininterpolationresample

I have resampled my ECG data from 62 Hz to 500 Hz. But there seems to be a lot of difference before and after resampling in the frequency amplitude diagram (please see attached figures). The frequency content should be preserved in resampling. I presume the issue is with the time vector. I donot have the original time vector. I only have the number of samples and sampling frequency. I am creating a new time vector using following method:
samT=length(sr)/500; %length of the signal divided by new resampled frequency
tl = linspace(0,samT,500);
sf = 1/(tl(2)-tl(1));
t = (0:length(tl)-1)/sf;
Also out of interp1 and resample which one would be better in this situation?
Any lead would be appreciated.

Best Answer

interp1 have different options to choose from but resample has anti-aliasing filter.
Frequency vector will be different for both the ffts and can be calculated by
F=(0:L/2)*fs/L where L is the length of fft output and fs is the sampling frequency of the signal.
Check the MATLAB script for reference.
Related Question