Skip to content
Snippets Groups Projects
Commit 45d22d3a authored by Michele Maris's avatar Michele Maris
Browse files

a colored_noise.py

parent 8cab03b3
No related branches found
No related tags found
No related merge requests found
...@@ -92,10 +92,10 @@ Keywords: ...@@ -92,10 +92,10 @@ Keywords:
# #
self._freq=np.fft.rfftfreq(self.N) self._freq=np.fft.rfftfreq(self.N)
# #
pl=self.alpha/2 pl=self.alpha
with np.errstate(divide='ignore'): with np.errstate(divide='ignore'):
x=self.fknee/np.where(self._freq==0, np.inf , self._freq) x=self.fknee/np.where(self._freq==0, np.inf , self._freq)
self._S=(1+x)**pl self._S=(1+x**pl)**0.5
# #
if self._zero_policy=='0' : if self._zero_policy=='0' :
self._S[0]=0. self._S[0]=0.
...@@ -104,7 +104,7 @@ Keywords: ...@@ -104,7 +104,7 @@ Keywords:
elif self._zero_policy=='M' : elif self._zero_policy=='M' :
self._S[0]=self.wn_mean self._S[0]=self.wn_mean
elif self._zero_policy=='100x1' : elif self._zero_policy=='100x1' :
self._S[0]=1 if fknee>ff[1] else (1+100*self.fknee/self._freq[1])**pl self._S[0]=1 if fknee>ff[1] else (1+100*(self.fknee/self._freq[1])**pl)**0.5
else : # self._zero_policy=='I' : else : # self._zero_policy=='I' :
# left things as they are # left things as they are
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment