python allan_Python AllanTools包_程序模块 - PyPI - Python中文网

频率数据示例

注意尿囊素假定无量纲频率数据输入。

标准化,例如用平均值分割所有数据点

频率,留给用户。>>> import allantools

>>> import pylab as plt

>>> import numpy as np

>>> t = np.logspace(0, 3, 50) # tau values from 1 to 1000

>>> y = allantools.noise.white(10000) # Generate some frequency data

>>> r = 12.3 # sample rate in Hz of the input data

>>> (t2, ad, ade, adn) = allantools.oadev(y, rate=r, data_type="freq", taus=t) # Compute the overlapping ADEV

>>> fig = plt.loglog(t2, ad) # Plot the results

>>> # plt.show()

new in 2016.11:简单的顶级API,使用专用类进行数据处理和绘图。import allantools # https://github.com/aewallin/allantools/

import numpy as np

# Compute a deviation using the Dataset class

a = allantools.Dataset(data=np.random.rand(1000))

a.compute("mdev")

# New in 2019.7 : write results to file

a.write_result("output.dat")

# Plot it using the Plot class

b = allantools.Plot()

# New in 2019.7 : additional keyword arguments are passed to

# matplotlib.pyplot.plot()

b.plot(a, errorbars=True, grid=True)

# You can override defaults before "show" if needed

b.ax.set_xlabel("Tau (s)")

b.show()

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值