【发布时间】:2023-03-08 13:26:01
【问题描述】:
我想过滤一个非常嘈杂的信号,以便获得超过某个阈值的峰值数量。这是我使用的matlab代码:
thresh = 3; % Specify threshold
x = VarName1;
% Essentially need to pick out values which exceed threshold with the condition that the previous value
% needs to be below the threshold
idxl = x>=thresh;
idxl(1) = 0;
idx = find(idxl);
yest = x(idx-1)<thresh;
idx(yest) % Final output
但是我得到的值太高了,事实上,当我在图中找到峰值时,它还识别出跨越阈值的相邻值,如附图所示。但我想在每次超过阈值时计算一个峰值。你知道我该怎么做吗? image_matlab
【问题讨论】:
标签: matlab filtering threshold