Librosa pitch tracking - STFT

前端 未结 2 1191
一生所求
一生所求 2021-01-04 04:23

I am using this algorithm to detect the pitch of this audio file. As you can hear, it is an E2 note played on a guitar with a bit of noise in the background.

I gene

2条回答
  •  既然无缘
    2021-01-04 05:02

    Turns out the way to pick the pitch at a certain frame t is simple:

    def detect_pitch(y, sr, t):
      index = magnitudes[:, t].argmax()
      pitch = pitches[index, t]
    
      return pitch
    

    First getting the bin of the strongest frequency by looking at the magnitudes array, and then finding the pitch at pitches[index, t].

提交回复
热议问题