spafe.frequencies.dominant_frequencies

Reference:
https://dsp.stackexchange.com/questions/40180/the-exact-definition-of-dominant-frequency https://arxiv.org/pdf/1306.0103.pdf
spafe.frequencies.dominant_frequencies.get_dominant_frequencies(sig, fs, butter_filter=False, lower_cutoff=50, upper_cutoff=3000, nfft=512, win_len=0.025, win_hop=0.01, win_type='hamming', debug=False)[source]

Returns a list of dominant audio frequencies of a given wave file.

Parameters:
  • sig (array) – name of an audio file name.
  • fs (int) – sampling rate (= average number of samples pro 1 sec)
  • butter_filter (bool) – choose whether to apply a Butterworth filter or not. Default is False.
  • lower_cutoff (int) – filter lower cut-off frequency. Default is 50.
  • upper_cutoff (int) – filter upper cot-off frequency. Default is 3000.
  • nfft (int) – number of FFT points. Default is 512,
  • win_len (float) – window length in sec. Default is 0.025.
  • win_hop (float) – step between successive windows in sec. Default is 0.01.
  • win_type (float) – window type to apply for the windowing. Default is “hamming”.
  • debug (bool) – choose whether to plot the results or not. Default is False
Returns:

array of dominant frequencies.

Return type:

(array)