pyampact.alignment.ifgram

pyampact.alignment.ifgram(audiofile, tsr, win_ms, showSpec=False)[source]

Compute the instantaneous frequency (IF) spectrogram of an audio file using the reassigned spectrogram and Short-Time Fourier Transform (STFT).

Parameters:
  • audiofile (str) – Path to the audio file to be analyzed.

  • tsr (int) – Target sample rate of the audio signal.

  • win_ms (float) – Window size in milliseconds for spectral analysis.

  • showSpec (bool, optional) – If True, displays the spectrogram of the reassigned spectrogram. Default is False.

Returns:

  • freqs (ndarray) – Reassigned frequency bins of the spectrogram.

  • times (ndarray) – Time frames corresponding to the spectrogram.

  • mags (ndarray) – Magnitudes of the reassigned spectrogram.

  • f0_values (ndarray) – Fundamental frequency estimates for each time frame.

  • mags_mat (ndarray) – Magnitude matrix from the Short-Time Fourier Transform (STFT).