Skip to content

Update the Methodology to Find delta-t When Resampling a Signal#47

Merged
twmacro merged 1 commit intotwmacro:masterfrom
rjyunis:bugfix/resample-delta-t
Oct 18, 2025
Merged

Update the Methodology to Find delta-t When Resampling a Signal#47
twmacro merged 1 commit intotwmacro:masterfrom
rjyunis:bugfix/resample-delta-t

Conversation

@rjyunis
Copy link
Contributor

@rjyunis rjyunis commented Oct 2, 2025

Hi Tim,

This is a minor change that will improve the robustness of the resample function to work with signals that are not perfectly uniform in their time-steps. In the existing code, if t[1] - t[0] is not representative of the "intended" time step of the signal, the returned time vector will not end at t[-1]. I am running into issues with real-world data where the resampled vector can be dramatically different. A 20 second signal can be reduced to a fraction of a second, or vice versa. By updating the code to use the mean of the time steps, these cases end at t[-1].

Copy link
Owner

@twmacro twmacro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a nice prudent update! :)

@twmacro twmacro merged commit 26613e9 into twmacro:master Oct 18, 2025
11 checks passed
@twmacro
Copy link
Owner

twmacro commented Oct 18, 2025

Sorry Ramsey! I didn't see this until today :P Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants