Re: red noise ? [message #47917] |
Wed, 15 March 2006 07:37 |
Ricardo Bugalho
Messages: 22 Registered: March 2005
|
Junior Member |
|
|
Hello,
if you take white noise and pass it through an integrator (1/s), don't
you get red noise?
On Sat, 2006-03-11 at 17:18 -0700, R.G. Stockwell wrote:
> "Craig Markwardt" <craigmnet@REMOVEcow.physics.wisc.edu> wrote in message
> news:onr758lkvt.fsf@cow.physics.wisc.edu...
> through the mid freqs) or perhaps a digitial filter of white noise.
|
|
|
Re: red noise ? [message #47941 is a reply to message #47917] |
Sat, 11 March 2006 16:18  |
news.qwest.net
Messages: 137 Registered: September 2005
|
Senior Member |
|
|
"Craig Markwardt" <craigmnet@REMOVEcow.physics.wisc.edu> wrote in message
news:onr758lkvt.fsf@cow.physics.wisc.edu...
>
...
>
> Sure, here is a function that does that, modulo a normalization, which
> you will have to diddle yourself. You enter the frequency and desired
> PDS, and the output is one realization of such a power spectrum,
> assuming random phases. [ Of course there are an infinite number of
> realizations with the same PDS. The PDS discards 50% all phase
> information so you can't go backward to a unique time series from it
> alone. ]
>
> Craig
Thanks Craig,
it wasn't exactly what I was looking for; I wasn't detailed enough in my
original post. I do not want to use an fft to generate the time series,
since
my purpose is to study in detail the effects of windowing, and sampling, on
the
shape and slope of the spectra. A red spectrum has a large dynamic range,
and
the sidelobes of the powerful low frequencies can contaminate the weak
higher frequencies. I am also interested in analyzing the aliasing that
occurs
when one is samples a red spectrum (which may flatten out the frequency
response near the nuquist).
So I am looking for a time domain technique, either an autoregressive
process
(which I have but it doesn't give a pure red spectrum, it is merely
approximately red
through the mid freqs) or perhaps a digitial filter of white noise.
Thanks,
bob
|
|
|
Re: red noise ? [message #47942 is a reply to message #47941] |
Sat, 11 March 2006 13:41  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"R.G. Stockwell" <no@email.please> writes:
> Does anyone have a routine that calculates a red noise random time series?
> (where red noise indicates a slope of 1/f^2 in the power spectrum)
>
> I whipped up an autoregressive routine to do this, but the slope flattens
> out
> at the higher frequencies.
>
> Pink noise would be nice as well. In fact, if someone had code to create
> a time series of random variables with any arbitrary spectral slope, that
> would
> be great!
Sure, here is a function that does that, modulo a normalization, which
you will have to diddle yourself. You enter the frequency and desired
PDS, and the output is one realization of such a power spectrum,
assuming random phases. [ Of course there are an infinite number of
realizations with the same PDS. The PDS discards 50% all phase
information so you can't go backward to a unique time series from it
alone. ]
Craig
; PDS2LC
; FF - input frequency
; PDS - input PDS
; TOTRATE - input scale factor for output time series
; SEED - (optional) random number seed
; TIME - output time samples
; RETURNS: time series sampled at TIME bins
;
function pds2lc, ff, pds, totrate, seed=seed, time=tt
df = ff(1) - ff(0)
texp = 1/df
dt = 0.5/max(ff)
npts = n_elements(ff)
cpds = sqrt(pds) * exp(2d*!dpi*dcomplex(0,randomu(seed,npts)))
cpds = [cpds, 0, reverse(conj(cpds(1:*)))]
cpds = cpds * sqrt(texp*totrate/2)
cpds(0) = 0
clc = fft(cpds,-1)
lc = (double(clc) + totrate*dt)>0
tt = n_elements(lc)*dt
return, lc
end
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|