基于matlab的零极点分布和信号采样

  • 格式:pdf
  • 大小:225.09 KB
  • 文档页数:7

2011级华南理工大学电子与信息学院信息工程2班基于matlab的零极点分布
和信号采样
[35那些年]
2013/6/19
基于matlab的零极点分布
和信号采样
一.实验过程
1.在[0,0.1]区间上以50Hz的抽样频率对下列3个信号分别进行抽样,试画出抽样后序列的波形,并分析产生不同波形的原因,提出改进措施。

实验代码1: plotcos.m
%实验内容一
t0=0:0.001:0.1;%画出原信号所需的间隔
Fs=50;%采样频率为50Hz
t=0:1/Fs:0.1;%采样间隔为[0,0.1]
subplot(3,1,1),
x1=cos(2*pi*10*t0);
plot(t0,x1,'r');%画出原信号x(t)=cos(2*pi*10t)的图形
hold on
x11=cos(2*pi*10*t);
stem(t,x11,'filled');%画出信号x(t)=cos(2*pi*10t)采样后的图形xlabel('t'),ylabel('x1(t)');
title('signal x1(t)=cos(2*pi*10t)');
hold off
subplot(3,1,2),
x2=cos(2*pi*50*t0);
plot(t0,x2,'r');%画出原信号x(t)=cos(2*pi*50t)的图形
hold on
x22=cos(2*pi*50*t);
stem(t,x22,'filled');%画出信号x(t)=cos(2*pi*50t)采样后的图形xlabel('t'),ylabel('x2(t)');
title('signal x2(t)=cos(2*pi*50t)');
hold off
subplot(3,1,3),
x3=cos(2*pi*100*t0);
plot(t0,x3,'r');%画出原信号x(t)=cos(2*pi*100t)的图形
hold on
x33=cos(2*pi*100*t);
stem(t,x33,'filled');%画出信号x(t)=cos(2*pi*100t)采样后的图形xlabel('t'),ylabel('x3(t)');
title('signal x3(t)=cos(2*pi*100t)');
hold off
%改进后信号采样
Fs1=400;%采样频率为400Hz
Fs2=1000;%采样频率为1000Hz
t1=0:1/Fs1:0.1;%采样间隔为[0,0.1]
t2=0:1/Fs2:0.1;%采样间隔为[0,0.1]
figure (2)
subplot(2,1,1),
x2=cos(2*pi*50*t0);
plot(t0,x2,'r');%画出原信号x(t)=cos(2*pi*50t)的图形
hold on
x22=cos(2*pi*50*t1);
stem(t1,x22,'filled');%画出信号x(t)=cos(2*pi*50t)采样后的图形xlabel('t'),ylabel('x2(t)');
title('signal x2(t)=cos(2*pi*50t)');
hold off
subplot(2,1,2),
x3=cos(2*pi*100*t0);
plot(t0,x3,'r');%画出原信号x(t)=cos(2*pi*100t)的图形
hold on
x33=cos(2*pi*100*t2);
stem(t2,x33,'filled');%画出信号x(t)=cos(2*pi*100t)采样后的图形xlabel('t'),ylabel('x3(t)');
title('signal x3(t)=cos(2*pi*100t)');
hold off
实验结果1:
实验结果分析1:由以上的三图可知,第一个图的离散序列基本可以显示出原来信号,可以通过低通滤波恢复,因为信号的频率为20HZ,而采样频率为50>2*20,故可以恢复,但是第二个和第三个信号的频率分别为50和100HZ,因此理论上是不能够恢复的,需要增大采样频率, 解决的方案为,第二个信号的采样频率改为400HZ,而第三个的采样频率改为1000HZ,这样可以很好的采样。

改变采样频率后的图形:
2.绘出拉普拉斯变换的曲面图,并分析拉普拉斯变换零极点位置。

实验代码2:laplacetransform.m
clf;
a=-6:0.48:6;
w=-6:0.48:6;
[a,w]=meshgrid(a,w);%产生栅格数据点
s=a+i*w;
Fs=(2*(s-3).*(s+3))./((s-5).*(s.^2+10));%系统函数H(s)
Fs=abs(Fs);
mesh(a,w,Fs);%绘制系统函数H(s)三维网格曲面
surf(a,w,Fs);
title('Laplace Transform');
colormap(hsv);%图形根据数值的大小彩色
实验结果2:
图a 实验内容二之极点截图
图b 实验内容二之零点截图
实验结果分析2:根据上图a可知,题述系统函数的极点有三个,分别为图中的三个峰顶,分布如图所示;再根据图b可知,该系统函数含有两个最低的谷底,即该系统函数含有两个零点,分布如图所示。

3.绘出连续系统函数的零极点图。

实验代码3:polezero_pic.m
%系统函数H1(s)=[2(s-3)(s+3)]/[(s-5)(s^2+10)]
%系统函数H2(s)=[5s(s^2+4s+5)]/(s^3+5s^2+16s+30)
clf;
a1=[2 0 -18];%系统函数H1(s)分子的系数
a2=[1 -5 10 -50];%系统函数H1(s)分母的系数
b1=[5 20 25 0];%系统函数H2(s)分子的系数
b2=[1 5 16 30];%系统函数H2(s)分母的系数
p1=roots(a1);%求系统函数H1(s)分子的根
p2=roots(a2);%求系统函数H1(s)分母的根
subplot(2,1,1);
hold on;
plot(real(p1),imag(p1),'o');%画出系统函数H1(s)的极点
plot(real(p2),imag(p2),'x');%画出系统函数H1(s)的极点
axis([-6 6 -6 6]);%调整坐标轴
plot([-6 6],[0,0]);%画出x轴
plot([0,0],[-6 6]);%画出y轴
title('系统函数H1(s)=[2(s-3)(s+3)]/[(s-5)(s^2+10)]的零极点图'); hold off
q1=roots(b1);%求系统函数H2(s)分子的根
q2=roots(b2);%求系统函数H2(s)分母的根
subplot(2,1,2);
hold on;
plot(real(q1),imag(q1),'o');%画出系统函数H2(s)的零点
plot(real(q2),imag(q2),'x');%画出系统函数H2(s)的极点
axis([-6 6 -6 6]);%调整坐标轴
plot([-6 6],[0,0]);%画出x轴
plot([0,0],[-6 6]);%画出y轴
title('系统函数H2(s)=[5s(s^2+4s+5)]/(s^3+5s^2+16s+30)的零极点图');
hold off
实验结果3:。