I implemented an algorithm for solving the Hankel transformation based on a paper. My problem is: It works very good for the functions suggested in the paper (as test functions), it works pretty ok for certain other test functions, but for other functions with known result it just produces garbage (result is far away from the expected result).
What does that mean for my implementation?
- My implementation is garbage, and I have to redo it.
- I choose a wrong data input for the function, and I have to change the parameters for it
- The algorithm is garbage, and I have to choose another one
- My programming is bad, and I should check that
What would be the best, i.e. most successfull approach for that situation?
Something to note: The algorithm provides a transformation method ($g=HT(f)$) and a backtransformation ($f2=IHT(g)$) method. When comparing $f$ and $f2$, they are equal. But $g$ and the expected function from theory are not.
I am using the following paper as source: https://www.osapublishing.org/josaa/abstract.cfm?uri=josaa-21-1-53 (unfortunately behind paywall), but calculate the Hankel transformation in the zeroth order. As languages I implemented the method both in python and in C/C++. The examples from the paper work, also such examples as $f=1/r, HT(f)=1/k$, but for example $f=r, HT(f)=1/(k^3)$ does not (produces oscillations).
And this is one of the implementations of it (same limitations): https://se.mathworks.com/matlabcentral/fileexchange/15623-hankel-transform?requestedDomain=www.mathworks.com