1. 预览
2. 频率2Hz, 3Hz余弦波
余弦波(f表示频率): y = 0.8 cos ( 2 π 1 / f t ) + 1 y=0.8\cos(\frac{2\pi}{1/f}t)+1 y=0.8cos(1/f2πt)+1
3. 某周期单位圆
因为:
e
i
θ
=
cos
θ
+
i
sin
θ
e^{i \theta}=\cos \theta + i\sin \theta
eiθ=cosθ+isinθ
所以某周期的单位圆可以表示为:
e
i
2
π
f
t
e^{i2\pi ft}
ei2πft
4. 将某波形缠绕到圆上
比如将2Hz、3Hz余弦波复合后的波形缠绕到圆上,缠绕频率为f:
(
(
0.8
cos
(
4
π
t
)
+
1
)
+
(
0.8
cos
(
6
π
t
)
+
1
)
)
×
e
i
2
π
f
t
((0.8\cos(4\pi t)+1)+(0.8\cos(6\pi t)+1)) \times e^{i2\pi f t}
((0.8cos(4πt)+1)+(0.8cos(6πt)+1))×ei2πft
5. 缠绕波形的质心-近傅里叶变换
把缠绕波形看成金属丝,金属丝的质心为:
1
N
∑
k
=
1
N
g
(
t
k
)
e
−
2
π
i
f
t
=
1
t
2
−
t
1
∫
t
1
t
2
g
(
t
)
e
−
2
π
i
f
t
d
t
\frac{1}{N} \sum ^N _{k=1} g(t_k) e^{-2\pi i f t}=\frac{1}{t_2-t_1}\int^{t_2}_{t_1}g(t)e^{-2\pi i f t} \mathrm{d}t
N1k=1∑Ng(tk)e−2πift=t2−t11∫t1t2g(t)e−2πiftdt
6. 真傅里叶变换
近傅里叶变换为缠绕波形质心的x坐标,去掉时间区间后,为真傅里叶变换:
∫
−
∞
∞
g
(
t
)
e
−
2
π
i
f
t
d
t
\int^{\infty}_{-\infty}g(t)e^{-2\pi i f t} \mathrm{d}t
∫−∞∞g(t)e−2πiftdt
7. matlab代码:
1. 余弦波代码
% 傅里叶变换
clear;clc;clf;
% 周期 1/2,频率 2Hz
syms t;
y_1 = 0.8*cos((2*pi/(1/2))*t) + 1;
time = 0:0.01:1;
% ya_1 = 0:0.01:1;
% idx = 1;
% for v = time
% ya_1(idx) = subs(y_1, t, v);
% idx = idx + 1;
% end
% subplot(2,2,1);
% plot(time, ya_1);
% ax = gca;
% ax.XAxisLocation = 'origin';
% ax.YAxisLocation = 'origin';
% axis([0,5,-2,2]);
% xlabel('time');
% ylabel('intensity');
% 周期 1/3,频率 3Hz
y_2 = 0.8*cos((2*pi/(1/3))*t) + 1;
% ya_2 = 0:0.01:1;
% idx = 1;
% for v = time
% ya_2(idx) = subs(y_2, t, v);
% idx = idx + 1;
% end
% subplot(2,2,3);
% plot(time, ya_2);
% ax = gca;
% ax.XAxisLocation = 'origin';
% ax.YAxisLocation = 'origin';
% axis([0,5,-2,2]);
% xlabel('time');
% ylabel('intensity');
% 频率2Hz和3Hz的余弦波相加
y_3 = y_1 + y_2;
ya_3 = 0:0.01:1;
idx = 1;
for v = time
ya_3(idx) = subs(y_3, t, v);
idx = idx + 1;
end
subplot(2,2,1);
plot(time, ya_3);
ax = gca;
ax.XAxisLocation = 'origin';
ax.YAxisLocation = 'origin';
axis([0,5,-5,5]);
xlabel('time');
ylabel('intensity');
% 将波形缠绕到圆上,缠绕频率为f
% e^{iθ}
syms f;
y_44 = exp((2*pi*f*t)*1i) * y_3;
fr = 0.3;
y_4 = subs(y_44, f, fr);
xa_4 = 0:0.01:1;
ya_4 = 0:0.01:1;
idx = 1;
for v = time
tmp = subs(y_4, t, v);
xa_4(idx) = angle(tmp);
ya_4(idx) = abs(tmp);
% fprintf("%g*%g\n", xa3(idx),ya3(idx));
idx = idx + 1;
end
subplot(2,2,2);
polar(xa_4, ya_4, '-');
% 画质心
y_55 = int(y_4,t,0,1);
hold on;
polar(angle(y_55),abs(y_55),'r.');
% 缠绕频率与质心的x坐标对应关系
idx = 1;
fre = 0.1:0.1:5;
xa_6 = 0.1:0.1:5;
for v = fre
y_6 = subs(y_44, f, v);
y_66 = int(y_6, t, 0, 1);
xa_6(idx) = real(y_66);
% 此处不关心y坐标
% ya_5 = img(y_55);
idx = idx + 1;
end
subplot(2,2,[3,4]);
plot(fre,xa_6,'');