Since this mismatch, a spike occurred at every 10th (0.1 / 0.01) frequency in the frequency domain.
%% EMG initialize raw = zeros(1,6); % EMG setup emg = daq.createSession('ni'); ch1 = addAnalogInputChannel(emg, 'Dev1', 0, 'Voltage'); ch2 = addAnalogInputChannel(emg, 'Dev1', 1, 'Voltage'); ch3 = addAnalogInputChannel(emg, 'Dev1', 2, 'Voltage'); ch4 = addAnalogInputChannel(emg, 'Dev1', 3, 'Voltage'); ch5 = addAnalogInputChannel(emg, 'Dev1', 4, 'Voltage'); ch6 = addAnalogInputChannel(emg, 'Dev1', 5, 'Voltage'); emg.Rate = 4000; % sampling rate lh = emg.addlistener('DataAvailable',@stopWhenExceed); emg.NotifyWhenDataAvailableExceeds = 400; % data per one feature set (total of all channels) emg.IsContinuous = true; emg.startBackground(); while 1 % check the existing time.mat file time(end + 1 : end + 1, 1) = str2double(datestr(now,'SS.FFF')); pause(0.01); % this pause should be there to acquire EMG data if (getGlobalSx==0) % if new set of data is available data = getGlobalx; % aquire data setGlobalSx(1); end raw(end +1:end+400, : ) = data; end
I realized that the pause we provide to the code to acquire EMG data should be equal to the,
emg.NotifyWhenDataAvailableExceeds / emg.Rate
while 1 % check the existing time.mat file time(end + 1 : end + 1, 1) = str2double(datestr(now,'SS.FFF')); % ---------------------This value should be 0.1.------------------------------- pause(0.1); % this pause should be there to acquire EMG data if (getGlobalSx==0) % if new set of data is available data = getGlobalx; % aquire data setGlobalSx(1); end raw(end +1:end+400, : ) = data; end
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.