Re: Generating 1/f (flicker/pink) noise
- From: maxlittle2007@xxxxxxxxxxxxxx
- Date: Tue, 25 Mar 2008 19:44:12 -0700 (PDT)
On 26 Mar, 02:02, dbd <d...@xxxxxxxx> wrote:
On Mar 25, 5:58 pm, maxlittle2...@xxxxxxxxxxxxxx wrote:
On 25 Mar, 14:51, dbd <d...@xxxxxxxx> wrote:
On Mar 24, 4:51 pm, maxlittle2...@xxxxxxxxxxxxxx wrote:
On 23 Mar, 18:33, dbd <d...@xxxxxxxx> wrote:
On Mar 22, 4:03 pm, maxlittle2...@xxxxxxxxxxxxxx wrote:
...
Ah, well I did find those resources, but no simple "one pager" of
Matlab code for generating perfect 1/f^alpha noise.
...
Max
There can be no page that is 'simple' and 'perfect' for all
applications.
One characteristic of your implementation choice is that the power
spectrum does not just have the desired expectation value in any
frequency region, but it equals the expectation value. While this is a
possible power spectum value, it is not a likely one, and is unlikely
to repeat. This can be useful in certain testing situations. It might
be inappropriate in others. An alternative is to use independent
Gaussian samples for real and imaginary frequency components and
weight them with the desired frequency weighting. An example
implementation of this, modified from your implementation, follows
below. This could provide more realistic statistical behavior in some
applications.
Dale B. Dalrymplehttp://dbdimages.com
Dale
Thanks, these are excellent points. I've added an option to the
routine so that a choice can be made between deterministic and
stochastic power. I've also added an option that normalises the
signal amplitude so that it lies in the range -1 to +1. This may be
useful in certain circumstances. Grab the code from:
http://www.eng.ox.ac.uk/samp/powernoise_soft.html
Max
Max
If you really think a normalization and a peak limiting capability
should be included inside the function, I suggest you do so with a
gain and a clipping capability instead of putting the mean and scale
of the output under the control of the extremal behavior of the noise
generated.
There are test purposes where the original function or my addition
could be called multiple times to generate longer sequences of test
data. Even these special cases no longer work when gain and offset
change from block to block.
Dale B. Dalrymple
Thanks for the thoughtful suggestions Dale.
I think the normalization to the range [-1, 1] is required for some
applications (particularly nonlinear time series analysis): at least
one member of this group has found that some gain is desireable, and I
reason that it's better to have a signal that uses a standard number
range. Otherwise, as you imply, there probably isn't much point in
putting this scaling in the function. If by clipping I understand you
to mean some kind of nonlinear "clamping" of values outside a certain
range, I don't agree with this because it will distort the spectrum.
This also leads on to your second paragraph. Unfortunately this
method, as it stands, can't be called multiple times to generate
longer sequences: there will be several problems. One of them is that
the signal is not guaranteed to be continuous across multiple calls.
The resulting discontinuities will introduce spectral distortions.
Of course, one could imagine a solution to fix this problem that
matches the endpoints of each successive call, but then you'd also
need to match as many derivatives of the signal as are required to
ensure the appropriate differentiability for the chosen "roughness" of
the signal (which, informally, is inversely proportional to alpha). I
don't think such an approach would be elegant though, and I'm sure
there's a better one, although I can't think of it right now.
Max
If you want to rerun a test and generate a new data set to do so, or
run a test against multiple independent data sets, the RMS and DC
values of the next data set will be entirely different from the last
one as you have it. A knee-jerk reaction to clipping seems easier to
some than thinking about the actual effect. If for example, you limit
the amplitude to put the data through a DAC, you should consider how
the error generated by clipping compares with the level of
quantization noise plus the mismatch between the generated data and
'real' 1/f noise. For almost anything except examining the tail ends
of order statistic distributions the clipping of some extremal values
is undetectable in noise. Differences in scaling and offset are much
more obvious to many common processes.
Dale B. Dalrymple
Thanks Dale, very interesting points as always.
You're right, of course, in that things are nearly always more complex
than they initially appear. I'd certainly be interested to see exact
analytical results detailing the distortion of the 1/f^alpha power
spectrum caused by a given level of clipping.
I do think though that, at least superficially, if you asked around
for a range of opinions (and I mean not just in signals circles), by
"normalization" most would respond that the amplitude is somehow
scaled to some numerical range that is widely understood to be a
"unit" range of some sort. I don't know how many would think of
clipping initially. But that's just my opinion.
Max
.
- Follow-Ups:
- Re: Generating 1/f (flicker/pink) noise
- From: dbd
- Re: Generating 1/f (flicker/pink) noise
- References:
- Generating 1/f (flicker/pink) noise
- From: maxlittle2007
- Re: Generating 1/f (flicker/pink) noise
- From: Andor
- Re: Generating 1/f (flicker/pink) noise
- From: Erik de Castro Lopo
- Re: Generating 1/f (flicker/pink) noise
- From: maxlittle2007
- Re: Generating 1/f (flicker/pink) noise
- From: dbd
- Re: Generating 1/f (flicker/pink) noise
- From: maxlittle2007
- Re: Generating 1/f (flicker/pink) noise
- From: dbd
- Re: Generating 1/f (flicker/pink) noise
- From: maxlittle2007
- Re: Generating 1/f (flicker/pink) noise
- From: dbd
- Generating 1/f (flicker/pink) noise
- Prev by Date: Re: Generating 1/f (flicker/pink) noise
- Next by Date: Re: Digital Integrator
- Previous by thread: Re: Generating 1/f (flicker/pink) noise
- Next by thread: Re: Generating 1/f (flicker/pink) noise
- Index(es):
Relevant Pages
|
Loading