Distinguish harmonic sounds from non-harmonic I am trying to distinguish harmonic sounds in the range from $100\rm \ Hz$  to $1000\rm \ Hz$ in my audio recording.

I attach the spectrogram ($y$-axis is freqeuncy and $x$-axis is time) of a typical audio recording. The red square shows the harmonic sounds I want to distinguish, whereas the green one - the random sounds which I want to omit.



I can clearly see the harmonic components and consistent high-power fundamental frequency in the wanted sounds, while random sounds are not harmonic and frequency range is cluttered with low-power components.

My question is, how do I distinguish them?

I was thinking of calculating THD for both and selecting only the high results as harmonic sounds seem to carry more power, however, that's not always the case.
A standard difference between harmonic and non-harmonic sounds is that harmonic sounds tend to be periodic (in the time domain) in nature whereas non-harmonic sounds don't show any periodic properties since they're completely random. 

One initial method you could try is simply performing autocorrelation in the time domain to see whether that portion of your signal is periodic. This could help you differentiate between the different sounds. There are definitely more complicated ways to test this. You could go to the extent of training a machine learning model based on certain features in the audio signal. But maybe you could just give the autocorrelation a try and see how well it performs for your application.