def Heterodyn(x, f, sr=1, nwind=1024, nhop=512,
windfunc=np.blackman):
'''
Calculates the amplitude near frequency f in x
nwind should be at least 3 periods if the signal is periodic.
'''
sinsig = np.exp(2j*np.pi*np.arange(len(x))*f/float(sr))
hamp, t = FuncWind(np.sum, x*sinsig, power=1, sr=sr,
nwind=nwind, nhop=nhop,
windfunc=windfunc)
return np.array(hamp)*2, np.array(t)
评论列表
文章目录