devito
devito copied to clipboard
dsl: Implementation of new interpolation methods
Hi Guys @FabioLuporini @mloubout @navjotk @georgebisbas ,
I've been working with @nogueirapeterson to include new interpolation techniques on Devito. We implement the cubic and sinc interpolation methods. Thus, we create two new classes: CubicInterpolator and SincInterpolator, which contains, respectively, the cubic and sinc interpolation methods.
The cubic interpolator was implemented using the cubic convolution technique (10.1109/TASSP.1981.1163711) and the sinc interpolator was implemented using Kaiser windowed sinc functions (https://doi.org/10.1190/1.1451454).
We hope you appreciate this contribution and help us to improve this implementation with your great review!
The .h
file shouldn't really be necessary. Bessel function are defined in math.h
so should be able to make a symbolic expression directly calling it rather than the lookup table
Also, I want to understand if this is significantly different from using PrecomputedInterpolator (i.e. this class could extend and use the functionality there)
The
.h
file shouldn't really be necessary. Bessel function are defined inmath.h
so should be able to make a symbolic expression directly calling it rather than the lookup table
@mloubout Before the decision of create this '.h' file it was made a search for some library that could already has the implementation of the Bessel function that we needed (the zero-order modified Bessel function of the first kind).
I found some implementations of the bessel functions, but none of the zero-order modified Bessel function of the first kind.
Also, I want to understand if this is significantly different from using PrecomputedInterpolator (i.e. this class could extend and use the functionality there)
@navjotk At the same way that linear interpolation, both cubic and sinc interpolation also can be done by using PrecomputedInterpolator, if the right coefficients are used. So I can say that the main difference is that this new classes removes the responsibility of obtaining the interpolation coefficients from the user.
@guaacoelho But LinearInterpolator does not do any pre computation. If this class is doing pre computation of coefficients, it could store them in the properties provided by PrecomputedInterpolator
and use the rest of the infrastructure there. i.e. This class precomputes the coefficients and hands them off to PrecomputedInterpolator
, not the user.
FYI sparse interpolation is beeing revamp in #2128 which should help updae this PR.
sinc interpolation added in #2342 , closing.
Feel free to open a new PR for cubic with the new API.