1

我有一个 int 数组,并将这些值绘制在图表中。(使用zedgraphcontrol)

在该曲线中,我想使用 C#.net 找到局部最大值我的想法是平滑曲线以消除噪音。我怎样才能找到那些地方。

非常感谢您的所有回复

4

2 回答 2

3

我不会尝试解决 Oleksii 在他的回答中提到的要点,但是我将展示一个如何在 ZedGraph 中平滑曲线的简单示例:

GraphPane myPane = zedGraphControl1.GraphPane;

LineItem myLine = myPane.CurveList.AddCurve("Data", myPointPairList, Color.Blue);

myLine.Line.IsSmooth = true;
myLine.Line.SmoothTension = 0.1F;

0.0F 到 1.0F 的值会影响平滑量,>1.0F 可能是不可取的。

平滑的源代码文档:http: //zedgraph.sourceforge.net/documentation/html/P_ZedGraph_Line_IsSmooth.htm

Zedgraph 参考资料:

于 2011-08-01T15:07:05.300 回答
1

The answer depends on the context. If you only need to find local maximum, then you can just have an interval (sub-array) and do simple iterative Math.Max(). This is, however, may not be what you want.

As you also mentioned smoothing, which is different from finding local maximum. There are many techniques you can use for that, which are based on area, signal type, time, frequency, space, phase, your needs, your goals, your hypothesis etc.

You can start with some exploratory statistics on the signal to help you in understanding which technique you can apply. Such tools are available in stats packages (e.g. SPSS, Minitab) and Matlab. Take a look at the signal plots, try curve fitting and maybe linear regression first. From there you can see where to go.

于 2011-07-30T10:54:37.867 回答