【发布时间】:2017-01-17 03:25:58
【问题描述】:
在 Matlab 上,我有一段代码在生物医学信号中计算超过某个阈值的跨度数:
EMG_signal = [1 2 4 2 0 0 2 2 0 2 0 2 2 2] % Sample signal with 2 bursts
threshold = 1.5
above_threshold = (EMG_signal > threshold)
minAcceptableLength = 3; % or 200 or whatever.
% Find spans that are long enough.
isLongEnough = bwareafilt(above_threshold, [minAcceptableLength, inf])
% Count the number of spans (bursts) that are long enough.
[labeledSpans, numberOfBursts] = bwlabel(isLongEnough)
我有兴趣在跨度计数中添加进一步的条件:跨度不仅应在大于 above_threshold 和 minAcceptableLength 时被识别,而且在两个不同跨度之间至少有 N 个样本时(否则它应该算作 1 个跨度)。
非常感谢任何帮助。
【问题讨论】:
标签: matlab count signal-processing