change in frequency domain with resampling

19 visualizzazioni (ultimi 30 giorni)
FSK
FSK il 27 Ott 2020
Modificato: FSK il 30 Ott 2020
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.
  2 Commenti
Star Strider
Star Strider il 28 Ott 2020
The Signal Processing Toolbox resample funciton is best for signal processing applications. It has an anti-aliasing filter.
I have no idea how you calculated your fft for each signal, however it will be necessary to compute a different frequency vector for the plot for the fft results for the original and resampled signals.
I would not recommend resampling from 62 Hz to 500 Hz. It simply makes no sense. It creates data that are not in the original signal. The Nyquist frequency for your original data will be 31 Hz. That is not enough to see all the necessary features in a normal EKG, and unless you use a Bessel lowpass filter with a cutoff frrequency of 31 Hz at the filter input, much of the information (as well as 50 Hz or 60 Hz mains frequency noise) will be aliased into the recording and impossible to remove by filtering, or see in your signal.
Repeat your study with a sampling frequency of at least 250 Hz and a Bessel anti-aliasing filter with a cutoff of 125 Hz and you will have reliable data. You will not need to resample that signal, and if you use an appropriate reference electrode (usually the right leg electrode) you can avoid environmental noise and mains frequency interference.
FSK
FSK il 28 Ott 2020
Thank you for your valuable input. Actually retaking the readings is not an option currently. So I have to make the best of what I have. In the next phase of experiments I will def keep in mind the pointer you have described.
What do you mean when you say 'different frequency vector for the plot for the fft'?
I calculated fft for both resampled and original signal in the follpowing manner:
FTsr = fft(x-mean(x))/L;
% Fourier Transform Of Mean-Corrected Signal. x is the signal vector and L is the length of t vector
Fv = linspace(0, 1, fix(L/2)+1)*Fnr; % Fnr is nyquist frequency
Iv = 1:numel(Fv);
figure
plot(Fv, abs(FTsr(Iv))*2) %frequency vs (plot(x,y))
title('Before Filteration[Dataset1]')
xlabel('Frequency [Hz]');
ylabel('Amplitude [mV]');
I am not sure why the plots are different after and before resampling.

Accedi per commentare.

Risposta accettata

Ayush Bansal
Ayush Bansal il 30 Ott 2020
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.
  1 Commento
FSK
FSK il 30 Ott 2020
Modificato: FSK il 30 Ott 2020
Thank you for the answer.
Using interp() solved the issue. Apparently, the anti alliasing filter in resample caused much change in the fft.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by