I'm having slight difficulties in inferring all the details of the HMM part in Probabilistic YIN (http://eecs.qmul.ac.uk/~simond/pub/2014/MauchDixon-PYIN-ICASSP2014.pdf) in order to understand the whole HMM prior to the Viterbi. This hasn't been clarified in an earlier question:

Pitch detection, YIN, pYIN

I think the discussion is decent, but I've particularly got stuck to the HMM part now. My own problems are:

p. 3

$p_{m,v}$ refers to $P^{*}_k$, which is not defined anywhere. I assume that this is $p^{*}_k$, i.e. sum over the original sparse observation vector without the element we considered in $v=1$ case, i.e. $(p^{*}_m) \setminus p^{*}_{m_{\space of\space 0.5 \cdot p^{*}_m}}$.

The discussion related to voices seems reasonably clear to me, but the transitioning on voices and pitches causes confusion.

Particularly, $p_{ij}=P(pitch_t=j | pitch_{t-1} = i)$ is said to be realized as a triangular weight distribution. What does this mean in the context of a HMM? The states were supposed to be the pitch observations. Now it talks that there is "transition probability between two states defined by pitch and voicedness". Does this mean that the probability of a pitch becoming another pitch is a random draw from such distribution?

It's a bit sad that the paper doesn't have any state diagrams; they could make inferring this part of the paper easier.

If you notice any other confusions with this HMM part, it'd be perhaps helpful to add them to your answer (or the a linked question), and preferably, if you can, also offer a clarification for it. I presume that I'm not the only person having difficulties with this particular paper.


1 Answer 1


I am also having trouble understanding the PYIN paper. I have not quite taken the time to understand the transition probabilities, however, I referred to the Librosa[1] library to try and understand the implementation of Equation 6 from the paper.

My understanding of Equation 6 is the difference between unity and the sum of the voiced probabilities assigned to discreet frequency bins (i.e., for the unvoiced state). Essentially, $P^*_k$ is the sparse observation vector, $p^*_m$, with the element we considered in $v=1$.

The basis of my understanding is from the code extract below from the Librosa[1] library.

# Observation probabilities.
observation_probs = np.zeros((2 * n_pitch_bins, yin_frames.shape[1]))
observation_probs[bin_index, frame_index] = yin_probs[yin_period, frame_index]

voiced_prob = np.clip(
    np.sum(observation_probs[:n_pitch_bins, :], axis=0, keepdims=True), 0, 1
observation_probs[n_pitch_bins:, :] = (1 - voiced_prob) / n_pitch_bins

[1] Librosa.org. (2014). librosa.core.pitch — librosa 0.10.1dev documentation. [online] Available at: https://librosa.org/doc/main/_modules/librosa/core/pitch.html#pyin [Accessed 15 Apr. 2023].


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.