def __str__(self):
s = '=======================================\n'
s += 'classname : %s\n' %self.__class__.__name__
s += 'sample rate : %.1f [Hz]\n' %self.fs
s += 'channels : %i\n' %self.ch
s += 'duration : %.3f [s]\n' %self.duration
s += 'datatype : %s\n' %self.samples.dtype
s += 'samples per ch : %i\n' %self.nofsamples
s += 'data size : %.3f [Mb]\n' %(self.samples.nbytes/(1024*1024))
s += 'has comment : %s\n' %('yes' if len(self._comment)!=0 else 'no')
if self.ch != 0:
# += '-----------------:---------------------\n'
s += 'peak : %s\n' %np.array_str(self.peak()[0],
precision=4, suppress_small=True)
s += 'RMS : %s\n' %np.array_str(self.rms(),
precision=4, suppress_small=True)
s += 'crestfactor : %s\n' %np.array_str(self.crest_factor(),
precision=4, suppress_small=True)
s += '-----------------:---------------------\n'
return s
评论列表
文章目录