I have been trying to get realtime ecg data from arduino using matlab.

I am able to visualise the real time data using this code.

Here the issue is I cannot get the filtered output at the same time as I am not aware of the fs.

Would like to know how we can process the signal realtime and plot the output.

I am attaching the result I am getting with this code (0 to 200)

The output is taken from arduino pin A0

clear

clc

close all

%get some user settings

%ledPin = 'D13'; %For blinking the led we should access this pin

%deltaT_blink = 0.5;

port = 'COM5';

board = 'Uno';

a = arduino(port,board); % we are creating an arduino object with this specific board and this specific port

%write a small for loop that flashes the LED on and off

% for k = 1:20

% %turn the arduino LED on

% a.writeDigitalPin(ledPin,1);

% pause(deltaT_blink*5);

% %turn the arduino LED off

% a.writeDigitalPin(ledPin,0);

% pause(deltaT_blink*2);

%

% end

init_time = 1;

x =0;

s=0;

f = 0;

tic

while(init_time

More Krishnapriya G B's questions See All
Similar questions and discussions