def __init__(self, data, Fs, name='', start=0):
"""Create a SongFile for storing signal data
Inputs:
data: a numpy array with time series data. For use with PyAudio,
ensure the format of data is the same as the player
Fs: sampling frequency, ideally a float
Keyword Arguments:
name: a string identifying where this SongFile came from
start: a value in seconds indicating that the SongFile's data does
not come from the start of a longer signal
"""
# Values passed into the init
self.data = data
self.Fs = Fs
# Post-processed values (does not include spectrogram)
self.time = None
self.freq = None
self.classification = None
self.entropy = None
self.power = None
self.name = name
self.start = start
self.length = len(self.data) / self.Fs
评论列表
文章目录