is there a way to put some threshold and count the number of times whenever the signal becomes above the threshold?

1 次查看(过去 30 天)
is there a way to put some threshold and count the number of times whenever the signal becomes above the threshold, and depending on the number of times it takes some decision automaticlly
  6 个评论

请先登录,再进行评论。

回答(2 个)

Image Analyst
Image Analyst 2022-12-14
Sure. Use bwlabel if you have the Image Processing Toolbox.
[L, count] = bwlabel(data >= someThresholdValue)
count is the number of runs of your data at or above the threshold value.

Jan
Jan 2022-12-14
移动:Jan 2022-12-14
So currently you did not store the signal in a variable at all, but you directly plot it. Replace:
plot(recObj.getaudiodata());
by
signal = recObj.getaudiodata();
plot(signal);
Now you have a signal and can count the frames, which exceed the threshold.

类别

Help CenterFile Exchange 中查找有关 Signal Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by