I'm trying to extract the frequency of a note from an mp3 file that includes a synthesized sample of an A3 note, which should be 220 Hz.
This is part of the waveform I obtain using librosa
:
As you can see, the wave seems to repeat itself every 400 samples. Therefore, by dividing the sampling rate, which is 22050 Hz, by 400 I should get the frequency of the waveform. However, I get 55.125 Hz instead of 220. Am I missing something or making a mistake?
EDIT: Here's the code I'm using
import librosa
from matplotlib import pyplot as plt
import numpy as np
%matplotlib notebook
y, sr = librosa.load("Simple_synth/A3-saw.mp3")
plt.figure(figsize=(18,6))
plt.plot(y[2000:3000])
note_freq = sr/400
Link to the audio file: https://www.filefactory.com/file/7aqmrvq375n9/A3-saw.mp3