Я получаю эту ошибку, кто-нибудь может мне помочь?
TypeError: 'numpy.float64' объект не может быть интерпретирован как целое число.
def stft(sig, frameSize, overlapFac=0.5, window=np.hanning):
win = window(frameSize)
hopSize = int(frameSize - np.floor(overlapFac * frameSize))
# zeros at beginning (thus center of 1st window should be for sample nr. 0)
samples = np.append(np.zeros(int(frameSize/2.0)), sig)
# cols for windowing
cols = np.ceil( (len(samples) - frameSize) / float(hopSize)) + 1
# zeros at end (thus samples can be fully covered by frames)
samples = np.append(samples, np.zeros(frameSize))
frames = stride_tricks.as_strided(samples, shape=(cols, frameSize),strides(samples.strides[0]*hopSize,samples.strides[0])).copy()
frames *= win
return np.fft.rfft(frames)
<ipython-input-113-e40a989a9c6b> in stft(sig, frameSize, overlapFac, window)
10 samples = np.append(samples, np.zeros(frameSize))
11
---> 12 frames = stride_tricks.as_strided(samples, shape=(cols, frameSize), strides=(samples.strides[0]*hopSize, samples.strides[0])).copy()
13 frames *= win
14
~\AppData\Roaming\Python\Python37\site-packages\numpy\lib\stride_tricks.py in as_strided(x, shape, strides, subok, writeable)
101 interface['strides'] = tuple(strides)
102
--> 103 array = np.asarray(DummyArray(interface, base=x))
104 # The route via `__interface__` does not preserve structured
105 # dtypes. Since dtype should remain unchanged, we set it explicitly.
~\AppData\Roaming\Python\Python37\site-packages\numpy\core\numeric.py in asarray(a, dtype, order)
536
537 """
--> 538 return array(a, dtype, copy=False, order=order)
539
540
TypeError: 'numpy.float64' object cannot be interpreted as an integer
Я не знаюГде проблема, я читал, это проблема версии Python, но это не так. Я не знаю, как решить!