信号与系统-信号抽样与连续时间系统分析

1.已知系统的微分方程为 ,
在这里插入图片描述
计算该系统的单位冲激响应和单位阶跃响应。

b=[1 4];
a=[1 3 2];
subplot(2,1,1);
impulse(b,a),grid on;
subplot(2,1,2);
step(b,a),grid on;

在这里插入图片描述
在这里插入图片描述

dt=0.001;
t=-1:dt:3;
f=2*(u(t)-u(t-2));
h=exp(-t).*u(t);
y=dt*conv(f,h);
T=t(1)*2:dt:t(1)*2+(length(y)-1)*dt;
subplot(3,1,1);
plot(t,f),grid on;
xlabel('t'),ylabel('f(t)');
title('f(t)');
subplot(3,1,2);
plot(t,h),grid on;
xlabel('t'),ylabel('h(t)');
title('h(t)');
subplot(3,1,3);
plot(T,y),grid on;
xlabel('t'),ylabel('f(t)*h(t)');
title('f(t)*h(t)');
 

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

function H(R,L,C,n)
b=[1/(L*C)];
a=[1 R/L 1/(L*C)];
subplot(2,2,n);
impulse(b,a),grid on;
if n==4
    axis([0 40 -1 1]);
end
title(['h',num2str(n),'(t)']);
end
程序:
H(4,1,1/3,1);
H(2,1,1,2);
H(1,1,1,3);
H(0,1,1,4);
 

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

b1=[1 0 -4];
a1=[1 2 -3 2 1];
b2=[5 20 25 0];
a2=[1 5 16 30];
subplot(2,1,1);
pzmap(b1,a1);
title('F1(s)的零极点图');
subplot(2,1,2);
pzmap(b2,a2);
title('F2(s)的零极点图');

在这里插入图片描述
5.对于更多零极点和不同零极点位置的连续系统,作出系统的零极点图,分析系统是否稳定。若稳定,作出系统的幅频特性曲线和相频特性曲线。
跳过
在这里插入图片描述

(1) 100HZ
 
dt = 0.000001; 
Ts = 1/3800;  
t1 = -0.005:dt:0.005; 
ft = sin(2*pi*100*t1); 
subplot(221)  
plot(t1,ft), grid on    
xlabel('Time(sec)'),ylabel('f(t)') 
title('频率为100HZ的正弦脉冲信号') 
N=500; 
k = -N:N;  
W = 2*pi*k/((2*N+1)*dt); 
Fw=dt*ft*exp(-j*t1'*W); 
subplot(222)  
plot(W,abs(Fw)), grid on    
xlabel('\omega'),ylabel('F(w)') 
title('正弦脉冲信号的频谱') 
t2 = -0.005:Ts:0.005; 
fst = sin(2*pi*100*t2); 
subplot(223)  
plot(t1,ft,':'),hold on
stem(t2,fst),grid on
xlabel('Time(sec)'),ylabel('fs(t)')
title('抽样后的信号'),hold off
Fsw=Ts*fst*exp(-j*t2'*W);
subplot(224)
plot(W,abs(Fsw)),grid on??
xlabel('\omega'),ylabel('Fs(w)')
title('抽样信号的频谱') 
 

在这里插入图片描述
后面的两个改一下频率就可以
在这里插入图片描述

wm =2;          
wc = 1.2*wm;        
Ts = 1;              
n = -100:100;       
nTs = n *Ts;         
fs = sinc(nTs/pi);
t = -16:0.1:16;
ft = fs*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))));
t1 = -16:0.1:16;
f1 = sinc(t1/pi);
subplot(311)
plot(t1,f1,':'), hold on
stem(nTs,fs),grid on
xlabel('nTs'),ylabel('f(nTs)')
axis([-16 16 -0.5 1.1])
title('抽样间隔Ts=1时的抽样信号f(nTs)')
hold off
subplot(312)
plot(t,ft),grid on
xlabel('t'),ylabel('f(t)')
axis([-16 16 -0.5 1.1])
title('由f(nTs)信号重建得到信号')
error = abs(ft-f1);
subplot(313)
plot(t,error),grid on
xlabel('t'),ylabel('error(t)');
title('重建信号与原信号的绝对误差')
 

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/iamsongyu/article/details/82857781