Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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 Kommentare

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Image Analyst
Image Analyst am 14 Dez. 2022
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 am 14 Dez. 2022
Verschoben: Jan am 14 Dez. 2022
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.

Kategorien

Mehr zu Signal Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by