functions.py 文件源码

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

项目:decode 作者: deshima-dev 项目源码 文件源码
def plotpsd(data, dt, ndivide=1, window=hanning, overlap_half=False, ax=None, **kwargs):
    """Plot PSD (Power Spectral Density).

    Args:
        data (np.ndarray): Input data.
        dt (float): Time between each data.
        ndivide (int): Do averaging (split data into ndivide, get psd of each, and average them).
        overlap_half (bool): Split data to half-overlapped regions.
        ax (matplotlib.axes): Axis the figure is plotted on.
        kwargs (optional): Plot options passed to ax.plot().
    """
    if ax is None:
        ax = plt.gca()
    vk, psddata = psd(data, dt, ndivide, window, overlap_half)
    ax.loglog(vk, psddata, **kwargs)
    ax.set_xlabel('Frequency [Hz]', fontsize=20, color='grey')
    ax.set_ylabel('PSD', fontsize=20, color='grey')
    ax.legend()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号