RMS-EMG calculate and plot

37 ビュー (過去 30 日間)
barbara falconi
barbara falconi 2021 年 3 月 25 日
編集済み: barbara falconi 2021 年 3 月 26 日
I have to plot the RMS graph over time of the signal related to the left anterior tibial muscle, I calculated the value with the matlab 'rms' command but I only get a value and not a vector to plot. I need the matlab code.

採用された回答

Star Strider
Star Strider 2021 年 3 月 25 日
The RMS value needs to be calculated for a vector. Since the RMS =s the square root of the mean of the squared values of that vector, one option is to use the movmean function to create a moving estimate of the RMS value.
Try this:
t = linspace(0, 10, 1000); % Time Vector
v = 1.2+sin(2*pi*t*100)+randn(1,1000)*0.1; % EMG Vector
WinLen = 10; % Window Length For RMS Calculation
rmsv = sqrt(movmean(v.^2, 10)); % RMS Value Over ‘WinLen’ Samples
figure
plot(t, v)
hold on
plot(t, rmsv, '-r', 'LineWidth',1.5)
hold off
grid
legend('EMG',sprintf('RMS (Window Length = %d)',WinLen), 'Location','best')
Experiment to get the result you want.
  6 件のコメント
barbara falconi
barbara falconi 2021 年 3 月 26 日
ok,thank you
Star Strider
Star Strider 2021 年 3 月 26 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by