1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| clc,clear
R=10; L=10*10^(-3); C=25.33*10^(-9);
f=10^4; w0=2*pi*f;
t = 0:1/(10^4*f):1/f;
k=1:2:1001;
Ak=4./(pi*k);
Bk=sin(w0*k'*t);
U=Ak*Bk; plot(t,U); hold on
Hjw=1./(1+1j*(L*w0.*k./R - 1./(C*R*w0.*k)));
Hs=abs(Hjw)'.*sin(w0*k'*t+angle(Hjw)'); UR=Ak*Hs; plot(t, UR); legend('输入方波波形','10KHz滤波器') axis([0 1/f -inf inf])
|