self.freq_bins = bins
for i, tb in enumerate(time_bins):
ev = Event(onset=tb, duration=self.frame_size)
value_data = {}
for fb in self.freq_bins:
label = "%d_%d" % fb
start, stop = fb
val = data[i, start:stop].mean()
if np.isinf(val):
val = 0.
value_data[label] = val
ev.add_value(Value(stim, self, value_data))
events.append(ev)
return events
class MeanAmplitudeExtractor(TranscribedAudioExtractor):