class Onsets(BaseModel): onset_prep = ArrayWithUnitsFeature(SlidingWindow, needs=fft_feature, wscheme=HalfLapped() * Stride(frequency=1, duration=3), store=False) complex_domain = ArrayWithUnitsFeature(ComplexDomain, needs=onset_prep, store=False) sliding_detection = ArrayWithUnitsFeature( SlidingWindow, needs=complex_domain, wscheme=HalfLapped() * Stride(frequency=1, duration=11), padwith=5, store=False) slices = TimeSliceFeature(MovingAveragePeakPicker, needs=sliding_detection, aggregate=np.median, store=True)
class WithOnsets(self.STFT): transience = ArrayWithUnitsFeature(MeasureOfTransience, needs=self.STFT.fft, store=True) sliding_detection = ArrayWithUnitsFeature( SlidingWindow, needs=transience, wscheme=self.wscheme * Stride(frequency=1, duration=10), padwith=5, store=False) slices = TimeSliceFeature(MovingAveragePeakPicker, needs=sliding_detection, aggregate=np.median, store=True)
class Document(BaseModel): raw = ByteStreamFeature(ByteStream, chunksize=2 * 44100 * 30 * 2, store=True) ogg = OggVorbisFeature(OggVorbis, needs=raw, store=True) pcm = AudioSamplesFeature(AudioStream, needs=raw, store=True) resampled = AudioSamplesFeature(Resampler, needs=pcm, samplerate=samplerate, store=True) windowed = ArrayWithUnitsFeature(SlidingWindow, needs=resampled, wscheme=windowing_scheme, wfunc=OggVorbisWindowingFunc(), store=False) fft = ArrayWithUnitsFeature(FFT, needs=windowed, store=True) chroma = ArrayWithUnitsFeature(Chroma, needs=fft, frequency_band=band, store=True) bark = ArrayWithUnitsFeature(BarkBands, needs=fft, frequency_band=band, store=True) bfcc = ArrayWithUnitsFeature(BFCC, needs=bark, store=True) bfcc_sliding_window = ArrayWithUnitsFeature( SlidingWindow, needs=bfcc, wscheme=windowing_scheme * Stride(frequency=2, duration=4), store=True) bfcc_pooled = ArrayWithUnitsFeature(Max, needs=bfcc_sliding_window, axis=1, store=True)