Pulse_Switching_CSHE_BER_nTron.py 文件源码

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

项目:Auspex 作者: BBN-Q 项目源码 文件源码
def ntron_pulse(amplitude=1.0, rise_time=80e-12, hold_time=170e-12, fall_time=1.0e-9, sample_rate=12e9):
    delay    = 2.0e-9 # Wait a few TCs for the rising edge
    duration = delay + hold_time + 6.0*fall_time # Wait 6 TCs for the slow decay
    pulse_points = int(duration*sample_rate)

    if pulse_points < 320:
        duration = 319/sample_rate
        # times = np.arange(0, duration, 1/sample_rate)
        times = np.linspace(0, duration, 320)
    else:
        pulse_points = 64*np.ceil(pulse_points/64.0)
        duration = (pulse_points-1)/sample_rate
        # times = np.arange(0, duration, 1/sample_rate)
        times = np.linspace(0, duration, pulse_points)

    rise_mask = np.less(times, delay)
    hold_mask = np.less(times, delay + hold_time)*np.greater_equal(times, delay)
    fall_mask = np.greater_equal(times, delay + hold_time)

    wf  = rise_mask*np.exp((times-delay)/rise_time)
    wf += hold_mask
    wf += fall_mask*np.exp(-(times-delay-hold_time)/fall_time)

    return amplitude*wf
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号