Smoothed local sparsity
The smoothed local sparsity (SLS) is a combination method based local information. It employs a local sparsity measure (Gini index) and a local energy measure in its combination procedure. The SLS requires sorting samples in each neighborhood to compute the Gini index, which makes this method computationally costly, particularly because computational tricks used in the Lukin-Todd method to speed up the sorting process cannot be applied here. Instead of the SLS in its base form, this package provides two approximations that are computationally more efficient: the hybrid smoothed local sparsity (SLS-H) and the smoothed local sparsity with interpolation (SLS-I). The SLS-H uses a local energy criterium to compute the SLS only in high-energy regions, defaulting to a binwise minimum elsewhere. The SLS-I interpolates the local sparsity to reduce the number of neighborhoods that need to be sorted.
Note
It’s highly recommended to use NumPy version 2.0 or higher for this combination method, as the performance of the sorting procedure is improved substantially.
Further reading
Package release article (and SLS-H/SLS-I reference paper): To be added.
D.Sc. thesis on combination methods: M. do V. M. da Costa, Novel time-frequency representations for music information retrieval, D.Sc., Federal University of Rio de Janeiro, Rio de Janeiro, Brasil (2020 Apr.).
LS reference paper: M. do V. M. da Costa and L. W. P. Biscainho, “Combining time-frequency representations for music information retrieval,” in 15th AES-Brasil Engineering Congress. Florianópolis, Brazil: Audio Engineering Society, Oct. 2017, pp. 12–18.
SLS reference paper: M. do V. M. da Costa, I. Apolinário, and L. W. P. Biscainho, “Sparse time-frequency representations for polyphonic audio based on combined efficient fan-chirp transforms,” Journal of the Audio Engineering Society, vol. 67, no. 11, pp. 894–905, Nov. 2019.
Calling signature
- ctfr.methods.sls_h(signal, sr, *, <shared parameters>, lek, lsk, lem, lsm, beta, energy_criterium_db)
- ctfr.methods.sls_h_from_specs(specs, *, <shared parameters>, lek, lsk, lem, lsm, beta, energy_criterium_db)
- ctfr.methods.sls_i(signal, sr, *, <shared parameters>, lek, lsk, lem, lsm, beta, interp_steps)
- ctfr.methods.sls_i_from_specs(specs, *, <shared parameters>, lek, lsk, lem, lsm, beta, interp_steps)
Note
As with all combination methods, you can also use ctfr.ctfr() or ctfr.ctfr_from_specs().
See ctfr.ctfr() and ctfr.ctfr_from_specs() for more details on the shared parameters for computing CTFRs with this package. The parameters specific to this method (passed as keyword arguments) are described below.
Parameters
lek (int > 0, odd, optional)
Width in frequency bins of the analysis window used in the local energy computation. Defaults to 21.
lsk (int > 0, odd, optional)
Width in frequency bins of the analysis window used in the local sparsity computation. Defaults to 21.
lem (int > 0, odd, optional)
Width in time frames of the analysis window used in the local energy computation. Defaults to 11.
lsm (int > 0, odd, optional)
Width in time frames of the analysis window used in the local sparsity computation. Defaults to 11.
beta (float >= 0, optional)
Factor used in the computation of combination weights. Defaults to 0.3.
energy_criterium_db (float, optional)
Local energy criterium (in decibels) that distinguishes high-energy regions (where LS is computed) from low-energy regions (where binwise minimum is computed). Defaults to -40. Specific to sls_h.
interp_steps (ndarray of int, shape P x 2, optional)
Interpolation steps to use when computing the local sparsity. interp_steps[p, i] refers to the interpolation step of axis i (frequency is 0, time is 1) for spectrogram p. When calling
ctfr.ctfr()(orctfr.methods.sls_i()),interp_steps[p]defaults to[n_fft // l, l // (2 * hop_length)]. When callingctfr.ctfr_from_specs()(orctfr.methods.sls_i_from_specs()), this argument must the provided by the user. Specific to sls_i.