Guest User

Untitled

a guest
Mar 4th, 2020
128
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # first argument is a WAV file
  2.  
  3. import scipy.signal
  4. import scipy.io.wavfile
  5. import numpy
  6. import sys
  7.  
  8. sample_rate, samples = scipy.io.wavfile.read(sys.argv[1])
  9. f, t, Zxx = scipy.signal.stft(x=samples, fs=sample_rate, nperseg=100)
  10.  
  11. print("nperseg = 100")
  12. print(numpy.shape(f))
  13. print(numpy.shape(t))
  14. print(numpy.shape(Zxx))
  15.  
  16. f, t, Zxx = scipy.signal.stft(x=samples, fs=sample_rate, nperseg=200)
  17.  
  18. print("nperseg = 200")
  19. print(numpy.shape(f))
  20. print(numpy.shape(t))
  21. print(numpy.shape(Zxx))
RAW Paste Data