2

I have a audio file consisting of multiple frequencies, I need to find all the frequency peaks in the frequency spectrum after doing FFT. But the issue is how can I be able to set the threshold line for the peaks. enter image description here freq-spectrum

As you can clearly see I need to find all the peaks of this spectrum but sometimes amplitude is very high and sometimes it is too low so how will we be able to know the exact frequencies present inside audio.

If we set amplitude threshold to 0.5 the peak present at 17000Hz will not count but if we set it too low then in other cases when noises becomes larger and will be counted.

astrick
  • 190
  • 1
  • 9
  • if you have sufficient time you could identify this threshold by by first picking an arbitrary amplitude threshold then once freqs above that threshold are identified take that list of freqs and to an inverse Fourier Transform on them to synthesize audio then feed that audio into a normal FFT call to once again generate your above chart and determine whether this newly generated FFT plot sufficiently matches your original FFT dataset as plotted above ... repeat this loop and adjust the amplitude threshold until a sufficient match happens at which point you have identified the correct threshold – Scott Stensland Jan 12 '21 at 13:07
  • @ScottStensland But will it work when the complete graph is scaled 5 or 10 times? Because that might happen when the sound source is nearby. All the values will be enhanced along with noise. – astrick Jan 12 '21 at 13:12
  • beautiful thing about Fourier Transform is you can move your data without much loss of fidelity from audio ( time domain ) into a FFT call which returns an array of freq bins ( frequency domain ) ... then this freq domain data array can be fed into an inverse Fourier Transform which will return back a new array with the data in the time domain ... you can cycle through this with little loss of accuracy ... so yes this approach handles any given initial condition of your data and this loop back approach is a form of a closed feedback loop – Scott Stensland Jan 12 '21 at 14:50

0 Answers0