pyampact.alignmentUtils.f0_est_weighted_sum

pyampact.alignmentUtils.f0_est_weighted_sum(x, f, f0i, fMax=5000, fThresh=None)[source]

Calculate F0, power, and spectrum for an inputted spectral representation.

Parameters:
  • x (np.ndarray, shape (F, T)) – Matrix of complex spectrogram values, where F is the number of frequency bins and T is the number of time frames.

  • f (np.ndarray, shape (F, T)) – Matrix of frequencies corresponding to each of the spectrogram values in x.

  • f0i (np.ndarray, shape (1, T)) – Initial estimates of F0 for each time frame. This should be a 1D array containing the F0 estimates for each time point.

  • fMax (float, optional) – Maximum frequency to consider in the weighted sum. Defaults to 5000 Hz.

  • fThresh (float, optional) – Maximum distance in Hz from each harmonic to consider. If not specified, no threshold will be applied.

Returns:

  • f0 (np.ndarray) – Vector of estimated F0s from the beginning to the end of the input time series.

  • p (np.ndarray) – Vector of corresponding “powers” derived from the weighted sum of the estimated F0.

  • strips (np.ndarray) – Estimated spectrum for each partial frequency based on the weighted contributions.