Re: randomized white noise = white noise?



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

.



Relevant Pages

  • Re: On Topic, but Just For Fun
    ... single frequencies within the spectrum. ... noise in the system, i.e. some pink-shaped noise, and broadband noise ... lower or higher depending on the number of FFT coefficients. ... I show it graphically in a way that makes sense: Power spectrum or ...
    (comp.dsp)
  • Re: On Topic, but Just For Fun
    ... Dirk is calulating the noise relative to the signal. ... computed with an FFT, type of window I don't remember. ... The spectrum was from digitizing a single tone, ...
    (comp.dsp)
  • Re: Generating 1/f (flicker/pink) noise
    ... Matlab code for generating perfect 1/f^alpha noise. ... If by clipping I understand you ... I don't agree with this because it will distort the spectrum. ... values of the next data set will be entirely different from the last ...
    (comp.dsp)
  • Re: What can we expect by taking Fourier Transform of noise or random samples?
    ... >>the observations of the useful signal y and n is the noise... ... >>some certain frequency range then we can do some filtering to recover the ... >>I feel nis a random process, yis a deterministic signal, then is ... to have a true spectrum you should be squaring the transform ...
    (sci.image.processing)
  • Re: What can we expect by taking Fourier Transform of noise or random samples?
    ... >>the observations of the useful signal y and n is the noise... ... >>some certain frequency range then we can do some filtering to recover the ... >>I feel nis a random process, yis a deterministic signal, then is ... to have a true spectrum you should be squaring the transform ...
    (sci.stat.math)