felixpatzelt / colorednoise

Python package to generate Gaussian (1/f)**beta noise (e.g. pink noise)
MIT License
195 stars 20 forks source link

Checking by frequency #1

Closed terrytykuo closed 5 years ago

terrytykuo commented 5 years ago

Hi!

Just trying to generate pink noise using this package. I am not familiar with knowledge of color noise. However, according to Wikipedia, it seems that the pink noise will show obvious pattern when the x-axis is frequency and the y-axis is power.

Do you have such module that I can generate a numpy-array with this frequency-power format? Or any ways that I can check if the generated plots obey the distribution?

Thanks a lot!

felixpatzelt commented 5 years ago

Hi, did you try https://github.com/felixpatzelt/colorednoise#example (uncommenting the plotting part)? It uses matplotlib's psd function (https://matplotlib.org/api/mlab_api.html#matplotlib.mlab.psd). Alternatively, there's https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.signal.periodogram.html.

terrytykuo commented 5 years ago

Wow. Sorry for the late reply. That really helps!