Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Generating 1/f^b colored time series

Tags:
  1. Mar 3, 2015 #1
    Please excuse (and ignore) this if this is not the right place to ask this. I am an ecologists and need to generate a time series with a specific color or frequency spectra. I never learned how fourier transforms work in class and while I get the gist from reading there are so many subtleties that makes it hard to get it right unless one spends considerable time understanding it all. So I hope to get some help here.

    I want to be able to define minFreq, maxFreq, Nfreq, Variance and color. I do not want to generate a discrete time series but instead have a function that provides me with a continuous function over time, even if it is evaluated at a specific time. Also, I'd prefer to make this in the sine domain instead of complex.

    I want to get two vectors (amplitude, A and phase, P) by providing minFreq, maxFreq, Nfreq, Variance (of the time series) and color such that I can call

    T(t,A,P)=sum(A*sin(w*t+P))

    with the output having the given variance and color

    I tried this code but does not have the properties I need and I probably made many errors in ignorance.

    N=64
    k=1:N
    maxP=365
    minP=1
    k=linspace(minP,maxP,N)
    w=2*pi*k'./maxP
    b=1
    p=rand(N,1)*2*pi
    a=ones(N,1).*(1./w.^(b/2))
    for t=1:1000
    T(t)=sum(a.*sin(t*w+p))./sum(a);
    end

    *slight edit*

    Any hints are greatly appreciated

    P.S. is it possible to define the vectors such that the generated time serie's variance is independent of the choice of Nfreq and color?
     
    Last edited: Mar 3, 2015
  2. jcsd
  3. Mar 8, 2015 #2
    Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Generating 1/f^b colored time series
  1. F(x) = 1/(x+1) - 2/9 (Replies: 3)

Loading...