How do I omit a range of points from line?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
% MATLAB Code
function [dMean, dMax, dMin] = EMGFilter6(EMG)
EMG_2 = EMG;
t = EMG_2(:,1); % time
x = EMG_2(:,2); % signal
d = abs(x);
windowSize = 1000;
b = (1/windowSize)*ones(1,windowSize);
a = 1;
dMean = mean(d);
dMax = max(d);
dMin = min(d);
j = 0.01*dMean;
p = 'concussion';
l = 'no concussion';
y = filter(b,a,d);
for k = i:y
plot(t,d,'color','r')
hold on
plot(t,y,'color','b')
legend('Input Data','Filtered Data')
end
for g = i:y
if g>j
disp(l)
elseif g<j
disp(p)
elseif g == j
disp(l)
end
end
end
% Hello, I'm given a data set of EMG signals. I created a running average mean line for the signal defined by variable "y". I want to omit a range of points from the beginning of the average mean line y so that my running average mean line doesn't start at zero.
0 comentarios
Respuestas (1)
Voss
el 30 de Mzo. de 2022
I'm not sure if this is what you want, but here's how you can remove data before t = 1, for instance:
S = load('data.mat');
EMGFilter6(S.Trial1);
function [dMean, dMax, dMin] = EMGFilter6(EMG)
EMG_2 = EMG;
t = EMG_2(:,1); % time
x = EMG_2(:,2); % signal
% remove t and x before t = 1:
idx_to_remove = t < 1;
t(idx_to_remove) = [];
x(idx_to_remove) = [];
d = abs(x);
windowSize = 1000;
b = (1/windowSize)*ones(1,windowSize);
a = 1;
dMean = mean(d);
dMax = max(d);
dMin = min(d);
% j = 0.01*dMean;
% p = 'concussion';
% l = 'no concussion';
y = filter(b,a,d);
% for k = i:y
% plot(t,d,'color','r')
plot(EMG_2(:,1),abs(EMG_2(:,2)),'r') % plot the entire data
hold on
plot(t,y,'color','b')
legend('Input Data','Filtered Data')
% end
% for g = i:y
% if g>j
% disp(l)
% elseif g<j
% disp(p)
% elseif g == j
% disp(l)
% end
% end
end
1 comentario
Ver también
Categorías
Más información sobre Spectral Measurements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
