In a previous article I described the goal, which was to do a simple tool to measure the fundamental frequency of a simple sine wave. In this article, I describe the implementation, which is based on 2 open source libraries:
- lib FFTW for Fourier calculation
- libsndfile for wav file parsing
Continue reading “FFT based frequency calculation (implementation)”
Determining the frequency of a sinusoidal waveform can be achieved using an FFT based method. If we restrain ourselves to the simple case where the waveform is made of one single sine wave, then the fundamental frequency (f0) is indeed what we call the “waveform frequency”.
If that is the case, a simple FFT would allow isolating the frequency peaks. An histogram would then detect the highest one: the fundamental frequency. Again, this is valid only for this kind of waveforms. We can even tolerate some level of harmonics which are due to distortions.
Continue reading “FFT based frequency calculation (algorithm)”