noisyflux.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:tango 作者: LLNL 项目源码 文件源码
def _add_noise(v, amplitude):
        """Add noise to an array v in the following way:.

                    noisy_v = (1+h) * v

        where h is a random noise with specified standard deviation.  The noise h is trimmed to 
        be zero close to both boundaries.

        Inputs:
          v              input to add noise to (array)           
          ampltitude     specified standard deviation of noise (scalar)
          tac            autocorrelation time measured in discrete samples (scalar)
        Outputs:
          noisy_v        v with noise
        """
        # generate noise that is constant throughout space
        h  = np.random.normal(scale=amplitude) * np.ones_like(v)  
        # damped the sides of the noise close to the boundaries
        h = dampen_sides(h)
        noisy_v = (1 + h) * v
        return noisy_v
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号