python - 如何在 scipy 中生成非周期性方波信号
问题描述
我想在 scipy.signal 中将以下简单的正方形从 0 转换为 1 函数,以便将卷积运算与其他 scipy.signal 一起使用
def f(t): return 1 if (np.floor(t) < 1) else 0
我怎样才能做到这一点?
编辑
很抱歉造成混淆,假设我有以下函数定义:
return np.where(np.floor(t) < 1, 1 , 0)
我如何编写它的 scipy.signal 版本?
解决方案
NumPywhere
可能是您正在寻找的:
def f(t):
return np.where(np.floor(t) < 1, 1 , 0)
推荐阅读
- android - 缩小启用后无法识别android项目中的模块类
- javascript - React.js 和 D3,向强制有向图添加箭头
- mysql - 查询MySQL的问题
- selenium-webdriver - 无法在 selenium 中打开新选项卡或新窗口
- javascript - 在 Nuxt/Vue 应用程序中使用 tawk.to
- javascript - jquery追加不起作用
- c# - 我想编写一个从 json 生成 c# 类对象的工具
- javascript - 防止 alert() 方法触发两次
- c# - 如何在 ASP.NET Web 应用程序中设置表单变量?
- python - 无法通过 python 请求获取真正的 html