如何'顺利'的数据和计算线梯度?梯度、顺利、数据

2023-09-11 00:28:12 作者:devil. 【恶女】

我是从衡量距离的设备中读取数据。我的采样率是高,这样我可以测量距离大变化(即速度),但是,这意味着,当速度低时,装置提供了许多的尺寸均是相同的(由于所述装置的颗粒度)。这导致了阶梯曲线

I'm reading data from a device which measures distance. My sample rate is high so that I can measure large changes in distance (i.e. velocity) but this means that, when the velocity is low, the device delivers a number of measurements which are identical (due to the granularity of the device). This results in a 'stepped' curve.

我需要做的是平滑的曲线,以计算速度。下面,我再需要计算加速。

What I need to do is to smooth the curve in order to calculate the velocity. Following that I then need to calculate the acceleration.

如何最好地去呢?

(采样率最高到1000Hz,10Hz的计算速度将是确定。使用C#在VS2005)

(Sample rate up to 1000Hz, calculation rate of 10Hz would be ok. Using C# in VS2005)

推荐答案

从moogs的维基百科条目是一个良好的起点,平滑的数据。但它不能帮助你做决定。

The wikipedia entry from moogs is a good starting point for smoothing the data. But it does not help you in making a decision.

这一切都取决于你的数据,以及所需要的处理速度。

It all depends on your data, and the needed processing speed.

移动平均 将压平的顶值。如果您interrested的最小值和最大值,不要用这个。此外,我认为使用移动平均线会影响你的加速度测量,因为它会扁平化数据(位),从而加速会显得更小。这一切都归结到所需要的精确度。

Moving Average Will flatten the top values. If you are interrested in the minimum and maximum value, don't use this. Also I think using the moving average will influence your measurement of the acceleration, since it will flatten your data (a bit), thereby acceleration will appear to be smaller. It all comes down to the needed accuracy.

Savitzky - 格雷 快速算法。以最快的速度移动平均线。这将preserve峰的高度。有点更难实现。而你所需要的正确的系数。我会选这一个。

Savitzky–Golay Fast algorithm. As fast as the moving average. That will preserve the heights of peaks. Somewhat harder to implement. And you need the correct coefficients. I would pick this one.

卡尔曼滤波 如果您知道分布,这可以给你很好的效果(这是用在GPS导航系统)。也许有点难以实现。我提到这一点,因为我已经在过去使用它们。但他们可能不适合在这种东西的起动不错的选择。

Kalman filters If you know the distribution, this can give you good results (it is used in GPS navigation systems). Maybe somewhat harder to implement. I mention this because I have used them in the past. But they are probably not a good choice for a starter in this kind of stuff.

以上将减少噪声对你的信号。

The above will reduce noise on your signal.

接下来你所要做的就是发现了加速的起点和终点。可以通过创建原始信号的一个衍生的做到这一点。点(s)的结合的衍生物穿过Y轴(零)可能在信号中的峰值,并可能指示加速度的开始和结束。

Next you have to do is detect the start and end point of the "acceleration". You could do this by creating a Derivative of the original signal. The point(s) where the derivative crosses the Y-axis (zero) are probably the peaks in your signal, and might indicate the start and end of the acceleration.

您可以再创建一个第二学位衍生获得铅丹和最大加速度本身。

You can then create a second degree derivative to get the minium and maximum acceleration itself.