Using scipy stft, like this :

sample_rate, samples = scipy.io.wavfile.read(sample_dir/'original'/test_sample_name)
f, t, Zxx = scipy.signal.stft(samples.transpose(), sample_rate)

f.shape is equal to 129. My understanding is that this number represents the number of frequency at which we evaluate the Fourier Transform. How is it calculated? Can we fix this number?

  • $\begingroup$ can you read the scipy.signal.stft documentation, where how to set is explained, and reformulate that question based on that knowlede? $\endgroup$ – Marcus Müller Mar 7 '19 at 18:36
  • $\begingroup$ A year late, but I found the size of f to be either equal to the hop size H = nperseg - noverlap or half the value of nfft. No idea why. $\endgroup$ – Mossmyr Mar 3 '20 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.