Last active
December 22, 2015 12:29
-
-
Save luoyetx/6472789 to your computer and use it in GitHub Desktop.
计算离散卷积
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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