简体   繁体   English

使用C#检测嘈杂数据集中的峰值

[英]Detecting peaks in noisy data-set using C#

I would like to find a specific set of maximum points in a collection of data I create. 我想在我创建的数据集合中找到一组特定的最高点。 Visually it looks something like this: Where the blue points are my data, the green line is the plot, and in yellow I have marked which max points I want to find. 看起来像这样:蓝点是我的数据,绿线是情节,黄色表示我要查找的最大点。 在此处输入图片说明

So far I have tried to "smooth" the function via local average and a rolling window but that modifies the max values and does not quite smooth it out enough to see each of those noisy peaks as one single max value. 到目前为止,我已经尝试通过局部平均值和滚动窗口来“平滑”该函数,但是这样做会修改最大值,并且平滑度不足以将每个嘈杂的峰值视为一个单个最大值。

Is there some transform I could do in code to this array of number to allow for easier extraction of such values? 我可以在代码中对该数字数组进行一些转换,以便更容易地提取此类值吗?

I am writing in C#. 我正在用C#编写。 The closest posts I could find to what I am looking for were for R which I know nothing about unfortunately. 我可以找到的最接近我想要的职位是R,但我对此一无所知。

Really naive but efficient approach w/oa statistics package: If you want to find all local maxima for a continuous function, they correspond with changes in the 'direction' of the function (ascending or descending). 带有统计包的真正幼稚但有效的方法:如果要查找连续函数的所有局部最大值,则它们与函数“方向”的变化(升序或降序)相对应。 Whenever it goes from asc-->desc you have a local maxima. 每当它从asc-> desc发出时,您就有一个局部最大值。

Something like this: https://dotnetfiddle.net/4YPz2A 像这样的东西: https : //dotnetfiddle.net/4YPz2A

This will give you more 'yellow' matches than you want; 这将给您比您想要的更多的“黄色”匹配; but you could get to the 'right' amount by smoothing the dataset (for example by averaging every 3 consecutive data points first). 但是您可以通过平滑数据集(例如,首先对每3个连续的数据点求平均值)来获得“正确”的数量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM