【问题标题】:Python equivalent of Pulse Integration (pulsint) MATLAB function?Python等效于脉冲积分(pulsint)MATLAB函数?
【发布时间】:2018-03-21 14:38:16
【问题描述】:

我正在网上冲浪以查找与 MATLAB 的函数 pulsint 等效的 Python,但到目前为止我还没有找到任何与它非常接近的东西。

在这方面的任何提示都会非常有帮助!

【问题讨论】:

    标签: python-3.x matlab signal-processing


    【解决方案1】:

    您可以轻松创建自己的 pulsint 函数。

    脉冲公式:

    你需要 numpy 库来保持简单

    import numpy as np
    import matplotlib as mpl
    
    # Non coherent integration
    def pulsint(x):
        return np.sqrt(np.sum(np.power(np.absolute(x),2),0)) 
    
    npulse = 10;
    
    # Random data (100x10 vector)
    x = np.matlib.repmat(np.sin(2*np.pi*np.arange(0,100)/100),npulse,1)+0.1*np.random.randn(npulse,100)
    
    # Plot the result
    mpl.pyplot.plot(pulsint(x))
    mpl.pyplot.ylabel('Magnitude')
    

    【讨论】:

    • 令人印象深刻!我正要这样做!
    猜你喜欢
    • 2013-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-15
    • 1970-01-01
    • 2012-04-18
    • 2016-07-17
    相关资源
    最近更新 更多