SoX Noise Generation

SoX Noise Generation

In my last post I suggested creating noise and using a band of it to fill in a band gap. SoX provides a way to generate noise. There are different types of noise that SoX will generate. Lets take a moment to look at these types and what applications noise generation is used for.

There are 3 main types of noise that SoX will generate, they are white, pink, and brown. White noise is a random signal that has equal intensity at different frequencies, basically a flat signal intensity across the frequency band. Pink noise signal intensity is inversely proportional to the frequency of the signal, basically a linear decreasing signal intensity across the frequency band. Brown noise (commonly known as Red or Brownian) has an exponential decrease of signal intensity across the frequency band. There are other noise types beyond what SoX will generate, these can be found here, https://en.wikipedia.org/wiki/Colors_of_noise

Noise can be used to evaluate the frequency response of electronic circuitry. The characteristics of the resulting signal can indicate how a circuit is functioning. Noise is also used for evaluating acoustics of a space. Different materials will absorb and reflect frequencies that are unique to their properties. Noise can be used in computation for random number generation, however the noise is mostly gathered from nature and isn’t generated by a computer. It can also be used as therapy for hearing loss and as a rest aid. One other application is its use as a mask or signal suppressor, which was what my previous post eluded to.

Here are the SoX commands to create 10 second audio files with the different noise types.

sox -n whitenoise.wav synth 10 whitenoise
sox -n pinknoise.wav synth 10 pinknoise
sox -n brownnoise.wav synth 10 brownnoise

SoX also provides a way to generate the noise in real-time for a specified duration. These examples output noise types for a duration of 1 hour each.

play -n synth 60:00 whitenoise
play -n synth 60:00 pinknoise
play -n synth 60:00 brownnoise

The SoX examples given thus far generate a noise that is mono, meaning the left and right channels are identical. In this example, we’ll generate noise for each left and right channel and merge them together for a single stereo output.

play -n -n --combine merge synth '24:00:00' brownnoise
play -n -n --combine merge synth '24:00:00' brownnoise band -n 750 750 tremolo 50 1

Thanks goes to http://unreasonable.org/white_noise_generator_with_sox_for_Linux for providing tips along the way. The ability for SoX to generate random noise can prove to be useful for diagnostics or other testing purposes. I hope you have enjoyed and found this informative.

Comments are closed.