How is noise generated?

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help menu > About Audacity".


Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

How is noise generated?

Post by Piotr Grochowski » Sat Mar 31, 2018 6:48 pm

I'm curious how noise is generated. My guess is that noise of length x seconds is generated by adding up sine waves in increments of 1÷x and random phases, then normalized to the desired volume, and that pink and brown noise is made by varying the volume of the sine waves.

kozikowski
Forum Staff
Posts: 69374
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: How is noise generated?

Post by kozikowski » Sat Mar 31, 2018 6:52 pm

White is equal energy per frequency. Pink is equal energy per octave. I'm not sure what brown is.

The question is what happens at the extreme upper end where the tone generations runs into Nyquist limits.

Koz

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: How is noise generated?

Post by Piotr Grochowski » Sat Mar 31, 2018 7:17 pm

I already know that. But the question is how the noise is generated, and not what properties the generated noise has.

DVDdoug
Forum Crew
Posts: 9419
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: How is noise generated?

Post by DVDdoug » Sat Mar 31, 2018 9:15 pm

Digital audio is a sequence of numbers (samples) and white noise is just a series of random numbers. You can filter it to get pink noise, etc.

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: How is noise generated?

Post by Piotr Grochowski » Sun Apr 01, 2018 5:09 am

A sequence of random numbers?! That seems like an awful way to generate white noise. Suppose that by chance, this noise function generates a song. This is definitely not a uniform white noise.

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: How is noise generated?

Post by steve » Sun Apr 01, 2018 11:53 am

white noise is a discrete signal whose samples are regarded as a sequence of serially uncorrelated random variables with zero mean and finite variance
https://en.wikipedia.org/wiki/White_noise
To put that into layman's terms, it's a series of random sample values.
For a detailed understanding, see the code: https://github.com/audacity/audacity/bl ... /Noise.cpp
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: How is noise generated?

Post by Piotr Grochowski » Sun Apr 01, 2018 2:12 pm

steve wrote:
white noise is a discrete signal whose samples are regarded as a sequence of serially uncorrelated random variables with zero mean and finite variance
https://en.wikipedia.org/wiki/White_noise
To put that into layman's terms, it's a series of random sample values.
For a detailed understanding, see the code: https://github.com/audacity/audacity/bl ... /Noise.cpp
As I said, independent random samples generate an awful white noise. A proper whitenoise generation would go like this, where x is the number of seconds of the noise

generate a new floating point sine wave of 1÷x Hz–frequency, x seconds
generate a new floating point sine wave of 2÷x Hz–frequency, x seconds
generate a new floating point sine wave of 3÷x Hz–frequency, x seconds
...
generate a new floating point sine wave of (floor(Nyquist×x))÷x, x seconds
execute the feature called "Mix" "and" "Render"
execute the feature called "Normalize..."
convert to 16-bit PCM, 24-bit PCM or float depending on userpreference

For pink noise and brown noise, adjust the volume of higher frequencies

steve
Site Admin
Posts: 81627
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: How is noise generated?

Post by steve » Sun Apr 01, 2018 3:03 pm

No, that is nonsense. I'd suggest that you learn about acoustics and signal processing before telling others of your uniformed opinions.
This article is Wikipedia is a reasonable place to start: https://en.wikipedia.org/wiki/White_noise
For a more advanced article, there is this article available from the Audio Engineering Society library for $33: http://www.aes.org/e-lib/browse.cfm?elib=668
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Piotr Grochowski
Posts: 364
Joined: Fri Jun 23, 2017 12:45 pm
Operating System: Windows 10

Re: How is noise generated?

Post by Piotr Grochowski » Sun Apr 01, 2018 4:12 pm

steve wrote:No, that is nonsense. I'd suggest that you learn about acoustics and signal processing before telling others of your uniformed opinions.
This article is Wikipedia is a reasonable place to start: https://en.wikipedia.org/wiki/White_noise
For a more advanced article, there is this article available from the Audio Engineering Society library for $33: http://www.aes.org/e-lib/browse.cfm?elib=668
What do you mean by "the nonsense"? White noise is supposed to have equal volume per a fixed linear-size frequency band. Generating a random sound is very dangerous; there is a 1 in 10¹⁰⁰⁰⁰⁰ chance that it's possible to hear the The Mine Song song in a one minute 6000Hz noise generated by randomness; a hearable song in a generated noise is definitely a sign of a non-uniform white noise.

DVDdoug
Forum Crew
Posts: 9419
Joined: Fri Sep 10, 2010 11:30 pm
Operating System: Windows 10

Re: How is noise generated?

Post by DVDdoug » Sun Apr 01, 2018 4:20 pm

A sequence of random numbers?! That seems like an awful way to generate white noise.
Think about the reverse... If you digitize analog white noise you'll get a sequence of random sample values (constrained in amplitude by the format/bit-depth).
Suppose that by chance, this noise function generates a song.
And a monkey at a typewriter might write The Bible (or just a short story)... Or you might paint the Mona Lisa by throwing paint at the wall. In the real world it doesn't happen... Randomness/chaos is usually obvious and computer-generated (pseudo) randomness sounds like white noise.

Some people do "hear voices" buried in white noise (or pink noise) but this is psychological (or some people think it's paranormal ;) ). You NEVER get a "clear sounding" voice or a clear sounding tone/song, etc.



P.S.
If you import an MP3 into Audacity as "Raw Data" it's obviously not random but without proper MP3 decoding it's disorganized/chaotic and it sounds like white noise. The same thing will happen with almost any non-audio file.

Locked