harmonic_percussive_separation#
- hmc_mir.tsm_tools.tsm_tools.harmonic_percussive_separation(x, sr=22050, fft_size=2048, hop_length=512, lh=6, lp=6)[source]#
Performs harmonic-percussive separation on a given audio sample.
- Args
x: the input audio waveform sr: sample rate of the audio data fft_size: specifies the FFT size to use in computing an STFT hop_length: specifies the hop length in samples to use in computing an STFT lh: the harmonic spectrotemporal median filter will be of size (1, 2*lh+1) lp: the percussive spectrotemporal median filter will be of size (2*lp+1, 1)
- Returns:
xh – audio waveform of the estimated harmonic component
xp – audio waveform of the estimated percussive component
Xh – an STFT of the input signal with percussive components masked out
Xp – an STFT of the input signal with harmonic components masked out