pyampact.alignmentUtils.f0_est_weighted_sum_spec

pyampact.alignmentUtils.f0_est_weighted_sum_spec(filename, noteStart_s, noteEnd_s, midiNote, y, sr, useIf=True)[source]

Calculate F0, power, and spectrum for a single note.

Parameters:
  • filename (str) – Name of the WAV file to analyze.

  • noteStart_s (float) – Start position (in seconds) of the note to analyze.

  • noteEnd_s (float) – End position (in seconds) of the note to analyze.

  • midiNote (int) – MIDI note number of the note to analyze.

  • y (np.ndarray) – Audio time series data from the WAV file.

  • sr (int) – Sample rate of the audio signal.

  • useIf (bool, optional) – If true, use instantaneous frequency; otherwise, use spectrogram frequencies. Defaults to True.

Returns:

  • f0 (np.ndarray) – Vector of estimated F0s from noteStart_s to noteEnd_s.

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

  • M (np.ndarray) – Estimated spectrum for the analyzed note.