Open MothNik opened 5 months ago
Hi @MothNik
Excellent idea, this is exactly what I also wanted chemotools
to be, a place where new developments can be implemented!! After going through the paper, I agree with creating the FIR interface, it is nice for modularization and reusability of the code! I will make a new branch with this one!! :smile: :muscle:
🚶➡️🏃 Proposed Enhancement
In 2023, some researchers put the Savitzky-Golay-filter to the test and figured out that - despite its wide-spread use - it is actually far from being a good smoother. Their publication Why and How Savitzky–Golay Filters Should Be Replaced introduces a new smoother called "Modified Sinc Smoother" which cuts short all the disadvantages of the Savitzky-Golay-filter - first and foremost that it does many things but fully removing noise. The publication really goes deep into the topic and explains the reasons for this quite nicely.
Given this, an implementation of the Modified Sinc Smoother would be a nice addition to
chemotools
. It would be light-weight smoother (not heavy likeWhittakerSmooth
) with yet excellent smoothing capabilities. Fun fact: the Savitzky-Golay and Modified Sinc Smoother share the same parameters (window_length
andpolyorder
; the publication states thatpolyorder
is the wrong naming convention and should bepoly_degree
), so the Modified Sinc Smoother could become a simple drop-in-replacement for the Savitzky-Golay.🧑💻 Implementation aspects
Both the Savitzky-Golay- and the Modified Sinc Smoother belong to the class of so-called Finite Impulse Response Filters. Their main principle is to convolve the signal with a filter. The only thing they differ in is the shape of the filter, so basically both smoothers can share the same base class. Then, they only provide the computation of their filter coefficients which keeps the transformer classes themselves lean while reusing a lot of logic that then only has to be tested once. All that's required is a common interface where the individual filters can hand over their respective filter coefficients as depicted below.