hmc_mir.tsm_tools.tsm_tools#

Time Series Modulation

Code is from https://github.com/HMC-MIR/PianoConcertoAccompaniment/blob/main/tsm_tools.ipynb and https://www.mdpi.com/128016

Functions

calc_sum_squared_window(window, hop_length)

Calculates the denominator term for computing synthesis frames.

estimateIF(S, sr, hop_samples)

Estimates the instantaneous frequencies in a STFT matrix.

estimateIF_var(S, sr, timestamps)

Estimates the instantaneous frequencies in an STFT-like matrix when the analysis frames are not evenly spaced.

hann_window(L)

Returns a Hann window of a specified length.

harmonic_percussive_separation(x[, sr, ...])

Performs harmonic-percussive separation on a given audio sample.

invert_stft(S, hop_length, window)

Reconstruct a signal from a modified STFT matrix.

mix_recordings(x1, x2)

Mixes two audio waveforms together.

my_stft(x, N, hop_length, window)

A custom implementation of the STFT that allows for non-integer hop lengths (in samples).

tsm_hybrid(x[, alpha, sr])

Time stretches the input signal using a hybrid method that combines overlap-add and phase vocoding.

tsm_overlap_add(x[, alpha, L])

Time stretches the input signal using the overlap-add method.

tsm_phase_vocoder(x[, alpha, L, sr])

Time stretches the input signal using the phase vocoder method.

tsmvar_hybrid(x, alignment[, sr])

Time stretches the input signal using a hybrid method that combines overlap-add and phase vocoding.

tsmvar_overlap_add(x, alignment[, L, fs])

Time stretches the input signal using the overlap-add method according to a given alignment.

tsmvar_phase_vocoder(x, alignment[, L, fs])

Time stretches the input signal using a phase vocoder according to a given alignment.