0

guys.

Im performing some FFT's in python to test a vocoder algorithm, but in this code line

for i in range(0, duration_s, Nfft):
    output_time[i:i+Nfft] = np.fft.ifft( np.multiply(carr_fft, np.fft.fft(in_samples[i:i+Nfft]) , Nfft) )

It yields the Error Message: TypeError: return arrays must be of ArrayType

It's not a size mismatch issue, I got that covered up (plus, the error message explicitly says it's a Type Mismatch). Any ideas?

José Fonseca
  • 75
  • 1
  • 7

1 Answers1

1

The problem was that I was using

numpy.empty() 

to create the output_time array with an incorrect shape argument. I was actually creating a matrix with a single element, which was the array I wanted, since that when I printed the array, it came out enclosed in two square brackets instead of one. I solved this issue by using

np.zeros(duration_s, np.int16, 'C')`

and it now works correctly.

José Fonseca
  • 75
  • 1
  • 7