-
-
Notifications
You must be signed in to change notification settings - Fork 474
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
Include wavedec_coeff_len
from nigma/pywt
#85
Comments
The code from the PR, just in case that PRs on that repo won't be accessible in the future (we may close them completely if people keep sending PRs there instead of here):
|
PR author is @belevtsoff |
Wow, thanks for resurrecting this, it's been 3 years :) |
time flies:) |
The motivation given on the original PR: We used PyWavelets recently in our SpikeSort project. In particular, hstacked ouput from pywt.wavedec was used as a single feature vector. This approach is often used for spike sorting. The function I'm proposing, will be very handy when one wants to allocate a fixed-size numpy array to store wavelet coefficients (obtained from wavedec), before the input data is processed (for example, if one has a huge stack of equal-length independent signals to process and store). @PyWavelets/core opinions on adding this function? |
I think the implementation is correct and it would not be a burden to maintain. However, I'm not sure if there is still much of a use case for it (see below). For batched 1D transforms, it should now be faster to run them all at once using the If e.g. to transform 1000 signals, each of length 256 and get the results in a single array: coeffs = pywt.wavedecn(np.random.randn(256, 1000), 'db2', 'periodization', axes=(0, ))
coeff_array, slices = pywt.coeffs_to_array(coeffs, axes=(0, )) |
Thanks @grlee77, good points. And if one really wanted to do preallocation for some reason, it wouldn't be much of an issue to run a single transform once and obtain the length from the output of that. So closing. |
This is an open PR on nigma's repo: nigma/pywt#4
Leaving this here to remove it from #55.
The text was updated successfully, but these errors were encountered: