考虑表示二维信号的双维矩阵 Z = s(X,Y)
。这个信号有几个高斯峰和一个背景高斯噪声。下图给出了此类信号的示例:
我想找到一种算法,在给定多个输入的情况下找到这些峰值:
- 一个阈值(z 轴),低于该阈值算法预计不会找到任何峰值
- 为了让算法考虑两个峰值而不是一个峰值(x 和 y 方向上的距离),必须将两个峰值分开的最小距离
我首先想到使用 MATLAB 提供的函数 findpeaks
。不过这个函数好像不提供对矩阵的支持。
最佳答案
来自 matlab答案, findpeaks 函数可以工作,但您必须循环遍历行:
M = randi(99, 4, 8);
for k1 = 1:size(M,1)
[pks,loc] = findpeaks(M(k1,:));
P{k1} = [pks; loc];
end
元胞数组说明了每行中不同数量的峰和位置。您可以使用它来查找峰值。
关于
I would like to find an algorithm that finds these peaks given several inputs :
A threshold (z-axis) below which the algorithm is not expected to find any peaks The minimum distance that must separates two peaks in order for the algorithm to account for two peaks instead of one (distance in both x and y directions)
不太确定。
关于algorithm - 矩阵中的峰值检测算法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43847265/