Skip to content
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

Incorrect interpretation of time shaped RFs #200

Closed
beorostica opened this issue Oct 25, 2023 · 1 comment · Fixed by #321
Closed

Incorrect interpretation of time shaped RFs #200

beorostica opened this issue Oct 25, 2023 · 1 comment · Fixed by #321
Labels
2) medium priority bug Something isn't working core

Comments

@beorostica
Copy link
Contributor

In the source code we use a custom trapezoidal function (used only by the get_rfs() function) which doesn't regard time-shaped waveforms:

(A, t, ΔT, ζ1, ζ2, delay) = begin
	if sum(abs.(A)) != 0 && ΔT+ζ1+ζ2 != 0 # If no event just ignore calculations
		#Getting amplitudes, only supports uniformly sampled waveforms for now
		if length(A) != 1
			grad_raster = ΔT / length(A)
			idx = ceil.(Int, (t .- delay .- ζ1) ./ grad_raster ) #Time to integer index
			valid = 1 .<= idx .<= length(A)
			idx[(!).(valid)] .= 1
			B = A[idx] .* valid
...

In a near future, we want to use linear interpolation instead of zero-order-hold so this issue should be addressed there. This is also related with the issue #167.

@beorostica beorostica added bug Something isn't working core 2) medium priority labels Oct 25, 2023
@cncastillo
Copy link
Member

This already in development in the branch:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2) medium priority bug Something isn't working core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants