-
Notifications
You must be signed in to change notification settings - Fork 64
Add measured locations as parameters for approx1 and approx2 #160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@ShyamSS-95 May be we can expand approx1 / approx2 by adding additional variables instead of introducing new functions ? You could also convert the scaling into a function
Since you are using broadcasting, you dont need to get the scalar outside. |
@pavanky I've made the changes to approx1/2 itself. Take a look and let me know if its fine :) |
@ShyamSS-95
|
Ah OK. But I'm still not clear on how that would work. To clarify, would it be something like this?: approx1(signal, pos0 = None, method=INTERP.LINEAR, off_grid=0.0,
x_interpolated = None, x_input = None
):
output = Array()
if(x_interpolated is not None and x_input is not None):
pos0 = _scale_pos_axis0(x_interpolated, x_input)
safe_call(backend.get().af_approx1(c_pointer(output.arr), signal.arr, pos0.arr,
method.value, c_float_t(off_grid)))
return output Then for the old behaviour, this can be used: |
@ShyamSS-95 |
Oh. So, if |
@ShyamSS-95 yes |
@pavanky |
One last thing, can you shorten the input names ? May be something like numpy? https://docs.scipy.org/doc/numpy/reference/generated/numpy.interp.html |
I've implemented an
interp1d
andinterp2d
function similar to the one found inscipy
. Rather than having the user manually transform the input points from [0, N-1] when usingapprox1
andapprox2
, this function takes care of the transformation by taking the input data points in addition to the interpolation points.However, there is one issue: I'm using
sum
to get a scalar value:Do you recommend using something else?