Changeset 4120fbc for python/demos/demo_mel-energy.py
- Timestamp:
- May 16, 2016, 3:16:00 AM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- dc654f8
- Parents:
- 416ddd1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/demos/demo_mel-energy.py
r416ddd1 r4120fbc 6 6 7 7 win_s = 512 # fft size 8 hop_s = win_s / 4# hop size8 hop_s = win_s // 4 # hop size 9 9 10 10 if len(sys.argv) < 2: 11 print "Usage: %s <filename> [samplerate]" % sys.argv[0]11 print("Usage: %s <filename> [samplerate]" % sys.argv[0]) 12 12 sys.exit(1) 13 13 … … 35 35 fftgrain = pv(samples) 36 36 new_energies = f(fftgrain) 37 print '%f' % (total_frames / float(samplerate) ),38 print ' '.join(['%f' % b for b in new_energies])37 timestr = '%f' % (total_frames / float(samplerate) ) 38 print('{:s} {:s}'.format(timestr, ' '.join(['%f' % b for b in new_energies]))) 39 39 energies = vstack( [energies, new_energies] ) 40 40 total_frames += read … … 42 42 43 43 if 1: 44 print "done computing, now plotting"44 print("done computing, now plotting") 45 45 import matplotlib.pyplot as plt 46 46 from demo_waveform_plot import get_waveform_plot
Note: See TracChangeset
for help on using the changeset viewer.