系列数据的平滑度 [英] Smooth of series data
问题描述
我需要更好地平滑此类图,我已经使用移动平均线(10点)来获得该图,但是它还不是完美的.我想消除所有由于噪声引起的小峰,我只需要考虑较大的峰,因为我正在计算传感器的节拍数. (即:在开始的30秒内,我应该只有一个峰值,而不是几个连续的小峰值)
i need to smooth better this kind of plot, I've already used a moving average (10 points) to get this plot but it's not yet perfect. I want to remove all these little peaks dued by noise, I need to consider only the bigger ones because I'm counting the num of beats from a sensor. (ie.: in the first 30 seconds I should have just one peak instead of several successive little peaks)
我曾想使用三次样条,但在C语言中实现起来并不容易,这将花费大约1-2周的时间.
I thought to use a cubic spline but isn't simple to implement in C and it's going to take almost 1-2 weeks of work.
是否有更简单的方法/算法可用于实现此目标?我正在为iOS(iPhone)环境进行此项目.
Is there a simpler method / algorithm to use for this achievement? I'm working on this project for iOS (iPhone) environment.
忙碌的猫http://img15.imageshack.us/img15/1929/schermata022455973alle1o.png
推荐答案
问题的答案在很大程度上取决于基础数据.数据的锯齿是真正的噪声"还是真的是锯齿的数据.
The answer to your question depends a lot on the underlying data. Is the jaggedness of the data really 'noise' or is it really jagged data.
您可以尝试的策略:
- windowing the data and take the median/mean in each window -- so each window is 50 (from your x axis)
- sample the data
- Nonlinear least squares curve fit (you'd probably have to use a C++ library for that, here is an open source version you could port http://www.ics.forth.gr/~lourakis/levmar/)
- some sort of naive bezier smoothing should be pretty easy.
所有这些方法都有分支,没有一个没有问题.祝你好运.
All of these methods have ramifications and none are without problems. Good luck.
这篇关于系列数据的平滑度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!