I have to quantify the broadband noise of an audio track.

I've seen lots of things around and the only viable option to estimate the broadband noise (without having any information about it) is something like that:

noise=0;
sig=0;
for i=in:fin
nois(j)=(abs((min(B(:,i)).^2)));
sign(j)=(abs((max(B(:,i)).^2)));
j=j+1;
end
snr=var(sign)/var(noise)


Where B is the matrix of the spectrogram.

So, I'm doing FFT analysis of the audio, finding the minimum amplitude for each bin for an approximation of the noise floor and the maximum amplitude for an approximation of the signal. Then I'm doing the variances of both vectors and finally making a simple signal to noise calculation.

I know it's not a very sophisticated method but things previously tried have not worked. This gives me more solid results but it doesn't work for all kinds of genres.

Has someone something more to suggest me to improve this algorithm? Other approaches that work better?

• I don't know if you are measuring static broadband noise that stays constant throughout the recording or transient noise effects which may return to silence at different times in the track... the first case seems easier, you have to measure all the frequency peaks throughout the track, and compare how high the broadband freq peaks are from beginning to end to establish if they are background noise or audio recordings. – com.prehensible Apr 18 '16 at 3:55
• Yes, it's the first case! That's my biggest problem.. to establish if it's background noise or music! – rickowens Apr 18 '16 at 13:34
• @ufomorace so you mean, measure all frequency peaks all along the track.. and then? :( how can I establish if it's background noise or music? – rickowens Apr 18 '16 at 13:35
• I studied the spectrogram of my signals where my algorithm fails.. and I noticed that in the graph of the false negatives there are steeper changes in frequency. – rickowens Apr 18 '16 at 13:37

The algorithm is basically based on the assumption that noise is "white", ie. in the expectation value, the noise energy in every DFT bin is equal. Under that assumption, and assuming a "long enough" observation, there has to be the same noise floor in every bin.

Sound on the other hand, is a highly correlated signal. So the assumption is that there's at least one DFT bin at a time where there's no significant sound signal.

As you might imagine, that's a bit of an oversimplification on both sides: There's a lot of music that actually uses Noise, or broadband signals, and audio noise typically is everything but white.

In essence: this boils down to the good ol' "What is my SNR?" question:

You, as the DSP designer, will have to model your signal, and your noise. After that, the question kind of answers itself. It's really more of a question of semantics than engineering: For example, take psychedelic rock/stoner/doom metal: wideband noise in the string instrument's track is very essential to that genre; is it noise, then? And if you get a recording of a classical guitar piece, wouldn't you consider the same noise in the signal part of the noise or music energy?

• yes! I completely understand it. My problem is that I don't know how can I algorithmically characterize the various types of noise that afflict my signals. – rickowens Apr 17 '16 at 17:15
• Do I have to study the spectrogram of my signals where my algorithm fails? – rickowens Apr 17 '16 at 17:16
• @rickowens if you want to stay with the power spectral density based method, I guess so. – Marcus Müller Apr 17 '16 at 17:30
• Do you think there are more efficient methods for estimating the broadband noise of an audio track without knowing anything about the track? I can't find anything better. – rickowens Apr 17 '16 at 17:47
• @rickowens the core of my answer was: define your signal and your noise; only you can do that. So no, I don't have a better idea. – Marcus Müller Apr 17 '16 at 17:49