Repository navigation
Conversation
find_delay read signal1.N, which SignalObj does not have, so it always raised AttributeError; it also multiplied a half spectrum by a full one. It now takes the peak of scipy.signal.correlate of the first channels and returns the delay in samples, positive when the second signal comes later, for signals of any length. corr_coef passed (samples, 1) arrays to numpy.corrcoef, which takes each row as a variable: it built a matrix of twice the number of samples on each side (73 GB for one second at 48 kHz) and returned the correlation of two samples. It now correlates the first channels. examples/functions_module.py shows each function of the module. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Oct 31, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
examples/functions_module.py, asked for in #13. It shows each function ofpytta.functionsin turn:list_devices,mergeandsplit,fft_convolve,find_delay,corr_coef,resample,peak_time,SPL, wave and HDF5 files, and the plots.Writing it showed that two of these functions did not work:
find_delayreadsignal1.N, whichSignalObjdoes not have, so it always raisedAttributeError. It also multiplied a half spectrum by a full one. It now takes the peak ofscipy.signal.correlateof the first channels and returns the delay in samples, positive when the second signal comes later, for signals of any length.corr_coefpassed(samples, 1)arrays tonumpy.corrcoef, which takes each row as a variable. It built a matrix with twice as many rows and columns as samples (73 GB for one second at 48 kHz) and returned the correlation between two single samples, which isnan. It now correlates the first channels.The tests in
tests/test_delay_and_correlation.pycheck a delay of 100 samples in both directions with signals of different lengths, and a correlation of 1 with itself and -1 with its negative.The example needs #52 and #53 to run as a script on Python 3.12 (for
pytta.generateandpytta.resample). With them, it runs to the end. The index of the module docstring also hadpytta.slipt, nowpytta.split.Checked with Python 3.12, numpy 1.26 and scipy 1.17. The existing tests behave as on
development: the 7 failures there (3 intest_h5io.py, 4 intest_pyttasave.py) are the same with and without this change.Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com