Calculate area from a signal

5 ビュー (過去 30 日間)
Julio Martín
Julio Martín 2022 年 2 月 10 日
編集済み: Julio Martín 2022 年 2 月 13 日
Hi, would like to calculate area from this emg signal
There are three different channels. I've done RMS and snap the exact tiem I need to analyse but don't know how to calculate total area
My code is:
for c=2:2
A=strcat('S1_',num2str(c));
B=strcat(A,'.emt');
D=importdata(B,'\t',12);
[F, C]=size(D.data);
x=filter(Filtro_emg,D.data);
centro=(F-mod(F,2))/2;
x=x(((centro-4000)+242:(centro-4000)+3026),:);
RMS = Rms_emg (x,100)*1000;
S=smoothdata(RMS);
plot(S);
for b=3:5
Areatotal(b,c)=sum(S(:,b)); I've tried with this, but don't know if it's correct
Media(b,c)=mean(S(:,b));
Maximo(b,c)=max(S(:,b));
end
end
Please help, thanks!

採用された回答

AndresVar
AndresVar 2022 年 2 月 10 日
編集済み: AndresVar 2022 年 2 月 10 日
area = trapz(x,y) % i think for you trapz(S(:,b)) or just trapz(S(:,b)) if dx = 1
sum also works so you can compare your result. You must multiply the sum by dx, but it looks like dx=1 in your case.
  3 件のコメント
AndresVar
AndresVar 2022 年 2 月 12 日
編集済み: AndresVar 2022 年 2 月 12 日
for integral signal use 'cumtrapz' or 'cumsum'
btw beware of units when integrating and finding area. make sure its what you expected. dx is 1 but if you want to integrate with respect to time you need to find what is dt.
Julio Martín
Julio Martín 2022 年 2 月 13 日
編集済み: Julio Martín 2022 年 2 月 13 日
Thank you. Exactly I have doubs about the result
With this code
for c=2:2
A=strcat('S1_',num2str(c));
B=strcat(A,'.emt');
D=importdata(B,'\t',12);
[F, C]=size(D.data);
x=filter(Filtro_emg,D.data);
centro=(F-mod(F,2))/2;
x=x((centro-4000)+133:(centro-4000)+483,:);
RMS = Rms_emg (x,100)*1000;
S=smoothdata(RMS);
figure
for b=3:3
plot(S(:,b));title('Tibial anterior');grid;xlabel('Tiempo mseg');ylabel('uV');
AreaGM1=sum(S(:,b));
end
end
I have a result of 42756.251 uV (I supose it's impossible in a time of 350 miliseconds). If x is time in miliseconds, how could I calculate it?
Thank you so much

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by