- #1
Mo_Tuk
- 28
- 8
Hello
I'm working on project for "design & implementation of EMG data acquisition"
for now I completed the design and connected the output of the system to arduino uno to read the emg signal in real time with MATLAB 2017b using arduino support package.
the problem is that the signal looks as its sampled in wrong way although when i used oscilloscope the signal was very good so this means the hardware is working fine, is this problem could be related to ADC of the arduino or the communication between arduino and matlab??
the attached image shows the plot of the signal in matlab.
any suggestion...
matlab code:
I'm working on project for "design & implementation of EMG data acquisition"
for now I completed the design and connected the output of the system to arduino uno to read the emg signal in real time with MATLAB 2017b using arduino support package.
the problem is that the signal looks as its sampled in wrong way although when i used oscilloscope the signal was very good so this means the hardware is working fine, is this problem could be related to ADC of the arduino or the communication between arduino and matlab??
the attached image shows the plot of the signal in matlab.
any suggestion...
matlab code:
Matlab:
a = arduino('COM3', 'UNO');
configurePin(a, 'A0', 'AnalogInput');
total_sample = 400;
for sample_no = 1:total_sample
data(sample_no)= readVoltage(a, 'A0');
end
%% Plot EMG Signal vs Sample Number
%Figure caption
figure();
grid ON;
plot(data)
hold on;
plot(data, 'ro')
title('Plot of EMG Signal'); xlabel('Sample Number'); ylabel('Amplitude (V)');
% Rectification of the EMG signal
data = data - 2.635; % to shift down an emg signal
rec_data = abs(data);
figure();
plot(rec_data)
title('Rectified EMG'); xlabel('Sample Number'); ylabel('Amplitude (V)');
Attachments
Last edited by a moderator: