Open torridgristle opened 2 years ago
I really appreciate your great issues!
I did not notice that i1
is modified Bessel function at that time.
For now it seems better that replace all wrong jinc as sinc to maintain 2d options.
Please tell me if you have any better idea. Thank you for your issues again!
SciPy has a Bessel function, scipy.special.j1()
. I can't find an implementation of it elsewhere that looks correct when I recreate it.
Edit: There's a Jinc function that keeps to basic Python and PyTorch in rosinality's Alias-Free GAN repo.
Thank you for good references!
Oh, he took polynomial approximation coefficients from outside.
Since my first goal is understandable and flexible code with pytorch, sinc
is not a bad option for now.
In addition, I think that I need more study for jinc for better implementation.
Here is a plot of the generated 1D sinc filter kernel.
Here is a plot of the generated 2D jinc filter kernel.
I'd expect it to look more like a series of rings or ripples, rather than a donut or torus.
The FFT output for randn noise put through the 2D filter doesn't look right either.
Changing
filter_ = 2 * cutoff * window * jinc(2 * cutoff * time)
tofilter_ = 2 * cutoff * window * sinc(2 * cutoff * time)
inkaiser_jinc_filter2d
makes a more familiar kernel.And the FFT output for randn noise put through this 2D filter looks about how I'd expect.