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
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.
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
Nice idea about subsampling, maybe I will add another method to discard points.
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.
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