Reply by Nim September 3, 20092009-09-03
>>On 25 Mar, 14:51, dbd <d...@ieee.org> wrote: >>> On Mar 24, 4:51 pm, maxlittle2...@googlemail.com wrote: >>> >>> >>> >>> > On 23 Mar, 18:33, dbd <d...@ieee.org> wrote: >>> >>> > > On Mar 22, 4:03 pm, maxlittle2...@googlemail.com 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 >> > >Hi Max & Dale, >I have been trying to use your code to create a background noise signal >with 1/f characteristics (between [-1 1]). That is fine and moves very >efficiently. Now, I need to create a signal (1/f again) which is not >normalized between [-1 1] but rather has an average gain defined by
factor
>K. How do I do that? > >Simply adding or multiplying the background noise by the factor of K
does
>not provide the same 1/f characteristics. What is the right solution? >Best >Nim > > > >
Actually never mind, I changed the code to adapt that: function x = powernoise(alpha,N, varargin) % function x = powernoise(alpha,N, 'key','value') % Generate samples of power law noise. The power spectrum % of the signal scales as f^(-alpha). % % Useage: % x = powernoise(alpha, N) % x = powernoise(alpha, N, % 'randpower','off','normalize','on','normfactor',n) % % Inputs: % alpha - power law scaling exponent % N - number of samples to generate % % Output: % x - N x 1 vector of power law samples % % With no option strings specified, the power spectrum is % deterministic, and the phases are uniformly distributed in the range % -pi to +pi. The power law extends all the way down to 0Hz (DC) % component. By specifying the 'randpower' option string however, the % power spectrum will be stochastic with Chi-square distribution. The % 'normalize' option string forces scaling of the output to the range % [-1, 1], consequently the power law will not necessarily extend % right down to 0Hz. % % if you decide to normalize, you can also add normfactor option: % 'normfactor',k will normalize the output between [-k,k] % % (cc) Max Little, 2008. This software is licensed under the % Attribution-Share Alike 2.5 Generic Creative Commons license: % http://creativecommons.org/licenses/by-sa/2.5/ % If you use this work, please cite: % Little MA et al. (2007), "Exploiting nonlinear recurrence and fractal % scaling properties for voice disorder detection", Biomed Eng Online, 6:23 % % As of 20080323 markup % If you use this work, consider saying hi on comp.dsp % Dale B. Dalrymple % % Modified by Nima Dehghani : added normfactor to scale between %[-normfactor normfactor] % Sep 3rd 2009 callbacks = {'normalize','randpower','normfactor'}; try options = varargin; for index = 1:length(options) if iscell(options{index}) & ~iscell(options{index}{1}), options{index} = { options{index} }; end; end; if ~isempty( varargin ), g=struct(options{:}); else g= []; end; catch fprintf('%s: calling convention {''key'', value, ... } error',mfilename); return; end; try, g.normalize; catch; g.normalize = 'off'; end; try, g.randpower; catch; g.randpower = 'off'; end; try, g.normfactor; catch; g.normfactor = 1; end; if strcmpi(g.normalize, 'on'), opt_normal = true; else optnormal = false; end; if strcmpi(g.normalize, 'on'), opt_randpow = true; else opt_randpow = false; end; N2 = floor(N/2)-1; f = (2:(N2+1))'; A2 = 1./(f.^(alpha/2)); if (~opt_randpow) p2 = (rand(N2,1)-0.5)*2*pi; d2 = A2.*exp(i*p2); else % 20080323 p2 = randn(N2,1) + i * randn(N2,1); d2 = A2.*p2; end d = [1; d2; 1/((N2+2)^alpha); flipud(conj(d2))]; x = real(ifft(d)); if (opt_normal) x = ((x - min(x))/(max(x) - min(x)) - 0.5) * g.normfactor*2; end
Reply by Nim September 3, 20092009-09-03
>On 25 Mar, 14:51, dbd <d...@ieee.org> wrote: >> On Mar 24, 4:51 pm, maxlittle2...@googlemail.com wrote: >> >> >> >> > On 23 Mar, 18:33, dbd <d...@ieee.org> wrote: >> >> > > On Mar 22, 4:03 pm, maxlittle2...@googlemail.com 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 >
Hi Max & Dale, I have been trying to use your code to create a background noise signal with 1/f characteristics (between [-1 1]). That is fine and moves very efficiently. Now, I need to create a signal (1/f again) which is not normalized between [-1 1] but rather has an average gain defined by factor K. How do I do that? Simply adding or multiplying the background noise by the factor of K does not provide the same 1/f characteristics. What is the right solution? Best Nim
Reply by Andor March 26, 20082008-03-26
I wrote:

> I thought that part in the paper was a bit odd.
I also like this quote from the paper: "... for large enough values of f_min (no more than 2 or 3 decades from 0) ... " :-)
Reply by Andor March 26, 20082008-03-26
On 26 Mrz., 02:08, maxlittle2...@googlemail.com wrote:
> On 25 Mar, 22:19, Andor <andor.bari...@gmail.com> wrote: > > > Some interesting algorithms are presented here: > > >http://planck.lal.in2p3.fr/IMG/pdf/astro-ph-full.pdf > > > The "random midpoint"-algorithm requires only one randn() call per > > sample! However, it recursively generates a 1/f^alpha sequence by > > starting with the start and the endpoint, so it's not usable for > > streaming. > > Nice reference, Andor, and a very nice contribution to the discussion > here. > > I particularly like the logistic map algorithm suggested in the paper.
I thought that part in the paper was a bit odd. The author asks how to simulate 1/f^alpha noise for alpha > 2 (and suggests the logisitc map). However, the question can be trivially answered. If alpha > 2, first simulate noise with PSD 1/f^beta, where beta = alpha mod 2, then filter the 1/f^beta noise with an integrator of order floor(alpha/ 2). Voila. Regards, Andor
Reply by Andor March 26, 20082008-03-26
On 25 Mrz., 23:41, Andrew Reilly <andrew-newsp...@areilly.bpc-
users.org> wrote:
> On Tue, 25 Mar 2008 15:19:43 -0700, Andor wrote: > > The one thing I remember from my statistics class was that the defining > > characteristic was the asymptotic behaviour of the PSD towards DC. > > Anything with bounded PSD misses the nature of long-range correlated 1/f > > noises. > > While that's true, and a useful property for lots of estimation and > theoretical applications, one of the really big uses of "pink" noise is > as a standard test signal in audio systems. &#4294967295;(And that's because it > almost matches the PSD of lots of more interesting signals.)
Agreed. For more occurences of 1/f noise see this list: http://www.nslij-genetics.org/wli/1fnoise/index-by-category.html
> The systems > are generally known to be band-limited to something like human hearing, > so it's OK if the signal is too. &#4294967295;(In fact, since they're also usually > bounded in an absolute sense, it's not too useful to be generating values > asymptotically approaching infinity.)
If I remember correctly, the random walk (1/f^2) is 0-recurrent, meaning that it always returns back to its starting point. The expected length between two 0-crossings is, however, infinite. Regards, Andor
Reply by dbd March 26, 20082008-03-26
On Mar 25, 7:44 pm, maxlittle2...@googlemail.com wrote:

> ... > > 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.
To first order, each peak clip is equivalent to summing a short impulse (the clipped region, inverted). This becomes broadband noise. Is it's level small compared to the main noise signal? That's the test.
> > 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
Traditional users of noise-like signals have thought in terms of amplitude being RMS and not instantaneous. They wouldn't notice clipping until it showed on the oscilloscope. (There's no clipping noise from my load resister when I turn up the gain, so no problem!) New players in the digital world haven't learned how to analyze what happens or if it matters when they replace calculated values with the max or min values their digital domain enforces. I'm sure you are right that neither would think of clipping. But why would you trust either to tell you how a digital generator should behave? All noise generators with active gain stages in the noise generation path have clipping. Theoretically, the noise sources must be capable of arbitrarily large outputs. The power supplies present limits to the levels that can be 'represented' even in analog instruments, so clipping is not new. It's just still not well recognized. Dale B. Dalrymple
Reply by March 25, 20082008-03-25
On 26 Mar, 02:02, dbd <d...@ieee.org> wrote:
> On Mar 25, 5:58 pm, maxlittle2...@googlemail.com wrote: > > > > > On 25 Mar, 14:51, dbd <d...@ieee.org> wrote: > > > > On Mar 24, 4:51 pm, maxlittle2...@googlemail.com wrote: > > > > > On 23 Mar, 18:33, dbd <d...@ieee.org> wrote: > > > > > > On Mar 22, 4:03 pm, maxlittle2...@googlemail.com 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
Reply by dbd March 25, 20082008-03-25
On Mar 25, 5:58 pm, maxlittle2...@googlemail.com wrote:
> On 25 Mar, 14:51, dbd <d...@ieee.org> wrote: > > > > > On Mar 24, 4:51 pm, maxlittle2...@googlemail.com wrote: > > > > On 23 Mar, 18:33, dbd <d...@ieee.org> wrote: > > > > > On Mar 22, 4:03 pm, maxlittle2...@googlemail.com 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
Reply by March 25, 20082008-03-25
On 25 Mar, 22:19, Andor <andor.bari...@gmail.com> wrote:

> Some interesting algorithms are presented here: > > http://planck.lal.in2p3.fr/IMG/pdf/astro-ph-full.pdf > > The "random midpoint"-algorithm requires only one randn() call per > sample! However, it recursively generates a 1/f^alpha sequence by > starting with the start and the endpoint, so it's not usable for > streaming.
Nice reference, Andor, and a very nice contribution to the discussion here. I particularly like the logistic map algorithm suggested in the paper. Max
Reply by March 25, 20082008-03-25
On 25 Mar, 14:51, dbd <d...@ieee.org> wrote:
> On Mar 24, 4:51 pm, maxlittle2...@googlemail.com wrote: > > > > > On 23 Mar, 18:33, dbd <d...@ieee.org> wrote: > > > > On Mar 22, 4:03 pm, maxlittle2...@googlemail.com 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