BUG: signal.correlate: many numerical close-to-zero errors on 3D array #20681
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.signal
Describe your issue.
I am using
scipy.signal.correlate
(scipy version 1.11.1, but I'll test on a newer one soon EDIT: same thing happens on scipy1.13.0
) to convolve an array of zeros and ones with a gaussian. The array is 3d, the gaussian kernel 1d. Most of the correlated data is zeros, so I expect most of the output to be exactly zeros, but I get a lot of values close to, but not identical to zero.This is the reproducible example:
this is the plot:
if you zoom in on samples 1000:1500 (for example) of the output of
correlate
you see the close-to-zero noise:Interestingly this does not happen if I reduce the operation to 1d array:
This looks like a bug to me, but I'm also curious why this would happen.
It may look benign but such close-to-zero low variance timepoints can produce high-amplitude noisy values from a standard statistical test (t test for example) and obscure things.
Reproducing Code Example
Error message
SciPy/NumPy/Python version and system information
The text was updated successfully, but these errors were encountered: