# savgol
C++ implementation of Savitzky Golay Filter based on the original paper :
"Smoothing and Differentiation of Data by Simplified Least Squares Procedures" by A.Savitzky and M. J.E Golay". [1]
* The implementation is close to the original publication with corrections taken from [2] . The convolution weights for each given window size are stored
in a constexpr map.
* there is no padding implemented so far. The data points at the bounds left unchanged.
## usage
```cpp
#include <vector>
#include "savgol.hpp"
std::vector<float> data{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
std::vector<double> filtered_data;
filter::savgol(data.begin(), data.end(), sd::back_inserter(filtered_data),filter::SmoothQuadCubic(5) );
```
## implementation
### available Convolution Operators
> SmoothQuadCubic :
> SmoothQuarticQuintic :
> DeriveQuadFirst :
---
> SmoothGaussian: to make comparisions to SG filter, the gaussian kernel is approximated by binominal coefficients, taken from Pascals triangle.
> SmoothAverage: to make comparisions to SG filter, convolution weights are constant =1.
>
>
### available window sizes
* as presentented in the original paper the window sizes are odd numbers, up to a size of 25
### Demonstration
![](savgol_demo.svg)
[1] A. Savitzky, M. J. E. Golay: Smoothing and Differentiation of Data by Simplified Least Squares Procedures. In: Analytical Chemistry. Volume 36, No. 8, June 1964, p. 1627�1639, [doi:10.1021/ac60214a047](doi:10.1021/ac60214a047).
[2] J. Steiner, Y. Termonia, J. Deltour: Comments on Smoothing And Differentiation Of Data By Simplified Least Square Procedure In: Analytical Chemistry. Volume 44, No. 11, 1. Sept 1972, p. 1906�1909
C++实现的不含任何第三方库的savgol滤波算法,精度可与Opencv的媲美
需积分: 5 168 浏览量
2023-07-26
19:14:51
上传
评论 3
收藏 10KB ZIP 举报
clever101
- 粉丝: 5870
- 资源: 159
最新资源
- 人工智能实验四 感知器算法的设计实现
- java小项目多线程多线程 复制文件 冒泡排序 群聊
- 四数之和(java代码).docx
- 701837906919458TapScanner v3.0.10 (Pro).apk
- 青岛大学人工智能实验二 利用α-β搜索的博弈树算法编写一字棋游戏
- ### 1、项目介绍 本项目Scrapy进行数据爬取,并使用Django框架+PyEcharts实现可视化大屏 效果如下:
- # 微信小程序-健康菜谱 基于微信小程序的一个查找检索菜谱的应用 ### 效果 !动态图(./res/gif/demo
- zabbix-get命令包资源
- 289ssm-mysql-jsp 计算机课程实验管理系统.zip(可运行源码+数据库文件+文档)
- 毕业设计,基于PyQt5实现的可视化界面的Python车牌自动识别系统源码
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈