randomized white noise = white noise?

If I take a 1 second long digital sample of white noise, and play back the bytes in random order, do I still get white noise? Since the bytes are random to begin with, it shouldnt matter what order I play them right?

What if its pink noise?

And what if its white noise but filtered in an unusual way so that there are arbitrary peaks and valleys?

markp suggested this

Reply to
acannell
Loading thread data ...

If the random order is really uncorrelated with the signal contained in the data stream, and there is no dependence of the sample you take next to what was taken before, you should end up with a spectral distribution with the same characteristics as the same size set of samples of white noise--it will, of course, be band limited by the sampling rate and length of the stream. You will end up with white noise even if you start with a spectrally pure tone. You will have whatever amplitude distribution is in the data, assuming you take each point once and only once. Try it. It's reasonably easy in Scilab or Matlab.

Reply to
Tom Bruhns

Where do you get your random replay order from? White noise too?

--DF

Reply to
Deefoo

Heyy, could you use the unsigned or absolute value of the sample to advance to the next sample?

You'd have to check that the samples don't get stuck in a loop.. probably not, but there could be some samples that are skipped over, wasting memory.

Tim

--
Deep Fryer: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
Reply to
Tim Williams

As others have pointed out already, a Dirac-delta autocorrelation remains Dirac-delta regardless of the sample ordering.

Pink noise is a combination of white noise (Dirac-delta correlated) and 1/f noise (logarihmic autocorrelation). This becomes purely white noise if sample order gets scrambled.

Regards, Mikko

Reply to
Mikko Kiviranta

"Mikko Kiviranta"

** Huh ?

Pink noise has the same energy distribution as 1/f noise.

...... Phil

Reply to
Phil Allison

You are right, in a standard therminology it appears to be pure 1/f without a white component. My mistake stems from an old memory about a spectrum analyzer sold years ago for HiFi enthusiasts, (for positioning loudspeakers in the listening room, etc) which emitted

1/f + white noise. This was called "pink" noise in the instruction booklet, which also makes sort-of sense because pink is a combination of red and white. But at least Wikipedia seems to associate pink with purely 1/f, as you say.

Acannell, even purely 1/f becomes (with an overwhelming probability) white noise when scrambled, because the original logarithmic autocorrelation is not preserved. And most (all non-conspiring) ways to perform re-ordering result in a Dirac-delta autocorrelation.

Regards, Mikko

Reply to
Mikko Kiviranta

"Mikko Kiviranta"

** Well, " red noise " results when white noise is passed through a LPF with a constant - 6dB per octave slope.

Its energy distribution is then proportional to 1 / f squared.

IMO - the notion that pink noise can be created by mixing one red and white is a bit fanciful.

Like making "Rose" by adding a dash of Claret to a glass of Moselle.

........ Phil

Reply to
Phil Allison

I think it goes a bit deeper than your opinion, Phil. ;-) If the two noise sources are uncorrelated and extend spectrally far enough, at low enough frequencies the "red" will dominate and contribute more energy per unit bandwidth, and at high enough frequencies, the "pink" will dominate. It's just summing the energies of each in each spectral increment. It would be more complicated than a simple sum if they are correlated, but the correlation cannot be very strong with different spectral shapes anyway.

Cheers, Tom

Reply to
Tom Bruhns

"Tom Bruhns"

** Surely you know how to post properly by now ?

The Google Groups way is not acceptable on usenet.

** My opinions are deeper that you think.
** The postulated "mix" was between *red* and *white* - remember ?

Be easier to keep track if you didn't NOT snip the other person's words out of sight !

Anyhow, as you have just agreed, summing will not generate *pink noise* from the other "colours".

Unlike with wines.

** How insightful.

........ Phil

Reply to
Phil Allison

so does this mean I could create pink noise from a red noise and white noise source? but making the red noise source is just as hard as making the pink noise source i suppose.

Reply to
acannell

This is a very good question--if you do sampling with replacement (i.e. you can choose the same sample more than once) you'll probably get fewer artifacts. This is done e.g. in bootstrap sampling.

Cheers,

Phil Hobbs

Reply to
Phil Hobbs

Any attempt at making a signal "more" random will almost certainly do the exact opposite.

--
Many thanks,

Don Lancaster                          voice phone: (928)428-4073
Synergetics   3860 West First Street   Box 809 Thatcher, AZ 85552
rss: http://www.tinaja.com/whtnu.xml   email: don@tinaja.com

Please visit my GURU\'s LAIR web site at http://www.tinaja.com
Reply to
Don Lancaster

Oh, bull, Don. If you multiply a sinewave, or a DC level, by a good random signal, the result will certainly be more random (have energy distributed more uniformly across the spectrum, and have less correlation from sample to sample) than the sinewave or DC level. In the case of the sinewave, of course, the time-domain then looks like random in a sine envelope. Re-ordering samples of a DC level does not randomize it, of course, but randomly reordering samples of a sine results in spectrally flat output, though with the same amplitude distribution as the original sinewave of course.

Sampled-domain pink noise or noise filtered with "arbitrary peaks and valleys" in the spectrum is no longer random; it has correlation from sample to sample. Randomly reordering the samples removes that correlation. XOR-ing digitized samples of any signal with uncorrelated random digital samples will likewise result in a signal with statistically constant energy per unit bandwidth.

There are even a few examples of combinations of random generators that yield "better" randomness, though as you noted, it's only "almost certainly" in that case...

Cheers, Tom

Reply to
Tom Bruhns

There must be some way to generate the arbitrarily shaped noise spectra using a simple algorithm and some pre-made tables or random numbers. I generate it now using a program I wrote which takes the desired energy at a given frequency, and creates a sine wave with that amplitude and frequency and then sums it into the output array. Repeat this every 1hz from 20hz to 20khz (my desired spectrum) and you get the custom made noise spectra I need. I have this feeling there is a way to do this without all the floating point math and very intensive cpu usage (about

1 hour to generate 1 second of audio on my pentium III 750mhz in straight C). I visualize 20,000 oscillators whose output is all summed. The output is 8 bits. So for every sample, cant we just say "well, it can only be one of 256 possibilities", and narrow it down somehow? There must be a faster simpler way to do this. I want to make a small device which generates this custom noise, but I dont want to pay for 4 megabits of flash, plus, a digital sample of this noise cannot be looped because you can hear the loop frequency. It needs to be generated from scratch somehow. I dont think I can make a set of analog filters to do it, because there are peaks and valleys and it would make the design much less flexible to changes. Plus it would probably cost as much or more as the flash since I would almost certainly need inductors and or opamps.

Let me put it this way. Is there a way to "simplify" the output of

20,000 frequency generators? Lets say that 2000 of them all have the same amplitude, can I group them together somehow so its faster to generate their output?
Reply to
acannell

In Wikipedia, this seems also be called brown noise, after Brownian motion.

I think all the other descriptions beyond "white" are more or less arbitrary. I prefer expressing explicitly the shape of the power spectrum.

Regards, Mikko

Reply to
Kiviranta, Mikko

Now that the terminology seems to have gotten all mixed up, better to start using names of the actual power spectra.

To answer: no, you cannot make 1/f noise by mixing 1/f^2 and white noise. With analog circuitry you can make 1/f^2 noise by low-pass filtering white noise; also you can make approximately 1/f noise (over a few decades at least) by filtering white noise with a 10dB/dec filtering network (implementable as an R-C chain, for instance). With digital circuitry, just create an array of frequency-bin amplitudes obeying the intended spectrum shape, choose a random phase for each frequency bin, and perform inverse Fourier transform.

Regards, Mikko

Reply to
Kiviranta, Mikko

(i) a frequency-domain table filled with amplitude data following the desired spectrum, and randomly chosen phases. Then inverse FFT.

(ii) in time domain: a random number generator followed by a FIR (or IIR) filter having the desired frequency response.

Some time I wondered what happens if not only the two-time correlation gets fixed, but also some higher-order (like three-time) correlations. The time-domain waveform becomes even more restricted. I recall having read somewhere that some sort of analysis on music reveals an 1/f-like spectrum. This kind-of makes sense, because 1/f noise has the longest memory (longest tails in the autocorrelation function), which is probably a necessary ingredient to make music sound "interesting". Still, generating music so that, say, the intervals are generated from an 1/f noise source (approximated into the exact intervals of the chromatic scale) tends to result in a piece which is closer to noise than music. So, I've been wondering whether the generated music sounds better if one makes also higher correlations to follow some (long-tailed) function.

Analyzing power spectrum only (of, say, intervals and durations) in music reveals just the two-time correlation, but tells nothing about higher correlations which may be present. I'm not sure, however, whether some theorem exists which makes a connection between the two-time and higher correlations (for instance, to what extent specifying 2-time correlation limits the freedom to choose an arbitraty 3-time correlation).

Regards, Mikko

Reply to
Kiviranta, Mikko

Well, I suppose you could do it with an FFT. But why bother? If you want some spectral shape of noise, just generate spectrally "flat" noise and run it through an appropriate filter. I can do that in a rather modest DSP for pretty much any sort of reasonable spectral shape, down to 1/12 octave bands or even 1/24th octave bands. Generating spectrally flat noise is quite easy, even with a fixed-point processor. All you need to make it efficient is a parallel XOR instruction. But filtering generally requires multiplications, and unless you can cleverly arrange to use multiplications only by integer powers of 2, things are going to be tough in a processor with no multiplication operation.

Sounds like you have a really inefficient algorithm to generate your sines, or whatever. I just did basically what you describe in one line of Scilab, and it took 35 seconds to generate 1/10 of the whole thing (20-2kHz instead of 20-20kHz). That's on a slightly slower machine than you have. But again, that's a poor way to generate a spectrum that doesn't have to have hyper-abrupt band edges. Even an FFT filter (get a spectrum as an FFT of, say, a white noise time signal, multiply it by a "mask" to shape the spectrum, and inverse-FFT it back to the time domain) can be very fast for only a second's worth of data. Again, I just let Scilab do that: generate the white noise, fft it, shape the spectrum, and inverse-fft it. With 65536 samples, it took well under a second. At 131072 samples, it took about a second. I'd get really impatient with an algorithm that took an hour to generate a second's worth of data. REALLY impatient.

Also, beware that phase is important. If you add a whole bunch of sinewaves as you described that are in-phase all at the same point in time, you'll have something approximating an impulse in the time domain. (Actually something close to zero till you get close to the time where they are all in phase, then building rapidly to a negative peak, slewing very rapidly to a positive peak, and then tapering rapidly back down toward zero, if they line up at zero phase of a sine. Cosines all at zero phase yield a single positive peak, with a bit of "ringing" off to the sides.) An impulse is spectrally "white" noise, but probably not quite what you wanted.

Cheers, Tom

Reply to
Tom Bruhns

So don't bother to read my replies, Phil.

Cheers, Tom

Reply to
Tom Bruhns

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.