当前位置:文档之家› 信号与线性系统 答案

信号与线性系统 答案

实验一 信号的MATLAB 表示三、 实验内容:1. 用MA TLAB 表示连续信号:t Ae α,)cos(0ϕω+t A ,)sin(0ϕω+t A 。

t Ae αt=0:001:10; A=1; a=-0.4;ft=A*exp(a*t); plot(t,ft))cos(0ϕω+t At=0:0.1:10; A=1; a=1; b=pi/4;ft=A*sin(a*t+b); plot(t,ft))sin(0ϕω+t At=0:0.1:10; A=1; a=1; b=pi/4;ft=A*cos(a*t+b); plot(t,ft)2. 用信号处理工具箱提供的函数表示抽样信号、矩形脉冲信号及三角脉冲信号。

y=sinc(t)y=sinc(t);plot(t,y)y=rectpuls(t, width)t=0:0.01:4;T=1;y=rectpuls(t-2*T, 2*T);plot(t,y)y=tripuls(t , width, skew) t=-5:0.01:5;width=2;skew=0.6;y=tripuls(t, width, skew); plot(t,y)3. 编写如图所示的MA TLAB 函数,并画出)5.0(t f ,)5.02(t f 的图形。

-11-112)(t ft=-2:0.01:3;ft=rectpuls(t+0.5, 1)+(1-t).*rectpuls(t-0.5,1)-rectpuls(t-1.5, 1); plot(t,ft)f5.0(t)function ft=f(t)ft=rectpuls(t+0.5, 1)+(1-t).*rectpuls(t-0.5,1)-rectpuls(t-1.5, 1); plot(t,ft)t=-5:0.01:5;y=f(0.5*t);plot(t,y))5.02(t ft=-2:0.01:8; y=f(2-0.5*t); plot(t,y)4. 用MA TLAB 表示离散信号:k a ,)sin(k A 。

k ak=0:0.2:10; a=2; y=a.^k; stem(k,y)Asin(k)k=0:0.2:10; A=2;y=A*sin(k); stem(k,y)实验二 连续时间系统的时域分析三、实验内容:1. 分别用函数lsim 和卷积积分两种方法求如图所示系统的零状态响应。

其中L=1,R=2,)()(t e t e t ε-=,2)0(=-i 。

-+e (t ) i (t )RL用函数lsimL=1;R=2;sys=tf([1],[L R]); t=0:0.1:10; f=exp(-t);y=lsim(sys,f,t); plot(t,y);xlabel('Time(sec)') ylabel('y(t)')用卷积积分L=1;R=2;sys=tf([1],[L R]);t=0:0.001:10;f=exp(-t);y=impulse(sys,t);z=conv(y,f);plot(z)2. 求上述系统的冲激响应与阶跃响应。

冲激响应L=1;R=2;sys=tf([1],[L R]);t=0:0.1:10;f=exp(-t);y=impulse(sys,t);plot(t,y)xlabel('Time(sec)')ylabel('y(t)')阶跃响应L=1;R=2;sys=tf([1],[L R]); t=0:0.1:10;f=exp(-t);y=step(sys,t);plot(t,y)xlabel('Time(sec)') ylabel('y(t)')实验三信号的Fourier分析三、实验内容:1. 求如图所示周期矩形脉冲信号的Fourier级数表达式,画出频谱图,并用前N次谐波合成的信号近似。

画出周期矩形脉冲信号的频谱图N=8;n1=-N:-1;c1=-2*j*sin(n1*pi/2)/pi./n1;c0=0;n2=1:N;c2=-2*j*sin(n2*pi/2)/pi./n2;cn=[c1 c0 c2];n=-N:N;subplot(1,2,1);stem(n,abs(cn));ylabel('Cn的幅度');xlabel('\Omega');subplot(1,2,2);stem(n,angle(cn));ylabel('Cn的相位');xlabel('\Omega');用前N次谐波合成的信号近似建立M函数f.mfunction s=f(m)s=0;p=0;t=0:0.01:10;for n=1:2:mp=p+1/n*(sin(n*t));ends=(4/pi)*p;plot(t,s)f(20);xlabel('Time(sec)')ylabel('f(t)')2. 求信号)(2t te t ε-的幅度谱。

w=-2*pi:0.2:2*pi; c=(2+j*w).^(-2); plot(w,abs(c)); ylabel('C 的幅度'); xlabel('\Omega');实验四连续系统的频域分析三、实验内容:如图所示系统:+-(1) 对不同的RC值,用freqs函数画出系统的幅频曲线。

for rc=0:200:1000b=[1];a=[rc,1];[Hz,w]=freqs(b,a);w=w./pi;magh=abs(Hz);zeroslndx=find(magh==0);magh(zeroslndx)=1;magh=20*log10(magh);magh(zeroslndx)=-inf;subplot(3,2,(rc+200)/200);plot(w,magh);grid onxlabel('特征角频率(\times\pi rads/sample)')title('幅频特性曲线|H(w)|(dB)');end(2) 信号)3000cos()100cos()(t t t f +=包含了一个低频分量和一个高频分量。

确定适当的RC 值,滤除信号中的高频分量并画出信号)(t f 和)(t y 在2.0~0=t s 范围内的波形。

确定RC 的值 Hz(1)=0; RC=1;while abs(Hz(1))<0.9 b=[1]; a=[RC,1];Hz=freqs(b,a,[100,3000]); RC=RC-0.001; end RCRC =0.0030滤除信号中的高频分量并画出信号)(t f 和)(t y 在2.0~0 t s 范围内的波形 t=0:0.001:0.2;fun1=cos(100*t)+cos(3000*t); sys=tf([1/RC],[1,1/RC]); y=lsim(sys,fun1,t); subplot(2,1,1); plot(t,fun1); xlabel('f(t)'); subplot(2,1,2); plot(t,y,'r'); xlabel('y(t)'); hold off;实验五调制与解调三、实验内容:调制信号为一取样信号,利用MA TLAB分析幅度调制(AM)产生的信号频谱,比较信号调制前后的频谱并解调已调信号。

设载波信号的频率为100Hz。

调制信号syms t;a=20;et=sin(a*t)/(a*t);ezplot(et,[-2,2]);axis([-2 2 -0.5 1.5])对et进行傅立叶变换fourier(et)ans =1/20*pi*(heaviside(w+20)-heaviside(w-20))et 幅普图N=40;w=-N:N;cn=1/20*pi*(heaviside(w+20)-heaviside(w-20)); stem(w,abs(cn));ylabel('幅度');xlabel('\Omega');对信号进行调制并傅立叶变换A0=1;fourier((A0+et)*cos(100*t),'w')ans =1/40*pi*(-heaviside(-w-120)+heaviside(w-80)+heaviside(-w-80)-heaviside(w-120)+40*dirac(w+10 0)+40*dirac(w-100))调制信号的幅度普N=140;w=-N:N;cn=1/40*pi*(-heaviside(-w-120)+heaviside(w-80)+heaviside(-w-80)-heaviside(w-120)+40*dirac(w +100)+40*dirac(w-100));stem(w,abs(cn));ylabel('幅度');xlabel('\Omega');解调clear,syms w;>>ifourier(1/40*pi*(-heaviside(-w-120)+heaviside(w-80)+heaviside(-w-80)-heaviside(w-120)+40*dir ac(w+100)+40*dirac(w-100)),'t')ans =cos(100*t)+1/80*(-i*exp(-80*i*t)+i*exp(80*i*t)+i*exp(-120*i*t)-i*exp(120*i*t))/tclear,syms t;et2=(cos(100*t)+1/80*(-i*exp(-80*i*t)+i*exp(80*i*t)+i*exp(-120*i*t)-i*exp(120*i*t))/t)/cos(100* t)-1;ezplot(et2,[-2 2]);axis([-2 2 -0.5 1.5])实验六无失真传输与滤波三、实验内容:1. 信号任选,分析以下几种情况下信号的频谱和波形变化:(1)系统满足线性不失真条件时;t0=-3*pi;ts=3*pi;dt=0.01;t=t0:dt:ts;T=2*pi;Et=0.5*tripuls(t,2,0);plot(t,Et)(2)系统只满足恒定幅值条件时;t0=-3*pi-1000;ts=3*pi-1000;dt=0.01;t=t0:dt:ts;T=2*pi;E1t=0.5.*(0.5*tripuls(t+1000,2*T,0)+0.5*tripuls(t-1000,2*T,0)); subplot(1,2,1);plot(t,E1t)t0=-3*pi+1000;ts=3*pi+1000;dt=0.01;t=t0:dt:ts;T=2*pi;E1t=0.5.*(0.5*tripuls(t+1000,2*T,0)+0.5*tripuls(t-1000,2*T,0)); subplot(1,2,2);plot(t,E1t)(3)系统只满足相位条件时;clear;t0=-3*pi-1000;ts=3*pi-1000;dt=0.01;t=t0:dt:ts;figure(1);T=2*pi;T1=2;Rt=0.5*(0.5.*tripuls(t+1000,2*T,0)+0.5.*tripuls(t+1000,2*T,0)).*(tripuls(t-1000,2*T1,0)+tripuls(t+ 1000,2*T1,0));subplot(1,2,1);plot(t,Rt)t0=-3*pi+1000;ts=3*pi+1000;dt=0.01;t=t0:dt:ts;Rt=0.5*(0.5.*tripuls(t-1000,2*T,0)+0.5.*tripuls(t-1000,2*T,0)).*(tripuls(t-1000,2*T1,0)+tripuls(t+1 000,2*T1,0));subplot(1,2,2);plot(t,Rt)(4)系统两个条件均不满足时。

相关主题