Skip to content

Commit

Permalink
Merge pull request #9 from felixpatzelt/fix-readme-blocks
Browse files Browse the repository at this point in the history
Fix readme blocks
  • Loading branch information
felixpatzelt authored Mar 13, 2022
2 parents 013240e + e5901b4 commit 25d4639
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Dependencies
Other Python versions were not tested, but are likely to work.


Example
-------
Examples
--------

.. code:: python
Expand All @@ -53,22 +53,24 @@ Example
.. code:: python
# generate several time series of independent indentically distributed variables
# repeat the simulation of each variable multiple times
# generate several time series of independent indentically distributed variables
# repeat the simulation of each variable multiple times
import colorednoise as cn
n_repeats = 10 # repeat simulatons
n_variables = 5 # independent variables in each simulation
timesteps = 1000 # number of timesteps for each variable
y = cn.powerlaw_psd_gaussian(1, (n_repeats, n_variables, timesteps))
# the expected variance of for each variable is 1, but each realisation is different
print(y.std(axis=-1))
n_repeats = 10 # repeat simulatons
n_variables = 5 # independent variables in each simulation
timesteps = 1000 # number of timesteps for each variable
y = cn.powerlaw_psd_gaussian(1, (n_repeats, n_variables, timesteps))
# the expected variance of for each variable is 1, but each realisation is different
print(y.std(axis=-1))
.. code:: python
# generate a broken power law spectrum: white below a frequency of
# generate a broken power law spectrum: white below a frequency of
import colorednoise as cn
y = cn.powerlaw_psd_gaussian(1, 10**5, fmin=.05)
s, f = mlab.psd(y, NFFT=2**9)
#plt.loglog(f,s)
#plt.grid(True)
#plt.show()
y = cn.powerlaw_psd_gaussian(1, 10**5, fmin=.05)
s, f = mlab.psd(y, NFFT=2**9)
#plt.loglog(f,s)
#plt.grid(True)
#plt.show()

0 comments on commit 25d4639

Please sign in to comment.