Python 等效于脉冲积分 (pulsint) MATLAB 函数?

Python equivalent of Pulse Integration (pulsint) MATLAB function?

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

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

您可以轻松创建自己的 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')