フィルターのクリア

How to design multirate filter system for EMG signals

2 ビュー (過去 30 日間)
Dulanjana Perera
Dulanjana Perera 2020 年 9 月 1 日
編集済み: Dulanjana Perera 2020 年 9 月 7 日
I am using Delsys Bagnoli EMG System to acquire sEMG from forearm muscles. When I use Delsys EMGworks application, output signals are clean as expected with minor interferences. However, when I use the following Matlab script to acquire the signal unusual signal pattern occured (spikes).
the image of frequency domain of the Data (Red color frequencies contains EMG information) acquired from Matlab script is attached herewith.
I want to know why this happens and how to remove thoses spikes
the Matlab script:
%% 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
  1 件のコメント
Dulanjana Perera
Dulanjana Perera 2020 年 9 月 7 日
I realized that the pause we provide to the code to acquire EMG data should be equal to the
emg.NotifyWhenDataAvailableExceeds / emg.Rate
which means 400/ 4000 = 0.1 not 0.01
Otherwise this multirate signal sampling happens.
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

サインインしてコメントする。

採用された回答

Dulanjana Perera
Dulanjana Perera 2020 年 9 月 7 日
編集済み: Dulanjana Perera 2020 年 9 月 7 日
I realized that the pause we provide to the code to acquire EMG data should be equal to the,
emg.NotifyWhenDataAvailableExceeds / emg.Rate
which means 400/ 4000 = 0.1 not 0.01
Otherwise this multirate signal sampling happens.
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
Since this mismatch, a spike occurred at every 10th (0.1 / 0.01) frequency in the frequency domain.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by