Hi,
I am trying to send ECG datd to ThingSpeak, however, at one sample per 15seconds it is rather useless when I have 650k samples.
What I want to do is send a certain amount of samples before and after each R peak (I am usung find peaks to locate R-peaks after filtering the data). That way I can reduce the amount of samples sent and get more ECG signals inside the graph.
Can anyone advise?
PS - Patient 101 is data from MIT database.
Thank you in advance!
Gabriel N. Nicolau
My current code is below:
% clc
% clear all
% close all
%load ( 'patient100.csv');
dat=csvread('patient100.csv');
figure;
subplot(4,1,1)
plot(dat)
findpeaks(dat,'MinPeakHeight',0.5,'MinPeakDistance',200);
title('Original')
x=lowpass(dat,15,360);
y=highpass(x,10,360);
subplot(4,1,2)
plot(x)
findpeaks(x,'MinPeakHeight',0.5,'MinPeakDistance',200);
title('Low-Pass')
subplot(4,1,3)
plot(y)
findpeaks(y,'MinPeakHeight',0.3,'MinPeakDistance',200);
title('High-Pass')
y_diff=diff(y);
y_abs = y_diff.^2;
subplot(4,1,4)
plot(y_abs);
%for i=1: 1/length(dat)*100000: length(dat)*10000+ 1/length(dat)*100000;
%t=dat(dat(i)>dat(i+1));
%end
yy = y';
%%% DATA TO BE SENT TO THINGSPEAK CHANNEL
a = yy;
b = 0;
c = 650000;
x = [a];
chId = 622307;
writeKey = 'XXXYYYZZZ';
tOut = 99999999;
% tStamps = [datetime('now')-minutes(899):minutes(1):datetime('now')]';
for i = 1:c
pause(15)
b = x(i)
thingSpeakWrite(chId,[b],'WriteKey',writeKey)
end

댓글 수: 1

ekta yadav
ekta yadav 2021년 11월 20일
Hi I am working on the same thing but stuck on few things.
  1. Can you tell me how did you calculated number of samples of MIT database.
  2. How u sent numeric values of heart beat.
Thanks in advance.

댓글을 달려면 로그인하십시오.

 채택된 답변

GABRIEL NICOLAU
GABRIEL NICOLAU 2018년 11월 17일
편집: GABRIEL NICOLAU 2018년 11월 18일

0 개 추천

I have resolved the issue.
Thank you.

댓글 수: 2

Ali Usman
Ali Usman 2019년 1월 15일
Can you please share the details that how you resolved the issue..?
GABRIEL NICOLAU
GABRIEL NICOLAU 2019년 1월 15일
yes. unless you pay to have an account you will not be able to send the data faster than at 15 sec intervals
i resolved the issue by calculating the current heart rate and sending the numerical value (ie 60BPM) every 15 seconds
this was done by analysing the R peaks at 15second intervals
gabriel.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

도움말 센터File Exchange에서 ThingSpeak에 대해 자세히 알아보기

질문:

2018년 11월 16일

댓글:

2021년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by