目录
- 基本概念
- 复数
- 傅里叶级数
- 冲激函数及其取样(筛选)性质
- 连续单变量函数的傅里叶变换
- 卷积
基本概念
复数
复数的定义为
为实数,是实部,是虚部,。复数的共轭表示为
从几何角度来看,复数可视为平面(称为复平面)上的一个点,其横坐标是实轴,纵坐标是虚轴,也就是说是得平面直角坐标系中的点
极坐标表示复数
是从复平面的原点延伸到点的向量长度,是该向量与实轴的夹角。
使用欧拉公式
可以给坐极坐标的复数表示为
复函数:
幅值是
a = np.complex(1 + 2j)
radian = np.arctan2(a.imag, a.real)
radian
1.1071487177940904
degree = np.rad2deg(radian)
degree
63.43494882292201
傅里叶级数
周期为的连续变量的周期函数,可表示为乘以适当系数的正弦函数和余弦函数之和
冲激函数及其取样(筛选)性质
连续变量在处的单位冲激表示为,定义是
它被限制为满足恒等式
自然地,将解释为时间时,冲激就可视为幅度无限、持续时间为0、具有单位面积的尖峰信息。冲激具有关于积分的所谓取样性质
冲激
冲激并不是通常意义上的函数,更准确的名称是分布或广义函数。
任意一点的取样性质为:
例如: 若,则使用冲激得到结果
冲激串KaTeX parse error: \tag works only in display equations
离散冲激定义为
def impulse(x, x0):
return np.piecewise(x, [x==x0, x!=x0], [1, 0])
# 按定义写的,不知道是否正确,如不正确,请指出,感谢,只做展示
x = np.arange(10)
plt.stem(x, impulse(x, 5), )
plt.show()
def impulse_serial(x):
s = np.ones_like(x)
return s
# 只做展示
x = np.arange(10)
plt.stem(impulse_serial(x))
plt.show()
连续单变量函数的傅里叶变换
傅里叶变换对
连续变量的连续函数的傅里叶变换由表示,定义为
所以有
反变换:
通常表示为
使用欧拉公式,可以写为
傅里叶变换是乘以正弦函数的展开式, 其中正弦函数的频率是由值决定。因此积分后留下的唯一变量是频率,因此,我们说傅里叶变换域是频率域。
盒式函数的傅里叶变换
最后的结果是函数
通常傅里叶变换中包含复数项,这是为了显示变换的幅值(一个实量)的约定。这个幅值称为傅里叶频谱或频谱:
def box_function(x, w):
w_2 = w / 2
y = np.where(x, x > -w_2, 0)
y = np.where(x < w_2, y, 0)
return y
import mpl_toolkits.axisartist as axisartist
def setup_axes(fig, rect):
ax = axisartist.SubplotZero(fig, rect)
fig.add_axes(ax)
for direction in ["xzero", "yzero"]:
# adds arrows at the ends of each axis
ax.axis[direction].set_axisline_style("-|>")
# adds X and Y-axis from the origin
ax.axis[direction].set_visible(True)
for direction in ["left", "right", "bottom", "top"]:
# hides borders
ax.axis[direction].set_visible(False)
return ax
# 盒式函数的傅里叶变换
x = np.arange(-5, 5, 0.1)
y = box_function(x, 6)
fig = plt.figure(figsize=(15, 5))
ax_1 = setup_axes(fig, 131)
ax_1.plot(x, y), ax_1.set_title('f(t)', loc='center', y=1.05), ax_1.set_ylim([0, 2]), ax_1.set_yticks([])
f_u = np.sinc(x)
ax_2 = setup_axes(fig, 132)
ax_2.plot(x, f_u), ax_2.set_title('F(u)', loc='center', y=1.05), ax_2.set_yticks([]), #ax_2.set_ylim([-1, 2]),
f_u_absolute = abs(f_u)
ax_3 = setup_axes(fig, 133)
ax_3.plot(x, f_u_absolute), ax_3.set_title('|F(u)|', loc='center', y=1.05), ax_3.set_yticks([]), #ax_3.set_ylim([-1, 2]),
plt.tight_layout()
plt.show()
冲激和冲激串的傅里叶变换
冲激串的傅里叶变换
卷积
- 傅里叶正变换
- 傅里叶反变换