[ANN] KissSmoothing.jl - Hassle free & simple data smoothing

I would like to announce a tiny package I made, KissSmoothing, it can be helpful to those like me that sometimes for visualization/processing purposes just want to reasonably smooth some data in a matrix.
This package offers Gaussian smoothing in Fourier domain, the filter bandwidth is chosen automatically in order for the extracted noise to match the noise in the first derivative of the signal (leading to quite natural smoothing in most cases I’ve tested).

The package is registered, so you can install it like any other package. feel free to let me know if you find any issues or if you find some direction for improving it :slight_smile:

Thank you

9 Likes

Nice,

Can you clarify what dims is? The readme says “array dimension being smoothed” so is that size(V)[2]? or is it the dimension of the output of the command? From the code it looks like it’s size(V)[2] so why pass it as an argument?

One suggestion of something you could maybe add in there is the option to subsample the result (so input has n observations and output has m < n, this could for instance be useful in plots which are made out of a ton of points, you’d smooth and subsample and get a simpler curve supported by fewer points. Just a thought.

Other small notes based on looking at the code (some may be opionated):

  • you can make K1, K2 constants also K1/K2
  • V .* 0 is maybe best replaced by zero(V)
  • sigmat, sigmad should probably be passed as arguments
  • number of iterations too
  • you could probably merge the isfinite and abs branch together
  • you could write the verbose stuff to an IOBuffer so that you don’t branch over verbose in the loop and print the whole lot after the iterations if verbose.
1 Like

Hello! Thank you for your feedback,
in the code “dims” is defaulted to being the last dimension of the input tensor. Which means that if you have a 3D curve represented discretely as matrix of size [3,3000] the smoothing procedure will act along the second dimension. The dims parameter works in exactly the same manner as most Julia functions supporting it :slight_smile:
Nice idea about subsampling, maybe I will add another method to discard points.

1 Like

ah right that makes sense, thanks, (I added a few comments in my previous answer wrt to the code btw but you were too quick for me :smile: )

I tried to answer all of your points, thank you for taking the time to review my code, I will implement some of your suggestions :slight_smile: [done]

1 Like

Thank you for the package !
I’d say that someone looking for such a tool would first look into the examples before code.
I think you could maybe add labels, legends and possibly titles to your plots on the README, this makes it easier to differentiate raw and smoothed curves, for instance.

1 Like

Yes the plots were a bit rushed, I will definitely add a legend, [done] I think it is a good thing that original and smoothed data are hard to distinguish :smiley:

1 Like

Released 1.0.1,
Added method fit_rbf, this package now is also able to fit an interpolating/smoothing thin plate spline to a given dataset.

2 Likes