【发布时间】:2022-07-26 17:14:36
【问题描述】:
不管我多么努力,我总是得到错误的答案。 问题是使用以下表达式生成复指数信号: ????[????]=|??????|^(????) * ??????^(????????????)
其中 ??????=2????/10 且 0≤????≤100。只绘制 ????[????] 的实部的两个图
而z的值为0.5+0.02????
这是我的代码,
import math
import numpy as np
from matplotlib import pyplot as plt
z = 0.5 + 0.02j
omega = (2*math.pi)/10
N = 100
x =[0] * N
for n in range(N):
x[n] = (abs(z) ** n)* math.cos(omega*n)
plt.plot(x)
plt.show()
我得到了这种类型的输出,
但我的预期输出是,
【问题讨论】:
-
这个
????[????]=|????|^(????) * ????^(????????????)是否转换为(abs(z) ** n)* math.cos(omega*n)?第一个具有指数因子,但第二个没有。 -
(abs(z) ** n)* math.cos(omega*n) 是 ????[????]=|????|^( ????) * ????^(????????????)
-
(abs(z) ** n)* math.sin(omega*n) 是虚部
-
嗯。我认为这是因为
(abs(z) ** n)迅速趋向于 0,因为 0.5n。如果因子为 0.9n,您将能够在图表上看到该模式。 -
您的“预期输出”与您提供的方程式和参数不匹配。
标签: python graph signal-processing