コード例 #1
0
def plot_sample(ref, samp):
    N = min(len(samp), 256)
    fs = 48000
    pl.subplot(211)
    pl.grid()
    pl.plot(ref)
    pl.plot(samp)
    pl.subplot(212)
    pl.grid()
    #pl.ylim((-50, 50))
    pl.psd(ref, N, window=pl.blackman(N), Fs=fs)
    pl.psd(samp, N, window=pl.blackman(N), Fs=fs)
コード例 #2
0
ファイル: TeraData.py プロジェクト: DavidJahn86/terapy
 def getWindowedData(self,windowlength_time=1e-12):
     #returns the blackmanwindowed tdData
     N=int(windowlength_time/self.dt)
     w=py.blackman(N*2)
     w=py.hstack((w[0:N],py.ones((self.getLength()-N*2),),w[N:]))
     windowedData=self.tdData
     #this could be written more elegantly?!
     windowedData[:,1]*=w
     windowedData[:,2]*=w
     windowedData[:,3]*=w
     windowedData[:,4]*=w
     return windowedData