How to find are under the curve for a random signal.
7 次查看(过去 30 天)
显示 更早的评论
I have this random signal, is it possible that I find the are under the curve ?
Thanks for any help provided.
0 个评论
采纳的回答
Kaushik Lakshminarasimhan
2017-11-8
If samples are all uniformly spaced in time, you just need to take the sum of all elements.
area_under_signal = sum(my_signal)
Note that this number will be proportional, but not exactly equal to the actual area. If you need the exact number, you need to multiply by the temporal resolution of your signal, dt.
area_under_signal = sum(my_signal)*dt
2 个评论
Kaushik Lakshminarasimhan
2017-11-10
Of course, you need to define it before using. You should know the temporal resolution of your signal (how frequently you sample the signal). For example, if you have a vector of time points t at which you store your EMG signal x, then you can calculate dt and then use it to compute area:
dt = median(diff(t)); %median is just to take care of rounding errors
auc = sum(x)*dt;
更多回答(1 个)
M
2017-11-8
Try with this function
trapz
which does trapezoidal numerical integration.
1 个评论
Star Strider
2017-11-10
The trapz (or cumtrapz) functions are the appropriate functions for this problem.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!