Skip to content

Instantly share code, notes, and snippets.

@luoyetx
Last active December 22, 2015 12:29
Show Gist options
  • Select an option

  • Save luoyetx/6472789 to your computer and use it in GitHub Desktop.

Select an option

Save luoyetx/6472789 to your computer and use it in GitHub Desktop.
计算离散卷积
import numpy as np
def conv_m(x, nx, h, nh):
'''计算x与h的卷积,nx与nh为其序列下标范围'''
nyb = nx[0] + nh[0]
nye = nx[-1] + nh[-1]
ny = np.arange(nyb, nye+1)
y = np.convolve(x, h)
return y, ny
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment