信号与系统实验1教材.docx
《信号与系统实验1教材.docx》由会员分享,可在线阅读,更多相关《信号与系统实验1教材.docx(13页珍藏版)》请在冰点文库上搜索。
信号与系统实验1教材
信号与系统实验一
7.1(7.2)、利用MATLAB的向量表示法和符号运算功能表示下列连续信号的时域波形。
1、f(t)=4sin(2πt-π/4)
向量法:
t=-2*pi:
pi/50:
2*pi;
y=4*sin(2*pi*t-pi/4);
plot(t,y)
符号法:
symst
f=sym('4*sin(2*pi*t-pi/4)')
ezplot(f,[-pi,pi])
(2)f(t)=(1-e-2t)u(t)
向量法:
t=-1:
0.01:
1;
f=(1-exp(-2*t)).*Heaviside(t);
plot(t,f)
set(gcf,'color','w')
title('exp(-2t)')
xlabel('t')
符号法:
symst;
f=('(1-exp(-2*t)).*Heaviside(t)')
ezplot(f,[-2,2])
7.3利用matlab绘出下列离散序列的离散波形。
(3)x(n)=n[u(n)-u(n-5)]
n=-3:
8;
x=n.*(jyxl(n)-jyxl(n-5));
stem(n,x,'filled')
title('x(n)=n[u(n)-u(n-5)]')
xlabel('n')
7.4、用MATLAB编程绘制出下列连续时间信号的时域波形,观察信号是否为周期信号?
若是周期信号,周期是多少?
若不是周期信号,请说明原因。
(1)f(t)=sin(t)+2sin(πt)
symst
f=sym('sin(t)+2*sin(pi*t)')
ezplot(f,[-5*pi,5*pi])
答:
此信号不是周期信号,因为T1=2π,T2=2,周期之比为无理数,所以不是周期信号。
7.5用MATLAB编程绘制出下列复信号的实部、虚部模、辐角随时间变化的曲线,观察分析复信号的时域特征。
(2)f(t)=e-(2+j2)t
functionfexp(d,w,t1,t2,a)
%绘制复指数信号时域波形程序
%t1:
绘制波形的起始时间
%t2:
绘制波形的终止时间
%d:
:
复指数信号复频率实部
%w:
复指数信号复频率虚部
%a:
复指数信号幅度
t=t1:
0.01:
t2;
f=a*exp((d+i*w)*t);
fr=real(f);
fi=imag(f);
fa=abs(f);
fn=angle(f);
subplot(2,2,1)
plot(t,fr)
axis([t1,t2,-(max(fa)+0.5),max(fa)+0.5]),
title('实部');
subplot(2,2,2)
plot(t,fi)
axis([t1,t2,-(max(fa)+0.5),max(fa)+0.5]),
title('虚部');
subplot(2,2,3)
plot(t,fa)
axis([t1,t2,0,max(fa)+1])
title('模');
subplot(2,2,4)
plot(t,fn)
axis([t1,t2,-(max(fn)+1),max(fn)+1])
title('相角');
fexp(-2,-2,-3,8,1)
7.6已知连续时间信号f(t)=
,试用matlab编程绘出下列信号的时域波形。
(4)f(1-
t)
symst;
f=sym('sin(pi*t)/t');
subplot(1,2,1)
ezplot(f,[-3,3])
axis([-5,5,-1.2,1.2])
set(gcf,'color','w')
title('f(t)')
f1=subs(f,t,1-0.5*t);
subplot(1,2,2)
ezplot(f1,[-5,5])
title('f(1-1/2*t)')
7.7、离散时间信号的时域波形,观察序列是否为周期信号?
若是周期序列,周期是多少?
若不是周期序列,请说明原因。
(2)x(n)=cos(nπ/6)+sin(nπ/3)+cos(nπ/2)
p=0.5;
n=-12:
1:
12;
t=-2*pi:
p:
2*pi;
x=cos(n*pi/6)+sin(n*pi/3)+cos(n*pi/2);
stem(n,x,'filled')
如图可知是周期函数,周期为12.
7.8用matlab编程绘出下列复数序列的实部、虚部、模和辐角随时间变化的波形图,观察分析复指数序列的时域特性。
(2)x(n)=1.5ej
+ej
n=-3:
30;
x1=1.5*(exp(i*pi/8).^n);
x2=exp(i*pi/4).^n;
x=x1+x2;
xr=real(x);
xi=imag(x);
xa=abs(x);
xn=angle(x);
subplot(2,2,1),stem(n,xr,'filled'),title('实部'),xlabel('n')
subplot(2,2,2),stem(n,xa,'filled'),title('模'),xlabel('n')
subplot(2,2,3),stem(n,xi,'filled'),title('虚部'),xlabel('n')
subplot(2,2,4),stem(n,xn,'filled'),title('相角'),xlabel('n')
7.9已知离散序列x(n)如图,试用matlab编程绘出满足下列要求的离散序列波形。
(1)x(-n-2)
x1=[-0,3,3,3,3,2,1,0,0];
n1=-4:
4;
subplot(1,3,1)
stem(n1,x1,'filled')
title('x(n)')
xlabel('n')
subplot(1,3,2)
[x3,n3]=xlpy(x1,n1,2);
stem(n3,x3,'filled')
title('x(n+2)'),xlabel('n')
subplot(1,3,3)
[x2,n2]=xlfz(x3,n3)
stem(n2,x2,'filled')
title('x(-n-2)')
xlabel('n')
(4)x(n-4)x(n-2)
x1=[-0,3,3,3,3,2,1,0,0];
n1=-4:
4;
subplot(2,2,1)
stem(n1,x1,'filled')
title('x(n)')
xlabel('n')
subplot(2,2,3)
[x2,n2]=xlpy(x1,n1,-4);
stem(n2,x2,'filled')
title('x(n-4)'),xlabel('n')
subplot(2,2,2)
[x3,n3]=xlpy(x1,n1,-2);
stem(n3,x3,'filled')
title('x(n-2)'),xlabel('n')
subplot(2,2,4)
[x4,n4]=cxl(x2,x3,n2,n3);
stem(n4,x4,'filled')
title('x(n-2)x(n-4)'),xlabel('n')
7.10试利用matlab生成并绘制如下信号:
(3)周期为π,峰值为1的周期锯齿波;
t=0:
0.01:
15;
f=sawtooth(pi*t,1);
plot(f)