Why would xcorr and xcorr2 be quite different here? M1 and M2 are numpy matrices. M1.shape[0] = M2.shape[0]. xcorr is what I would expect with this operation, but xcorr2 is something totally different and has imaginary numbers. xcorr does not have imaginary numbers. Answer Try giving xcorr and xcorr2 dtype=complex. According to scipy docs, the output from both fft and

# Tag: fft

## What does np.fft.fftfreq actually do?

I have a monthly time series and I am taking the discrete fourier transform of it. However I am confused as to how numpy converts the time domain into frequency domain? I am using np.fft.fftfreq and …

## How to set all values between a range equal to zero in python [closed]

I want to set all the values between 0.75 and 0.8 of an array, equal to zero. Until now I have tried and succeeded to set all the values below or above a threshold equal to zero as it presented in the …