`
cakin24
  • 浏览: 1334126 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

scipy一维卷积

阅读更多
一 介绍
signal模块包含大量滤波函数、B样条插值算法等等。下面的代码演示了一维信号的卷积运算。

二 代码

  1. import numpy as np
  2. import scipy.signal
  3. x = np.array([1,2,3])
  4. h = np.array([4,5,6])
  5. print(scipy.signal.convolve(x, h))#一维卷积运算
三 运行结果
[ 4 13 28 27 18]
四 一维卷积算法
  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstring>
  4. #include<cmath>
  5. #include<vector>
  6. #include<queue>
  7. #include<map>
  8. #include<algorithm>
  9. usingnamespace std;
  10. #define INF 0xfffffff
  11. #define maxn 100010
  12. int main()
  13. {
  14. int m=5,n=5;
  15. int a[5]={0,1,0,2,1},b[5]={0,1,0,2,1};
  16. int i,j;
  17. int k=m+n-1;//卷积后数组长度
  18. int c[k];
  19. memset(c,0,sizeof(c));//注意一定要清零
  20. /**卷积计算**/
  21. for(i=0; i<k; i++)
  22. {
  23. for(j=max(0,i+1-n); j<=min(i,m-1); j++)
  24. c[i]+=a[j]*b[i-j];
  25. cout<<c[i]<<" ";
  26. }
  27. /****/
  28. cout<<endl;
  29. }
1
0
分享到:
评论

相关推荐

    Python使用scipy模块实现一维卷积运算示例

    本文实例讲述了Python使用scipy模块实现一维卷积运算。分享给大家供大家参考,具体如下: 一 介绍 signal模块包含大量滤波函数、B样条插值算法等等。下面的代码演示了一维信号的卷积运算。 二 代码 import numpy as...

    Python scipy的二维图像卷积运算与图像模糊处理操作示例

    本文实例讲述了Python scipy的二维图像卷积运算与图像模糊处理操作。分享给大家供大家参考,具体如下: 二维图像卷积运算 一 代码 import numpy as np from scipy import signal, misc import matplotlib.pyplot as...

    python scipy卷积运算的实现方法

    主要介绍了python scipy卷积运算的实现方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

    scipy-ref-1.4.1.pdf_scipy_scipy1.4.1_scipypdf_源码

    scipy1.4.1帮助文档。搬运不易,感谢下载分享!

    scipy-ref.pdf

    Specialfunctions(scipy.special)................................. 10 1.4 Integration(scipy.integrate)................................... 10 1.5 Optimization(optimize)......................................

    Scipy Tutorial(Scipy教程)

    scipy包含致力于科学计算中常见问题的各个工具箱。它的不同子模块相应于不同的应用。像插值,积分,优化,图像处理,统计,特殊函数等等。 scipy可以与其它标准科学计算程序库进行比较,比如GSL(GNU C或C++科学计算...

    scipy5555.zip

    scipy1.4.1版本

    安装scipy必须的matplotlib

    python开发需要画图库scipy,而安装scipy前必须要先安装两个库,numpy和pylab,这个是win32版本的。

    scipy-0.18.1.tar.gz

    scipy-0.18.1.tar.gz

    scipy-0.19.0.zip

    scipy-0.19.0

    python scipy 学习手册

    python scipy 学习手册

    Elegant SciPy.pdf

    If you’re a scientist who programs with Python, this practical guide, Elegant SciPy not only teaches you the fundamental parts of SciPy and libraries related to it, but also gives you a taste for ...

    优雅的SciPy 英文版 Elegant SciPy

    Solve sparse matrix problems, including image segmentations, with SciPy’s sparse module Perform linear algebra by using SciPy packages Explore image alignment (registration) with SciPy’s optimize ...

    Scipy学习笔记PDF

    Scipy学习笔记PDF

    scipy手册 dev chm版本

    scipy手册 dev chm版本

    scipy-0.13.3.zip

    scipy-0.13.3老版本 有需要的可以自行下载

    scipy-0.5.2.win32-py2.5.rar

    SciPy (pronounced "Sigh Pie") is open-source software for mathematics, science, and engineering. It is also the name of a very popular conference on scientific programming with Python. The SciPy ...

    scipy+scikit-learn组件

    scipy+scikit-learn组件 适用于python3.6,64位,请注意版本 numpy太大,单独上传了

Global site tag (gtag.js) - Google Analytics