devito icon indicating copy to clipboard operation
devito copied to clipboard

dsl: Implementation of new interpolation methods

Open guaacoelho opened this issue 2 years ago • 6 comments

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!

guaacoelho avatar Jun 08 '22 16:06 guaacoelho

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

mloubout avatar Jun 14 '22 13:06 mloubout

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 avatar Jun 14 '22 15:06 navjotk

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

@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.

guaacoelho avatar Jun 14 '22 19:06 guaacoelho

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 avatar Jun 14 '22 20:06 guaacoelho

@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.

navjotk avatar Jun 23 '22 12:06 navjotk

FYI sparse interpolation is beeing revamp in #2128 which should help updae this PR.

mloubout avatar Aug 03 '23 13:08 mloubout

sinc interpolation added in #2342 , closing.

Feel free to open a new PR for cubic with the new API.

mloubout avatar Apr 30 '24 19:04 mloubout