{"id":15008853,"url":"https://github.com/felixpatzelt/colorednoise","last_synced_at":"2025-04-05T02:05:27.736Z","repository":{"id":38983821,"uuid":"104582795","full_name":"felixpatzelt/colorednoise","owner":"felixpatzelt","description":"Python package to generate Gaussian (1/f)**beta noise (e.g. pink noise)","archived":false,"fork":false,"pushed_at":"2023-10-09T21:03:34.000Z","size":2601,"stargazers_count":202,"open_issues_count":2,"forks_count":21,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T01:13:15.522Z","etag":null,"topics":["correlations","noise-generator","power-laws","python","python2","python3","time-series"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/felixpatzelt.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-09-23T16:43:02.000Z","updated_at":"2025-03-25T05:04:38.000Z","dependencies_parsed_at":"2024-01-16T14:03:43.171Z","dependency_job_id":"73f25294-1fe9-4301-9cb9-14c4c2ff492c","html_url":"https://github.com/felixpatzelt/colorednoise","commit_stats":{"total_commits":39,"total_committers":6,"mean_commits":6.5,"dds":0.2564102564102564,"last_synced_commit":"6f0185969092186b08d5ea81dfca7023ed25399a"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixpatzelt%2Fcolorednoise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixpatzelt%2Fcolorednoise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixpatzelt%2Fcolorednoise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/felixpatzelt%2Fcolorednoise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/felixpatzelt","download_url":"https://codeload.github.com/felixpatzelt/colorednoise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276163,"owners_count":20912288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["correlations","noise-generator","power-laws","python","python2","python3","time-series"],"created_at":"2024-09-24T19:21:04.069Z","updated_at":"2025-04-05T02:05:27.713Z","avatar_url":"https://github.com/felixpatzelt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"colorednoise.py\n===============\n\nGenerate Gaussian distributed noise with a power law spectrum with arbitrary \nexponents. \n\nAn exponent of two corresponds to brownian noise. Smaller exponents \nyield long-range correlations, i.e. pink noise for an exponent of 1 (also \ncalled 1/f noise or flicker noise).\n\nBased on the algorithm in:\n\t\n    Timmer, J. and Koenig, M.:\n    On generating power law noise. \n    Astron. Astrophys. 300, 707-710 (1995)\n    \nFurther reading: \n`Colors of noise on Wikipedia \u003c//en.wikipedia.org/wiki/Colors_of_noise\u003e`_\n\n\nInstallation\n------------\n\n\tpip install colorednoise\n\t\n\t\nDependencies\n------------\n\n\t- Python \u003e= 3.6.15\n\t- NumPy \u003e= 1.17.0\n\t\nOlder Python 3 versions were not tested, but are likely to work.\nFor Python 2 please use colorednoise version 1.x.\n\n\nExamples\n--------\n\n.. code:: python\n\n\timport colorednoise as cn\n\tbeta = 1 # the exponent\n\tsamples = 2**18 # number of samples to generate\n\ty = cn.powerlaw_psd_gaussian(beta, samples)\n\t\n\t# optionally plot the Power Spectral Density with Matplotlib\n\t#from matplotlib import mlab\n\t#from matplotlib import pylab as plt\n\t#s, f = mlab.psd(y, NFFT=2**13)\n\t#plt.loglog(f,s)\n\t#plt.grid(True)\n\t#plt.show()\n\t\n\t\n.. code:: python\n\n\t# generate several time series of independent indentically distributed variables \n\t# repeat the simulation of each variable multiple times\n\timport colorednoise as cn\n\tn_repeats   = 10   # repeat simulatons\n\tn_variables = 5    # independent variables in each simulation\n\ttimesteps   = 1000 # number of timesteps for each variable\n\ty = cn.powerlaw_psd_gaussian(1, (n_repeats, n_variables, timesteps))\n\t\n\t# the expected variance of for each variable is 1, but each realisation is different\n\tprint(y.std(axis=-1))\n\t\n.. code:: python\n\n\t# generate a broken power law spectrum: white below a frequency of \n\timport colorednoise as cn\n\ty = cn.powerlaw_psd_gaussian(1, 10**5, fmin=.05)\n\ts, f = mlab.psd(y, NFFT=2**9)\n\t#plt.loglog(f,s)\n\t#plt.grid(True)\n\t#plt.show()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixpatzelt%2Fcolorednoise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffelixpatzelt%2Fcolorednoise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffelixpatzelt%2Fcolorednoise/lists"}