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
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!