robotsorcerer / Savitzky-Golay

Computes the Savitzky-Golay Filter coefficients.
Apache License 2.0
102 stars 32 forks source link
fir-filter moving-average-filter signal-processing

Savitzky-Golay Filter in C++

Author: Lekan Ogunmolu

Table of Contents

Introduction

Nicely computes the Vandermonde matrix, Savitzky-Golay differentiation filters, and smoothing coefficients for any sequential signal. It is a textbook implementation of the Savitzky-Golay Filter. Initial testing of this code was on a Ubuntu 14.04.02 Trusty OS running Linux 4.4 but will work on any other Linux/Windows/Mac OS machine with little effort.

Below are examples of how the filter smoothes out a noisy depth map data from the kinect time-of-flight sensor:

Dependencies

Usage

Components

Compilation

There is a CMakeLists.txt file in the project root folder. From the project root directory:

  1. Create a build directory: mkdir build && cd build
  2. Compile the cpp code: cmake ../
  3. Build your executable: make
  4. Run the executable: ./savgol

Citation

If you have used Savitzky-Golay in your work, please cite it.

@misc{Savitzky-Golay,
  author = {Ogunmolu, Olalekan},
  title = {{Savitzky-Golay Filter in C++}},
  year = {2015},
  howpublished = {\url{https://github.com/lakehanne/Savitzky-Golay}},
  note = {Accessed August 15, 2015}
}

Issues

If you have issues running the files, please use the issues tab to open a bug. I will generally respond within a 24-hour period.

Changelog

TODO

Add a plotter to plot the filtered values on a gtk chart?

Reference

INTRODUCTION TO SIGNAL PROCESSING

Sophocles J. Orfanidis, Prentice Hall, 2010

Chapter 8; Section 8.3.5