arntanguy / gram_savitzky_golay

C++ Implementation of Savitzky-Golay filtering based on Gram polynomials
BSD 2-Clause "Simplified" License
102 stars 29 forks source link

Fix the Example please #5

Closed FahadRazaKhan closed 4 years ago

FahadRazaKhan commented 4 years ago

Please add the initial value in the example code i.e filter.filter(data, 0). It took me couple of hours to figure that out (I am not good at C++) otherwise compiler throw error. Furthermore, please mention how the data stream should be fed in real-time. I found that boost/circular_buffer is the right container for this library. As std::vector can not keep the size fix, and also you have to put the new incoming data at the end of the container i.e. from the bottom.

Thank you for your work.

arntanguy commented 4 years ago

Thanks for the comment and the interest. I will fix/improve the example in the coming days. In the meanwhile, you can have a look at the unit tests to get a more precise idea about the use of the library: https://github.com/arntanguy/gram_savitzky_golay/blob/master/test/test_gram_savitzky_golay.cpp

arntanguy commented 4 years ago

Hi,

I have updated the library with #6 This removes the need to specifiy the initial value in the filter, you can now do filter.filter(data) instead, and the exemple in the readme match the code ;)

Additionally, the Doxygen documentation is now uploaded: https://arntanguy.github.io/gram_savitzky_golay/

I'll add some more examples later.