the amount of time between the onset of the tone and the onset of muscle contraction in EMG signal
1 view (last 30 days)
Show older comments
Hey, I have an EMG signal data and i need to determine the amount of time between the onset of the tone and the onset of muscle contraction. I am thinking of using a voltage threshold function to determine when the tone was played and breaks the EMG recorded signal (filtered and half-wave rectified) into epochs when the bicep contracted for each stimulus trial, but i am not sure how to acheive it.
I have this code as a start:
clear all;
Exp1 = load('EMG1.mat'); %load file
Fs = 10000; %sampling rate
Duration = 1.5; %Duration of each epoch
DurSamps = Duration*Fs; %Duration in samples
Reps = 14; %number of epochs
%define blank matrices
Tones(1:Reps,1:DurSamps)=0; EMGRaw(1:Reps,1:DurSamps)=0; EMGFilt(1:Reps,1:DurSamps)=0; EMGFiltRect(1:Reps,1:DurSamps)=0;
%read data from structure
for Rep=1:Reps
Tones(Rep,:) = Exp1.data(Exp1.datastart(1,Rep):Exp1.dataend(1,Rep)); EMGRaw(Rep,:) = Exp1.data(Exp1.datastart(2,Rep):Exp1.dataend(2,Rep)); EMGFilt(Rep,:) = Exp1.data(Exp1.datastart(3,Rep):Exp1.dataend(3,Rep));
end
for i=1:Reps
for j=1:DurSamps
EMGFiltRect(i,j)=EMGFilt(i,j).^2; %half-wave rectification
end
end
0 Comments
Answers (0)
See Also
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!