How to find the peak in the array?

I am making a pitch determination program using fft. To get the pitch, I need to find the lowest frequency, which is much higher than the noise level.

All results are presented in an array. Each position is for frequency. I do not know how to find the peak.

I am programming in C #.

Here is a screenshot of the frequency analysis in boldness. alt text

+3
source share
3 answers

, low, , , 5 . , , . . :).

N.B. 1024 44,1 . 44,1 /1024 = 43 . 44,1 , ~ 50 2048 . ~ 21 .

Matlab 'psd' 2048 PSD.

% 50 Hz (Dude) -> 50Hz/44100Hz * 2048 -> ~2 Lower Lim
% 300 Hz (Baby) -> 300Hz/44100Hz * 2048 -> ~14 Upper Lim
lower_lim = 2;
upper_lim = 14
for fund_cand = lower_lim:1:upper_lim
    i_first_five_multiples = [1:1:5]*fund_cand;
    sum_energy = sum(psd(i_first_five_multiples));
end

, sum_energy.

+2

, - , :

  • ( ) . .
  • , .
  • . , .

2 3 . , , , 2xnoise.


, :

, . , 30 10 - .

+2

, . : (AMDF, ASDF lag), cepstrum (FFT log FFT), , , , (RAPT, YAAPT, et.al.).

:

However, you can guess the frequency, calculate the average and standard deviation of the spectral values, for example, in the 2 to 1 frequency range around your guess, and see if there is a peak well above the average (2 sigma?). Rinse and repeat for a number of frequency guesses and see which one or the lowest of the few has a peak that stands out most from the average. Use this peak.

+2
source

Source: https://habr.com/ru/post/1776085/


All Articles