Automatic ECG peak detection with FFT

5 次查看(过去 30 天)
Hi everyone,
I am trying to do an automatiuc detection of Hearth Rate with ECG sample.
I try to use FFT and IFFT, and a FIR filtered to eliminate low frequencies (50Hz) but after, I can't detect peaks of the signal.
I need to find locals maxima of my set of data but I don't know how to do that.
I will be grateful if you can help me with this problem.
load ECG109;
ECG = ECG109;
fresult=fft(ECG);
fresult(1 : round(length(fresult)*5/Fe))=0;
fresult(end - round(length(fresult)*5/Fe) : end)=0;
corrected = real(ifft(fresult)); % IFFT
% Low frequencies filter (50Hz)
Fn = Fe/2;
FIR = fir1(48,[49.7 50.3]/Fn,'stop');
ECG_filtered = filter(FIR,1,corrected);
subplot(2,1,1)
plot(ECG_filtered)
ECG_filtered
peaks = findpeaks(ECG_filtered,'DoubleSided')
  1 个评论
Cris LaPierre
Cris LaPierre 2020-1-9
There's somethign wrong with you mat file. I get the following error when I try to load it.
Error using load
Unable to read MAT-file C:\Users\...\ECG109.mat. Not a binary MAT-file. Try load -ASCII to read as text.

请先登录,再进行评论。

回答(1 个)

Cris LaPierre
Cris LaPierre 2020-1-9
Do you have the Signal Processing Toolbox? If so, look into the findpeaks function.

Community Treasure Hunt

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

Start Hunting!

Translated by