I'm trying to write an audio analysis application, and I need to identify local maxima in a 2D array which represents a spectrogram. I've already got an open source library that can generate the spectrogram using Fast Fourier Transforms, but I was wondering if anybody knew of any good libraries to help me with actually finding the maxima? I'm not quite sure what to search Google for - the best I could think of was "numerical library" but that hasn't got me very far.
我正在尝试编写音频分析应用程序,我需要在2D数组中识别代表谱图的局部最大值。我已经有了一个可以使用快速傅立叶变换生成频谱图的开源库,但我想知道是否有人知道有什么好的库可以帮我实际找到最大值?我不太确定要搜索谷歌的内容 - 我能想到的最好的是“数字图书馆”,但这并没有让我走得太远。
Preferably in C, but I'm open to other suggestions.
最好是在C中,但我愿意接受其他建议。
2 个解决方案
#1
1
Peak finding is a fairly general problem. It has already been discussed once on SO as Peak detection of measured signal.
峰值发现是一个相当普遍的问题。已经在SO上讨论过一次作为测量信号的峰值检测。
The answers provided include several viable heuristics.
提供的答案包括几个可行的启发式方法。
Of course, I prefer my own answer if you need rigor, but ROOT is written in c++, and is almost certainly too heavy for your application, so you'll need to strip out just the code you want...
当然,如果你需要严谨,我更喜欢我自己的答案,但ROOT是用c ++编写的,几乎肯定对你的应用来说太重了,所以你需要去除你想要的代码......
#2
1
The GNU Scientific Library features a multidimensional minimization framework that can be made to work for maximization easily enough. It's designed to only return a single minimum rather than a bunch of different minima, however.
GNU科学库具有多维最小化框架,可以轻松地实现最大化。然而,它只能返回一个最小值,而不是一堆不同的最小值。
#1
1
Peak finding is a fairly general problem. It has already been discussed once on SO as Peak detection of measured signal.
峰值发现是一个相当普遍的问题。已经在SO上讨论过一次作为测量信号的峰值检测。
The answers provided include several viable heuristics.
提供的答案包括几个可行的启发式方法。
Of course, I prefer my own answer if you need rigor, but ROOT is written in c++, and is almost certainly too heavy for your application, so you'll need to strip out just the code you want...
当然,如果你需要严谨,我更喜欢我自己的答案,但ROOT是用c ++编写的,几乎肯定对你的应用来说太重了,所以你需要去除你想要的代码......
#2
1
The GNU Scientific Library features a multidimensional minimization framework that can be made to work for maximization easily enough. It's designed to only return a single minimum rather than a bunch of different minima, however.
GNU科学库具有多维最小化框架,可以轻松地实现最大化。然而,它只能返回一个最小值,而不是一堆不同的最小值。