I got an audio wave file which is a short piece of a song.
My data is an array of sampled wave (e.g. [-8193 -8445 -8697 -7941 -6680 -4915 ... 9201 8193 6932]
), which looks like:
There are a lot of repeated patterns here and each pattern has a certain frequency. I want to extract the changing frequency so that I can get the changing pitch of the song.
However, there are multiple cycles and the pattern keeps changing. I wonder how to separate each cycle from this continuous wave.
EDIT A lot of comments mentions using FFT and finding the max one as the fundamental frequency.
I did try that and here is the result of numpy.fft(signal)
:
I have few doubts about that:
- Should I find the maximum one based on the original value of Fourier or the absolute one.
- If the wave file becomes longer, the frequency of the audio might change in a single wave file. We can only find one frequency of this wave file, which is unreasonable.
Comments
Post a Comment