def createSpectrogramFile(x, Fs, fileName, stWin, stStep):
specgramOr, TimeAxis, FreqAxis = aF.stSpectogram(x, Fs, round(Fs * stWin), round(Fs * stStep), False)
print specgramOr.shape
if inputs[2]=='full':
print specgramOr
numpy.save(fileName.replace('.png','')+'_spectrogram', specgramOr)
else:
#specgram = scipy.misc.imresize(specgramOr, float(227.0) / float(specgramOr.shape[0]), interp='bilinear')
specgram = cv2.resize(specgramOr,(227, 227), interpolation = cv2.INTER_LINEAR)
im1 = Image.fromarray(numpy.uint8(matplotlib.cm.jet(specgram)*255))
scipy.misc.imsave(fileName, im1)
generateSpectrograms.py 文件源码
python
阅读 35
收藏 0
点赞 0
评论 0
评论列表
文章目录