raputil.py 文件源码

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

项目:onsager_deep_learning 作者: mborgerding 项目源码 文件源码
def add_noise(self,Y0):
        'add noise at the given SNR, returns Y0+W,wvar'
        wvar = (la.norm(Y0)**2/Y0.size) * 10**(-self.SNR_dB/10)
        if self.cpx:
            Y =(Y0 + crandn(Y0.shape) * sqrt(wvar/2)).astype(np.complex64,copy=False)
        else:
            Y = (Y0 + np.random.normal(scale=sqrt(wvar),size=Y0.shape) ).astype(np.float32,copy=False)
        return Y,wvar
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号