Automatic ECG peak detection with FFT
Show older comments
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 Comment
Cris LaPierre
on 9 Jan 2020
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.
Answers (1)
Cris LaPierre
on 9 Jan 2020
0 votes
Categories
Find more on Digital Filter Analysis 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!