Open DavidSagan opened 1 year ago
Thought: Use the algorithm: Timmer, J. and Koenig, M.: On generating power law noise. Astron. Astrophys. 300, 707-710 (1995)
Have number of points Np (default, say, 10000) and frequency rolloff coef beta (default = 1) set by the user (via bmad_com?). Have generator calculate Np points and store for use. After being used, generator rerandomizes and generates a new set of Np points.
And to smooth out the power spectrum. interleave sets of points using triangular weighting.
Some thoughts:
When using long_term_tracking with ramper elements simulating noise (EG ground motion or Rf noise), the use of the ran() or ran_gauss() function generates noise that has a white spectrum. This is probably not a good approximation for something like ground motion whose spectrum will typically be in the 0 - 10 Hz range.
There are two issues to worry about:
In terms of constructing a random number generator with an arbitrary power spectrum see, for example: https://dsp.stackexchange.com/questions/47640/generating-a-timeseries-with-an-arbitrary-power-spectrum The problem with this method is that the number of random values to generate needs to be known beforehand. Another possibility is to use a lowpass LRC filter network.