I have an audio data set in terms of frequency(Y axis) vs frame (X axis) and want to detect values above a threshold that also stays beyond the value for more than a particular interval of frames and repeat using a loop. Can someone help me with it?

조회 수: 1 (최근 30일)
Frequency vs frame graph for 10 trials cross function to find point above trials? then also see if the value lies greater than the threshold for certain # of frames Looping for 10 set of 10 trials

답변 (1개)

Carl
Carl 2017년 7월 25일
Hi Niveditha. You can do this by first determining which elements of your frequency data are above the threshold, and then searching for a sequence of such elements. The code below creates a random vector, and searches for a sequence of 2 elements that are above the threshold of 0.5:
y = rand(10,1)
above_thresh = y > 0.5
num_frames = 2;
match = ones(num_frames,1);
findsubmat(above_thresh, match)
It makes use of the findsubmat File Exchange function found here:
Let me know if this works for you.

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by