1-13(b)、(c)、
symst;
f='u(t)-u(t-2)'+(1+t)*'u(t+1)-u(t)';
subplot(2,2,1);ezplot(f,[-2,3]);
axis([-23-0.21.2]);title('f(t)');gridon;
f1=subs(f,t,t+5);
subplot(2,2,2);ezplot(f1,[-7,-2]);
axis([-7-2-0.21.2]);title('f(t+5)');gridon;
f2=subs(f,t,-t+5);
subplot(2,2,3);ezplot(f2,[2,7]);
axis([27-0.21.2]);title('f(-t+5)');gridon;
f3=subs(f,t,-2*t+5);
subplot(2,2,4);ezplot(f3,[-1,4]);
axis([-14-0.21.2]);title('f(-2t+5)');gridon;
实验二连续和离散时间LTI系统的响应及卷积
一、实验目的
掌握利用Matlab工具箱求解连续时间系统的冲激响应、阶跃响应,离散时间系统的单位样值响应,理解卷积概念。
二、实验内容
1、连续时间系统的冲击响应、阶跃响应
a.利用impulse函数画出教材P44例2-15:
LTI系统dy(t)3y(t)2x(t)的冲击
dt
响应的波形。
a=[013];
b=[02];
impulse(b,a);
b.利用step函数画出教材P45例2-17:
LTI系统
1
的阶跃响应的波形。
y''(t)3y'(t)2y(t)x'(t)2x(t)
2
a=[132];
b=[0.52];
step(b,a);
2、离散时间系统的单位样值响应
利用impz函数画出教材P48例2-21:
y[n]3y[n1]3y[n2]y[n3]x[n]的单位样值响应的图形。
a=[1-33-1];
b=[01];
impz(b,a);
3、连续时间信号卷积
画出函数f1(t)=(1+t)[u(t)-u(t-1)]和f2(t)=u(t-1)-u(t-2)的图形,并利用附在后面的sconv.m函数画出卷积积分f1(t)*f2(t)图形。
functionsconv(f1,f2,k1,k2)
f3=conv(f1,f2);
ks=k1
(1)+k2
(1);
ke=k1(end)+k2(end);
k=length(k1)+length(k2)-1;
k3=linspace(ks,ke,k);
subplot(2,2,1)
plot(k1,f1)
title('f1(t)')
xlabel('t')
ylabel('f1(t)')
subplot(2,2,2)
plot(k2,f2)
title('f2(t)')
xlabel('t')
ylabel('f2(t)')
subplot(2,2,3)
plot(k3,f3);
h=get(gca,'position');
h(3)=2.5*h(3);
set(gca,'position',h)
title('f(t)=f1(t)*f2(t)')
xlabel('t')
ylabel('f(t)')
t=-1:
0.01:
3;
f1=(1+t).*(0.5*sign(t)-0.5*sign(t-1));
f2=(0.5*sign(t-1)-0.5*sign(t-2));
sconv(f1,f2,t,t);
4、画出教材P60例2-28中h[n]、x[n]的图形(图2-14(a)(b)),并利用conv函数求出卷积x[n]*h[n]并画出图形(图2-14(f))。
functiondconv(x1,x2,k1,k2)
x3=conv(x1,x2);
ks=k1
(1)+k2
(1);
ke=k1(end)+k2(end);
k=length(k1)+length(k2)-1;
k3=linspace(ks,ke,k);
subplot(2,2,1)
stem(k1,x1)
title('x1[n]')
xlabel('n')
ylabel('x1[n]')
subplot(2,2,2)
stem(k2,x2)
title('x2[n]')
xlabel('n')
ylabel('x2[n]')
subplot(2,2,3)
stem(k3,x3);
h=get(gca,'position');
h(3)=2.5*h(3);
set(gca,'position',h)
title('x[n]=x1[n]*x2[n]')
xlabel('n')
ylabel('x[n]')
n=0:
4;
x1=[ones(1,3),zeros(1,2)];
x2=[1,2,1,zeros(1,2)];
dconv(x1,x2,n,n);
实验三连续时间周期信号的傅里叶级数
一、实验目的
掌握连续时间周期信号的傅里叶级数的展开和合成,理解吉布斯现象,掌握
周期矩形脉冲信号的频谱及脉冲宽度、周期对周期信号频谱的影响。
二、实验内容
1、周期信号的傅里叶级数的展开和合成
画出如下图对称方波(取E=1、T=1),并采用有限项傅里叶级数对原函数进
行逼近,画出对称方波的1、3、5、7、9、11次谐波的傅里叶级数合成波形,观
察吉布斯现象。
(a)
functionF_series(m)
sum=0;
t=-3:
0.01:
3;
E=1;T=1;
ta=T/2;w=2*pi/T;
forn=1:
2*m-1
fn=(2*E*ta/T)*sin(w*ta*n/2)/(w*ta*n/2);
f=(E*ta/T)+cos(n*w*t)*fn-E/2;
sum=sum+f;
end
figure(m)
plot(t,sum);gridon;
title([num2str(2*m-1)'次谐波的傅里叶级数合成波形']);
fori=1:
6
F_series(i);
end
2、周期矩形脉冲信号的频谱
a.取E=1,=1,画出周期矩形脉冲(教材P83图3-6)的傅里叶级数的频谱(教
材P83图3-7);
a.取E=1,=1,画出教材P85图3-8(a);c.取E=1,=1,画出教材P85图3-8(c)。
(a)
n=-12:
12;
E=1;t=1;
T=5*t;w=2/T;
fn=abs(E*t/T*sinc(w*t*n/2));
stem(n,fn,'filled');
holdon
k=-12:
0.01:
12;
f=abs(E*t/T*sinc(w*t*k/2));
plot(k,f,'--');
(b)
functionf=u(t)
f=t>=0;
t=-12:
0.01:
12;
y=u(t+1/4)-u(t-1/4)+u(t-19/4)-u(t-21/4)-u(t+19/4)+u(t+21/4)+u(t-39/4)-u(t-41/4
)-u(t+39/4)+u(t+41/4);
subplot(2,1,1);
plot(t,y);
axis([-1212-0.11.1]);
xlabel('t');
ylabel('f(t)');
n=-12:
12;
E=1;t=1;
T=10*t;w=2/T;
fn=abs(E*t/T*sinc(w*t*n/2));
subplot(2,1,2);
stem(n,fn,'filled');
holdon;
k=-12:
0.01:
12;
f=abs(E*t/T*sinc(w*t*k/2));
plot(k,f,'--');
xlabel('w');
ylabel('Fn');
(c)
t=-12:
0.01:
12;
y=u(t+1/4)-u(t-1/4)+u(t-39/4)-u(t-41/4)-u(t+39/4)+u(t+41/4);
subplot(2,1,1);
plot(t,y);
axis([-1212-0.11.1]);
xlabel('t');
ylabel('f(t)');
n=-12:
12;
E=1;t=1;
T=5*t;w=2/T;
fn=abs(E*t/T*sinc(w*t*n/2));
subplot(2,1,2);
stem(n,fn,'filled');
holdon;
k=-12:
0.01:
12;
f=abs(E*t/T*sinc(w*t*k/2));
plot(k,f,'--');
xlabel('w');
ylabel('Fn');
实验四非周期信号的频域分析
一、实验目的
理解非周期信号的频域分析方法,掌握典型信号的幅度谱和相位谱,理解信号的调制特性,掌握傅里叶变换的性质:
尺度变换、时移、频移、卷积定理、对
称性、微分特性。
二、实验内容
1、利用符号函数fourier和ifourier求傅里叶变换和傅里叶逆变换。
a.利用符号函数fourier求教材P91双边指数信号f(t)
ea|t|当a=3时的傅里叶变
换表达式。
b.
利用符号函数
ifourier
求教材
第一个公式
F(j)
2a
当a=1时的傅里
P92
a2
2
叶逆变换表达式。
c.利用符号函数fourier和ezplot画出f(t)
1e
2tu(t)及其幅频谱。
2
(a)
functionf=Heaviside(t)
f=t>=0;
x='exp(-3*t)'*sym('Heaviside(t)');
F=fourier(x);
subplot(2,1,1);
ezplot(x);
subplot(2,1,2);
ezplot(abs(F));
(b)
>>F=sym('2/(1+w*w)');
>>x=ifourier(F)
x=
exp(-x)*Heaviside(x)+exp(x)*Heaviside(-x)
(c)
x='1/2*exp(-2*t)'*sym('Heaviside(t)');
F=fourier(x);
subplot(2,1,1);
ezplot(x);
subplot(2,1,2);
ezplot(abs(F));
2、幅度调制信号及其频谱
已知线性调制信号表示式如下:
a.cos(t)cos(0t);b.[1.5sin(t)]cos(0t)
式中09,试分别画出它们的波形图和频谱图。
functionf=Dirac(t)
f=Inf.^~t-1;
symst
y1=cos(t)*cos(9*t);
y2=(1.5+sin(t))*cos(9*t);
y11=fourier(y1);
y22=fourier(y2);
subplot(2,2,1),ezplot(y1);
subplot(2,2,2),ezplot(y11);
subplot(2,2,3),ezplot(y2);
subplot(2,2,4),ezplot(y22);
3、傅里叶变换的性质(尺度变换、时移、频移、卷积定理、对称性)
a.设f(t)u(t1)u(t1)
G2(t),求y(t)
u(2t1)u(2t
1)
G1(t)的频谱
Y(j),并与f(t)的频谱F(j
)进行比较。
b.画出f(t)
1e
2tu(t)、f1(t)
1e2(t0.4)u(t0.4)和f2(t)
1e2(t0.4)u(t
0.4)
2
2
2
的幅度谱和相位谱,观察信号时移对信号频谱的影响。
c.画出f(t)
u(t
1)
u(t
1)、f1(t)
f(t)e
j20t和f2(t)
f(t)ej
20t的频谱,进行
相互比较。
d.画出f(t)
u(t
1)
u(t
1)、y(t)
f(t)*
f(t)及其F(j
)、F(j)?
F(j
)和
Y(j)的图形,验证时域卷积定理。
e.设
f(t)
Sa(t),已知信号
f(t)的傅里叶变换为
F(j
)
G2(
)
[u(
1)u(
1)],求
f1(t)
G2(t)
的傅里叶变换
F1(j),画出各自的图形,并验证对称性。
(a)
f1=sym('Heaviside(t+1)-Heaviside(t-1)');
F1=fourier(f1);
f2=sym('Heaviside(2*t+1)-Heaviside(2*t-1)');
F2=fourier(f2);
subplot(2,1,1)
ezplot(abs(F1));
subplot(2,1,2)
ezplot(abs(F2));
(b)
symst;
f0='Heaviside(t)';
f=exp(-2*t)*f0/2;
f1=exp(-2*(t-0.4))*subs(f0,t,t-0.4)/2;
f2=exp(-2*(t+0.4))*subs(f0,t,t+0.4)/2;
F=abs(fourier(f));
subplot(2,3,1),ezplot(F);
F1=abs(real(fourier(f1)));
subplot(2,3,2),ezplot(F1);
F2=abs(real(fourier(f2)));
subplot(2,3,3),ezplot(F2);
h=atan(imag(fourier(f))/real(fourier(f)));
subplot(2,3,4),ezplot(h);
h1=atan(imag(fourier(f1))/real(fourier(f1)));
subplot(2,3,5),ezplot(h1);
h2=atan(imag(fourier(f2))/real(fourier(f2)));
subplot(2,3,6),ezplot(h2);
(c)
f1=sym('Heaviside(t+1)-Heaviside(t-1)');
F1=fourier(f1);
f2=f1*'exp(-j*20*t)';
F2=fourier(f2);
f3=f1*'exp(j*20*t)';
F3=fourier(f3);
subplot(3,1,1)
ezplot(abs(F1));
subplot(3,1,2)
ezplot(abs(F2));
subplot(3,1,3)
ezplot(abs(F3));
(d)
t1=-2:
0.01:
2;
kl=2*length(t1)-1;
ks=2*t1
(1);
ke=2*t1(end);
t2=linspace(ks,ke,kl);
f1=stepfun(t1,-1)-stepfun(t1,1);
y1=conv(f1,f1)*0.01/2;
f=sym('Heaviside(t+1)-Heaviside(t-1)');
F1=fourier(f);F2=F1*F1;
subplot(2,2,1),plot(t1,f1);
subplot(2,2,2),plot(t2,y1);
subplot(2,2,3),ezplot(F1);
subplot(2,2,4),ezplot(F2);;
(e)
symswt;
f=sym('sin(t)/t');
subplot(2,2,1),ezplot(f);
F=fourier(f);
subplot(2,2,2),ezplot(F);
f1=subs(F,'w',t);
subplot(2,2,3),ezplot(f1);
F1=fourier(f1);
subplot(2,2,4),ezplot(F1);
实验五连续信号的抽样和恢复
一、实验目的
理解模拟信号的抽样与重构过程,理解信号时域抽样对频域的影响,理解抽样定理。
二、实验内容
设信号f(t)=Sa(t)=sin(t)/t,在抽样间隔分别为
(1)Ts=0.7(令m=1,c=1.1m)
(2)Ts=1.5(令m=1,c=1.1m)
的两种情况下,对信号f(t)进行采样,试编写MATLAB程序代码,并绘制出抽样信号波形、由抽样信号得到的恢复信号波形。
(提示: