Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you programmatically detect white noise?

Tags:

java

android

The Dell Streak has been discovered to have an FM radio which has very crude controls. 'Scanning' is unavailable by default, so my question is does anyone know how, using Java on Android, one might 'listen' to the FM radio as we iterate up through the frequency range detecting white noise (or a good signal) so as to act much like a normal radio's seek function?

like image 465
Antony Koch Avatar asked Oct 07 '10 11:10

Antony Koch


People also ask

How do I know if my signal is white noise?

You can use autocorr() to find out if the signal is white noise or not. The autocorrelation of a continuous white noise signal has a strong peak (Dirac delta function) at t=0, and is 0 for all t unequal 0.

What is white noise in audio?

Similarly, white noise is a combination of all of the different frequencies of sound – such as all of the imaginable tones that a human can hear, played together at the same time. White light is us seeing all colors at the same time. White noise is us hearing all frequencies at the same time.


2 Answers

I have done some practical work on this specific area, i would recommend (if you have a little time for it) to try just a little experimentation before resorting to fft'ing. The pcm stream can be interpreted very complexely and subtly (as per high quality filtering and resampling) but can also be practically treated for many purposes as the path of a wiggly line.

White noise is unpredictable shaking of the line, which is never-the-less quite continuous in intensity (rms, absolute mean..) Acoustic content is recurrent wiggling and occasional surprises (jumps, leaps) :]

Non-noise like content of a signal may be estimated by performing quick calculations on a running window of the pcm stream.

For example, noise will strongly tend to have a higher value for the absolute integral of its derivative, than non-noise. I think that is the academic way of saying this:

loop(n+1 to n.length) { sumd0+= abs(pcm[n]);    sumd1+= abs(pcm[n]-pcm[n-1]);  }  wNoiseRatio = ?0.8; //quite easily discovered, bit tricky to calculate.  if((sumd1/sumd0)<wNoiseRatio) { /*not like noise*/ } 

Also, the running absolute average over ~16 to ~30 samples of white noise will tend to vary less, over white noise than acoustic signal:

loop(n+24 to n.length-16) { runAbsAve1 += abs(pcm[n]) - abs(pcm[n-24]); }  loop(n+24+16 to n.length) { runAbsAve2 += abs(pcm[n]) - abs(pcm[n-24]); }  unusualDif= 5; //a factor. tighter values for longer measures.  if(abs(runAbsAve1-runAbsAve2)>(runAbsAve1+runAbsAve2)/(2*unusualDif)) { /*not like noise*/ } 

This concerns how white noise tends to be non-sporadic over large enough span to average out its entropy. Acoustic content is sporadic (localised power) and recurrent (repetitive power). The simple test reacts to acoustic content with lower frequencies and could be drowned out by high frequency content. There are simple to apply lowpass filters which could help (and no doubt other adaptions).

Also, the root mean square can be divided by the mean absolute sum providing another ratio which should be particular to white noise, though i cant figure what it is right now. The ratio will also differ for the signals derivatives as well.

I think of these as being simple formulaic signatures of noise. I'm sure there are more.. Sorry to not be more specific, it is fuzzy and imprecise advice, but so is performing simple tests on the output of an fft. For better explaination and more ideas perhaps check out statistical and stochastic(?) measurements of entropy and randomness on wikipedia etc.

like image 150
strainer Avatar answered Oct 02 '22 11:10

strainer


Use a Fast Fourier Transform.

This is what you can use a Fast Fourier Transform for. It analyzes the signal and determines the strength of the signal at various frequencies. If there's a spike in the FFT curve at all, it should indicate that the signal is not simply white noise.

Here is a library which supports FFT's. Also, here is a blog with source code in case you want to learn about what the FFT does.

like image 43
Erick Robertson Avatar answered Oct 02 '22 12:10

Erick Robertson