1 Star 0 Fork 2

Sunset-source/MIMO检测

forked from wangyihong/MIMO检测 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
test.py 773 Bytes
一键复制 编辑 原始数据 按行查看 历史
wangyihong 提交于 2021-03-23 10:31 +08:00 . 20210323
import numpy as np
import matplotlib.pyplot as plt
def tanh(x):
return (np.exp(x) - np.exp(-x)) / (np.exp(x) + np.exp(-x))
# C = np.array([-1, 1], dtype=np.float32)
# C = np.array([-1, -0.7071, 0, 0.7071, 1], dtype=np.float32)
# C = np.array([-3,-1,1,3], dtype=np.float32)
C = np.array([-7,-5,-3,-1,1,3,5,7], dtype=np.float32)
x = np.arange(-10,10,0.1)
theta = 6.2
alpha = 0.53
y = []
for i in range(len(C)-1):
y.append(np.abs(C[i+1]-C[i])/2 * tanh(theta * ( x - alpha * (C[i]+C[i+1])/2 )))
a = np.stack(y)
y = np.sum(a,0)
# y1 = 0.7071/2 * tanh(theta * (x+kuan/2))
# y3 = -0.7071/2 * tanh(theta * (x-kuan/2))
# y = y1 + y3
_, ax1 = plt.subplots()
ax1.plot(x,y)
ax1.grid(linestyle='--', which='both')
plt.show()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/Sunset-source/mimo-detection.git
git@gitee.com:Sunset-source/mimo-detection.git
Sunset-source
mimo-detection
MIMO检测
master

搜索帮助