基于MATLAB信号与系统中抽样定理的仿真(最终版).

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

分类号编号
烟台大学文经学院
毕业论文(设计)
基于MATLAB信号与系统中抽样定理的仿真Signal and System Based on MATLAB simulation sampling theorem
系别:电子信息与计算机科学系
专业:通信技术
班级:
姓名:
学号:
指导老师:(讲师)
2013年 6 月 1 日
烟台大学文经学院
基于MATLAB信号与系统中抽样定理的仿真
姓名:
导师:
2013年 6 月 1 日
烟台大学文经学院
烟台大学文经学院毕业论文(设计)任务书系(部):电子信息与计算机科学系
姓名学号毕业届

专业通信技术
毕业论文(设计)题目基于MATLAB的信号与系统中抽样定理的仿真
指导教师学历硕士
研究

职称讲师所学专业物理电子学
具体要求(主要内容、基本要求、主要参考资料等):
主要内容:基于MATLAB的信号与系统中抽样定理的仿真,利用MATLAB在数字信号处理中的基本应用,并会对结果用所学知识进行分析。

基本要求:掌握MATLAB的基本操作,掌握基于MATLAB的通信系统的设计与实现的基本工作原理,理解系统中各信号抽样仿真的原理。

主要参考资料:
[1] 楼顺天.基于MATLAB的系统分析与设计——信号处理[M].西安:西安电子科技
大学出版社
[2] 邹理和.数字信号处理[M].北京:国防工业出版社,1988.39~41滞后,这就是离散
系统最常用零阶保持器的主要原因之一。

进度安排:
2013年3月5日前,确定选题及指导教师
2013年3月5日至3月31日,进行毕业设计调研,完成大概设计
2013年4月1日至4月20日,进行毕业设计,写论文
2013年4月20日至4月25日,对内容和机构进行第一遍修改
2013年5月1日前,进行第二遍修改
2013年5月10日---6月1日设计作品验收、论文装订、毕业答辩
指导教师(签字):
年月日
系部、院(系)意见:
系(部)主任或教学院长签字:
年月日
备注:
[摘要] 与连续时间信号相比,离散时间信号的处理更加灵活、方便,应用更加广泛。

在实际应用中,通常先将连续时间信号转换成离散时间信号,前提是抽样过程必须满足抽样定理。

抽样定理在连续时间信号与离散时间信号之间架起了一座桥梁。

本文利用MATLAB对抽样过程进行仿真,并对抽样定理的条件与结论进行验证和讨论,通过研究可以得到符合实际应用的结论,同时加深对抽样定理的理解和把握。

[关键词] MATLAB; 抽样定理;仿真
Abstract: The processing for discrete—time signal is more flexible,convenient,and more widely used,compared with continuous—time signa1.In practice,continuous—time signal is usually changed into discrete-time signal firstly,provided that the sampling process meets the sampling theorem.Sampling theorem sets up a bridge between continuous-time signal and discrete—time signa1.But must the restrictions and conclusion of the sampling theorem coincide with the actual application? In this paper,sampling process is simulated by using MATLAB ,and the conditions and conclusion of sampling theorem is validated and discussion,through which shows that the restrictions and the conclusion of sampling theorem agrees with the practice;meanwhile,understanding and grasp of sampling theorem is deepened.
Key words:MATLAB;sample theory; simulation
目录
第1章绪论 (1)
1.1 MATLAB语言的特点 (1)
1.2 MATLAB产品主要的应用领域 (1)
1.3 抽样定理简介 (1)
第2章抽样信号 (4)
2.1 抽样信号原理 (4)
2.2 模拟信号算法 (5)
2.2.1 模拟信号频率计算. (5)
2.2.2 采样信号频率计算. (5)
2.2.3 模拟信号实现 (5)
2.3 本章小结 (8)
第3章MATLAB程序仿真 (9)
3.1仿真目的 (9)
3.2仿真原理说明及设计内容 (9)
3.3设计内容 (10)
3.4仿真设计实现:信号的产生和频域分析 (10)
结论 (17)
致谢 (18)
参考文献 (18)
附录A (19)
附录B (25)
第1章 绪论
MATLAB (Matrix Laboratory )是1984年美国Math Works 公司产品,MATLAB 的推出得到了各个领域专家学者的广泛关注,并越来越多的应用到我们的学习生活中来,是目前通信工程上最广泛应用的软件之一。

Matrix Laboratory 意为“矩阵实验室”,最初的MATLAB 只是一个数学计算工具。

但现在的MATLAB 已经远不仅仅是一个“矩阵实验室”,它已经成为一个集概念设计、算法开发、建模仿真,实时实现于一体的集成环境,它拥有许多衍生子集工具。

MATLAB 的基本数据单位是矩阵,它的指令表达式与数学,工程中常用的形式十分相似,故用MATLAB 来解算问题要比用C,FORTRAN 等语言完全相同的事情简捷得多.在新的版本中也加入了对C,FORTRAN,c++ ,JA V A 的支持.可以直接调用,用户也可以将自己编写的实用程序导入到MATLAB 函数库中方便自己以后调用。

1.1MATLAB 语言的特点
(1)语言简洁紧凑, 语法限制不严,程序设计自由度大,可移植性好。

(2)运算符、库函数丰富。

(3)强大的数值(矩阵)运算功能。

(4)界面友好、编程效率高。

(5)图形功能强大。

1.2MATLAB 产品主要的应用领域
(1)仿真和建模 (2)实时仿真 (3)自动控制
(4)信号处理与通信 (5)数据分析/科学计算 (6)算法开发
(7)图形和可视化法 (8)独立应用开发 (9)其他领域 1.3
抽样定理简介
定义
所谓抽样。

就是对时间连续的信号隔一定的时间间隔T 抽取一个瞬时幅度值(样值),抽样是由抽样门完成的。

在一个频带限制在(0,h f )内的时间连续信号()t f ,如果以h f 21的时间间隔对它进行抽样,那么根据这些抽样值就能完全恢复原信号。

或者说,如果一个连续信号()t f 的频谱中最高频率不超过h f ,当抽样频率s f ≥h f 2时,抽样后的信号就包含原连
续的全部信息。

意义
抽样定理指出,由样值序列无失真恢复原信号的条件是s f ≥h f 2 ,为了满足抽样定理,要求模拟信号的频谱限制在0~h f 之内(h f 为模拟信号的最高频率)。

为此,在抽样之前,先设置一个前置低通滤波器,将模拟信号的带宽限制在h f 以下,如果前置低通滤波器特性不良或者抽样频率过低都会产生折叠噪声。

例如,话音信号的最高频率限制在3400HZ ,这时满足抽样定理的最低的抽样频率应为s f =6800HZ ,为了留有一定的防卫带,CCITT 规定话音信号的抽样率s f =8000HZ ,这样就留出了8000-6800=1200HZ 作为滤波器的防卫带。

应当指出,抽样频率s f 不是越高越好,太高时,将会降低信道的利用率(因为随着s f 升高,数据传输速率也增大,则数字信号的带宽变宽,导致信道利用率降低。

)所以只要能满足s f ≥h f 2,并有一定频带的防卫带即可。

以上讨论的抽样定理实际上是对低通信号的情况而言的,设模拟信号的频率范围为0f ~h f ,带宽B=h f -0f .如果0f <B ,称之为低通型信号,例如,话音信号就是低通型信号的,弱0f >B ,则称之为带通信号,载波12路群信号(频率范围为60~108KHZ )就属于带通型信号。

对于低通型信号来讲,应满足s f ≥h f 2的条件,而对于带通型信号,如果仍然按照这个抽样,虽然能满足样值频谱不产生重叠的要求,但是无疑s f 太高了(因为带通信号的h f 高),将降低信道频宽的利用率,这是不可取的。

适用范围
抽样定理在实际应用中应注意在抽样前后模拟信号进行滤波,把高于二分之一抽样频率的频率滤掉。

这是抽样中必不可少的步骤。

抽样定理
抽样定理:设时间连续信号()t f ,其最高截止频率为m f ,如果用时间间隔为T ≤m f 21
的开关信号对()t f 进行抽样时,则()t f 就可被样值信号唯一地表示。

定理分类 时域抽样定理
频带为F 的连续信号()t f 可用一系列离散的采样值()1t f ,()t t f ∆±1,()t t f ∆±21,...来表示,只要这些采样点的时间间隔Δt≤1/2F ,便可根据各采样值完全恢复原来的信号()t f 。

这是时域采样定理的一种表述方式。

时域采样定理的另一种表述方式是:当时间信号函数()t f 的最高频率分量为m
f 时,()t f 的值可由一系列采样间隔小于或等于m f 21的采样值来确定,即采样点的重复频率m f f 2≥。

图为模拟信号和采样样本的示意图。

时域采样定理是采样误差理论、随机变量采样理论和多变量采样理论的基础。

[1] 频域抽样定理
对于时间上受限制的连续信号()t f (即当│t│>T 时,()t f =0,这里T=12T T -是信号
的持续时间),若其频谱为()ω
F,则可在频域上用一系列离散的采样值采样值来表示,只要这些采样点的频率间隔频率间隔。

用MATLAB软件来进行抽样定理的实现,可以很容易的实现,能够达到实验室所不能达到的理想化(器件各种参数),用软件实现还可以节省大量的人力及物力。

第2章 抽样信号
2.1 抽样信号原理
设 ()t X a 是连续时间信号,()t X a 的傅立叶变换为:
()()[]()tdt e t X t X j X j a a a Ω-⎰==Ω (2.1) 设 ()t P 为周期冲激脉冲信号, s T 为采样周期,
()()∑∞
-∞=-n s nT t t P δ (2.2)
以()t X a ˆ表示采样输出, 则:
()()∑∞
∞--=s a a nT t t X t X δ)(ˆ (2.3)
根据傅立叶变换性质,采样信号()t X a ˆ 的傅立叶变换为 ()()()[]Ω*Ω=Ωj P j X j X a a π21ˆ (2.4) 其中 P(jΩ) 为 ()t P 的傅立叶变换, 因此, ()()()[]∑∞
-∞
=-Ω=Ωn a
a T jn j X T
j X π21ˆ (2.5)
从 (2.5) 式我们又可得到 ()()()()()∑∑∞
-∞
=∞
-∞
=-=-=
n s
s
a
n s
a
a nT t nT X nT t t X t X δδˆ (2.6)
采样信号ˆ()Xa
t 的傅立叶变换的另一种表示形式为
()()[]
()()()()()()Ts
j a j a j n a j a a a e nTs X dt e
nTs t nTs X dt e nTs t nT X dt e t X t X j X Ω-∞
∞-Ω
-∞
∞-∞

-Ω-∞∞-∞-∞=Ω-∞∞-∑∑⎰⎰∑⎰=-=⎥⎦
⎤⎢
⎣⎡-===Ωδδϕˆˆˆ(2.7)
上式说明采样后的信号频谱是采样之前信号频谱以整数倍采样频率的平移然后叠加形成的。

式(2.7)用于离散时间信号的傅立叶变换的计算。

Ω是连续的模拟频
率,2f πΩ=。

2.2 模拟信号算法
2.2.1 模拟信号频率计算.
在计算机中模拟信号是无法存储的, 但当模拟信号 ()t X a 为有限 (-L ≤ t ≤ P , L, P 是正数) 时,以充分小的时间取 ()t X a 的值,就可得到一根平滑的曲线,用于近似分析。

本文中,()t X a 选用双指数函数, L= P 。

此时, ()t X a 可用一数组 ()m X a 表示, 数组的大小是从- L 的点起到L 点之间间隔为$ t 的点数,并用 m 表示各个点。

当 ()t X a 用 ()m X a 表示时,
()[()]j m Xa j Xa m e t -ΩΩ=∆ (2.8) 设
1()(),[(1),(2),()]
N
l Z x l y l X x x x N ===⋅⋅⋅∑,[(1),(2),,()],Y y y y N =ΩΩ⋅⋅⋅Ω则
T T Y XY z ,=则为矩阵 Y 的转置。

考虑到频率范围较大, 需将化分成一定间隔的频率点。

设的频率范围为 (-max W ,max W ) ,取频率间隔为 K W max ,K 为常数,根据实际情况来选择,则正频率点为0,K W max ,2K W max , K kW max , K KW max 。

负频率点与正频率点对称,共有 2K+1 个频率点。

由此y() 中后一个数值表示频率点.
根据上述原理,式(2.8)变为 t e X X jtTw a a ∆=-,
其中a X =[()L X a -,()t L X a ∆+-,……,()t P X a ∆-,()P X a ],
t=[-L,-L+t ∆,……,P-t ∆,P], W=k(K W max ),
k=[-K,-K+1,……,K-1,K], tT 为t 矩阵的转置.
2.2.2 采样信号频率计算.
设采样周期为s T ,则采样信号 a X ˆ =[()s a NT X -,()()s a T N X 1--,…,()0a X ,…,()()s a T N X 1-,()s a NT X ] 其中s NT =L.
根据jnTw a a e
X X -=ˆˆ,其中 n=[-N s T ,-(N-1)s T ,…,0,…,(N -1)s T ,N s T ] W=k(K W max )
k=[-K,-K+1,…,K -1,K]
K 为常数,nT 为n 矩阵的转置。

这里以频率f 为横轴,不同于文献[2]。

.
2.2.3模拟信号实现
1)模拟信号及其傅立叶变换图形[2].取1000()t a X t e -=,用MATLAB 编程画出的()a X t 和()a X t 的傅立叶变换()a X j Ω图形如图1所示.程序中利用了5e -≈0,并取L=P=5ms,时间间隔为0.05ms 。

(a )模拟信号; (b )连续傅立叶变换
图2.1 用MATLAB 编程画出的()t x a 及()8j X a
当2(2000)P Ω≥时,()0a X j Ω≈。

为了与后面的采样信号对比,取max W =2P(6000),K=2000,共有4001个频率点,2f πΩ=,傅立叶变换()a X j Ω,以f 为横轴。

2)s T =0.2ms 时,()t x a 的采样信号及其傅立叶变换图形.从图1可以认为,模拟信号的最高频率max f =2kHz,现s T =0.2ms,则s f =1s T =5000Hz>2max f ,采样频率大于模拟信号最高频率的2倍,满足抽样定理.其它条件L=P=5ms,max W =2P(6000),K=2000.采样信号1x 及其傅立叶变换1X 如图2.2所示。

(a )采样信号1x
(b )离散时间傅立叶变换1X
图2.2 s T =0.2ms,采样信号和离散时间傅立叶变换
3)s T =0.5ms 时,()a X t 的采样信号及其傅立叶变换图形.因为s T =0.5ms,则s f =1s T =2000Hz<2max f ,采样频率小于模拟信号最高频率的2倍,不满足抽样定理.其它条件L=P=5ms,max W =2P(6000),K=2000.采样信号x2及其傅立叶变换X2如图2.3所示
(a)采样信号2X
X
(b)离散时间傅立叶变换
2
T=0.5ms,采样信号和离散时间傅立叶变换
图2.3
s
2.3本章小结
图2.1—2.3利用了相同的坐标。

图2.2以5kHz的频率采样,图2.3以2kHz的频率采样,采样后的信号频谱是采样之前信号频谱以整数倍采样频率的平移、叠加形成;当采样频率大于模拟信号最高频率2倍时,采样信号的频谱不互相重叠,模拟信号能从采样信号中不失真地还原;当采样频率小于模拟信号最高频率2倍时,采样信号的频谱互相重叠,模拟信号不能从采样信号中还原.这完全符合抽样定理[3].图形是根据原理用MATLAB编程实现的,实现起来非常简单,而且结论非常可靠明确。

第3章 MATLAB 程序仿真
3.1仿真目的
1)熟悉抽样定理、信号的抽样过程;
2)通过实验观察欠采样时信号频谱的混叠现象;
3)掌握抽样前后信号的频谱的变化,加深对抽样定理的理解; 4)掌握抽样频率的确定方法。

3.2仿真原理说明及设计内容
抽样器
()
f t 函数发生

频率可调方波产生
器()
fs t 抽样原理框图
低通抽样定理:一个频带限制在(0,H f )赫内的时间连续信号()m t ,如果以
()1/2s H T f <秒的时间间隔对它进行等间隔
(均匀抽样,则()m t 将被所得到的抽样值完全确定。

此定理告诉我们:若()m t 的频谱在某一角频率上h w 以上为零,则()m t 中的全部信息完全包含在其间隔不大于()1/2H f 秒的均匀抽样序列里。

抽样速率s f (每秒钟的抽样点数)应不小于2H f ,否则,若抽样速率2s H f f <,则会产生失真,这种失真叫混叠失真。

3.3设计内容
(1)产生一个连续的时间连续信号,并对其进行频谱分析,绘制时域波形图和频域波形图。

(2)对产生的连续信号进行抽样,并绘制抽样后的时域波形图,和频域波形图。

(3)改变抽样频率,分别对原始连续信号抽样,绘制抽样后的时域和频域波形,最后对得到的波形进行分析。

从而验证抽样定理。

3.4仿真设计实现:信号的产生和频域分析
用MATLAB产生一个连续的信号,2
)
t
t
m=;根据抽样定理,在
(t
)^
200
/)
(sin(
200
MATLAB中编写源程序代码,画出原信号时域波形和频域波形,再分别用不同的频率的抽样脉冲对其进行抽样,在MATLAB中实现不同频率抽样时,时域和频域波形的效果对比,验证抽样定理。

(1)原始信号2
(t
t
m=的时域波形和频域波形的源程序代码如
t
)
)^
200
/)
200
(sin(
下:
t0=10;%定义时间长度
ts=0.001; % 抽样周期
fs=1/ts;
df=0.5;% 频率的分辨率
t=[-t0/2:ts:t0/2];%定义时间序列
x=sin(200*t);m=x./(200*t);
w=t0/(2*ts)+1;
m(w)=1;%定义在t=0时刻的值为1
m=m.*m; m=50.*m;%定义函数sinc(200t)
subplot(2,1,1); plot(t,m);
xlabel('时间'); title('原信号的时域波形')
axis([-0.15,0.15,-1,50]);
[M,mn,dfy]=fftseq(m,ts,df);%傅里叶变换,程序在后面
M=M/fs;
f=[0:dfy:dfy*length(mn)-dfy]-fs/2;%定义频率序列
subplot(2,1,2); plot(f,abs(fftshift(M)));
xlabel('频率');
axis([-500,500,0,1]);
title('原信号的频域波形');
-0.1
-0.05
00.050.1
0.15
1020304050时间
原信号的时域波形
-500
-400-300-200-100
010*******
400500
00.5
1
频率
原信号的频域波形
(2)原始信号)(t m 在抽样频率为200HZ 和400HZ 的抽样脉冲下抽样波形(此时的满足抽样定理s h f f 2),其时域和频域波形如下:
%200hz 抽样 t0=10;%定义时间长度 ts1=0.005; %充足抽样周期 fs1=1/ts1;
df=0.5;% 频率的分辨率
t1=[-t0/2:ts1:t0/2];%定义时间序列 x1=sin(200*t1);m1=x1./(200*t1); w1=t0/(2*ts1)+1;
m1(w1)=1;%定义在t=0时刻的值为1
m1=m1.*m1; m1=50.*m1;%定义函数sinc (200t ) subplot(2,1,1);stem(t1,m1);
xlabel('时间'); title('抽样频率2fh<fs 时时域波形') axis([-0.15,0.15,-1,50]);
[M1,mn1,dfy1]=fftseq(m1,ts1,df);%傅里叶变换,程序在后面 M1=M1/fs1;
N1=[M1,M1,M1,M1,M1,M1,M1,M1,M1,M1,M1,M1,M1];
f1=[-7*dfy1*length(mn1):dfy1:6*dfy1*length(mn1)-dfy1]-fs1/2;%定义频率序列 subplot(2,1,2); plot(f1,abs(fftshift(N1)))
xlabel('频率'); axis([-500,500,0,1]);
title('抽样频率fh<1/2fs 时信号的频域波形');
-0.1
-0.05
00.050.1
0.15
10203040
50时间
抽样频率200HZ 时时域波形
-500
-400-300-200-100
0100200300400500
00.5
1
频率
抽样频率为200HZ 时信号的频域波形
-0.1
-0.05
00.050.1
0.15
10203040
50时间
抽样频率400HZ 时时域波形
-500
-400-300-200-100
0100200300400500
00.5
1
频率
抽样频率为400HZ 时信号的频域波形
(3)原始信号)(t m 在抽样频率为100HZ 的抽样脉冲下的抽样波形(此时不满足抽样定理),其时域和频域波形如下所示:
%100hz 抽样 t0=10;%定义时间长度 ts1=0.01; %欠抽样周期 fs1=1/ts1;
df=0.5;% 频率的分辨率
t1=[-t0/2:ts1:t0/2];%定义时间序列 x1=sin(200*t1);m1=x1./(200*t1); w1=t0/(2*ts1)+1;
m1(w1)=1;%定义在t=0时刻的值为1
m1=m1.*m1; m1=50.*m1;%定义函数sinc (200t ) subplot(2,1,1);stem(t1,m1);
xlabel('时间'); title('抽样不足时时域波形') axis([-0.15,0.15,-1,50]);
[M1,mn1,dfy1]=fftseq(m1,ts1,df);%傅里叶变换,程序在后面 M1=M1/fs1;
N1=[M1,M1,M1,M1,M1,M1,M1,M1,M1,M1,M1,M1,M1];
f1=[-7*dfy1*length(mn1):dfy1:6*dfy1*length(mn1)-dfy1]-fs1/2;%定义频率序列
subplot(2,1,2); plot(f1,abs(fftshift(N1))) xlabel('频率'); axis([-500,500,0,1]);
title('抽样不足(fh<2fs )时信号的频域波形');
-0.1
-0.05
00.050.10.15
10203040
50时间
抽样不足时时域波形
-500
-400-300-200-100
0100200300400500
00.5
1
频率
抽样不足(fh<2fs )时信号的频域波形
(4)因为在MATLAB 的库函数中没有傅里叶变换函数,而在分析抽样定理时需要观察频域的抽样波形,需要用到傅里叶变换,故编写了子函数fftseq (),实现其频域变换,供上述程序调用其代码如下:
function [M,m,df]=fftseq(m,ts,df) % [M,m,df]=fftseq(m,ts,df) fs=1/ts; if nargin == 2 n1=0; else
n1=fs/df; end
n2=length(m);
n=2^(max(nextpow2(n1),nextpow2(n2))); M=fft(m,n);
m=[m,zeros(1,n-n2)]; df=fs/n;
end
结论
通过MATLAB的编程实现对连续信号进行抽样的仿真实验,进一步加深了对我们队抽样定理的理解。

首先通过以上仿真的波形图,我们可以很直观的看到,原始信号的频率约为64HZ,当抽样频率为原始信号频率的2倍及其以上(实验采用的是200HZ和400HZ)时,在抽样信号的频域图上,可以看出信号的频谱的相邻的周期内的波形不会发生混叠现象(即抽样只是实现了信号频谱在频域内周期的复制和搬移而已),通过一个合适的低通滤波器,就可以得到和原频谱一样的的波形,从而能够无失真的重建原始信号。

而当抽样频率小于原始信号频谱的2倍时,从仿真的频域波形可以看出相邻频谱之间发生混叠从而与原来信号的频谱波形不一样。

这样的波形通过低通滤波器也不能恢复原来的波形。

从而验证了抽样定理的正确性。

致谢
大学三年学习时光已经接近尾声,在此我想对我的母校,我的父母、亲人们,我的老师和同学们表达我由衷的谢意。

感谢我的家人对我大学三年学习的默默支持;感谢我的母校烟台大学文经学院给了我在大学三年深造的机会,让我能继续学习和提高;感谢烟台大学文经学院的老师和同学们三年来的关心和鼓励。

老师们课堂上的激情洋溢,课堂下的谆谆教诲;同学们在学习中的认真热情,生活上的热心主动,所有这些都让我的三年充满了感动。

这次毕业论文设计我得到老师和同学的帮助,其中我的论文指导老师刘美娟老师对我的关心和支持尤为重要。

每次遇到难题,我最先做的就是向刘老师寻求帮助,而刘老师每次不管忙或闲,总会抽空来找我面谈,然后一起商量解决的办法。

刘老师平日里工作繁多,但我做毕业设计的每个阶段,从选题到查阅资料,论文提纲的确定,中期论文的修改,后期论文格式调整等各个环节中都给予了我悉心的指导。

这几个月以来,刘老师不仅在学业上给我以精心指导,同时还在思想给我以无微不至的关怀,在此谨向刘老师致以诚挚的谢意和崇高的敬意。

同时,本篇毕业论文的写作也得到了同学的热情帮助。

感谢在整个毕业设计期间和我密切合作的同学,和曾经在各个方面给予过我帮助的伙伴们,在此,我再一次真诚地向帮助过我的老师和同学表示感谢!
参考文献
[1] AlnVO,AlanSW.Signals&systems[M].NewJersey:Prentice-HallInt,Inc,1997.
514~522
[2] 楼顺天.基于MATLAB的系统分析与设计——信号处理[M].西安:西安电子科技大
学出版社,1999.136~147
[3] 邹理和.数字信号处理[M].北京:国防工业出版社,1988.39~41滞后,这就是离散系
统最常用零阶保持器的主要原因之一。

[4] 苏金明,阮沈勇.MA TLAB6.1实用指南1M2.北京:电子工业出版社,2002.
[5] 姚东.MATLAB命令大全1M2.北京:人民邮电出版社,2000.
[6] 郑阿奇主编,曹弋,赵阳编著.MATB实用教程1M2.北京:电子工业出版社,2004.
[7]《现代通信原理与技术》第二版,张辉曹丽娜主编。

[8] 《MATLAB 电子仿真与应用教程》第二版,王华李友军刘建存主编。

[9]《MATLAB 7.0/Simulink 6.0 应用实例仿真与高效算法开发》黄永安李文成高
小科主编。

附录A 主程序清单
function w(action)
if nargin<1,
action='initialize';
end;
if strcmp(action,'initialize'),
oldFigNumber=watchon;
figNumber=figure( ...
'Name','抽样定理及其恢复演示实验'
'NumberTitle','off', ...
'Visible','off', ...
'DoubleBuffer','on', ...
'BackingStore','off', ...
'Colormap',[]);
axes( ...
'Units','normalized', ...
'Position',[0.05 0.40 0.75 0.90], ...
'Visible','off', ...
'NextPlot','add');
text(0,0)'奈奎斯特抽样定理'
'HorizontalAlignment','center',...
'FontWeight','bold',...
'FontSize',10,...
'Color',[0,0,1]);
axis([-1 1 -1 1]);
axes( ...
'Units','normalized', ...
'Position',[0.05 0.30 0.75 0.90], ...
'Visible','off', ...
'NextPlot','add');
text(0,0,'要想抽样后能够不失真地还原出原信号' 'HorizontalAlignment','center',...
'FontWeight','bold',...
'FontSize',10,...
'Color',[0,0,1]);
axis([-1 1 -1 1]);
axes( ...
'Units','normalized', ...
'Position',[0.05 0.20 0.75 0.90], ...
'Visible','off', ...
'NextPlot','add');
text(0,0,'抽样频率必须大于两倍信号谱的最高频率。

',...
'HorizontalAlignment','center',...
'FontWeight','bold',...
'FontSize',10,...
'Color',[0,0,1]);
axis([-1 1 -1 1]);
%===================================
% 建立信息窗口
top=0.30;
left=0.40;
right=0.70;
bottom=0.05;
labelHt=0.03;
spacing=0.005;
% 首先建立信息窗的框架
frmBorder=0.02;
frmPos=[left-frmBorder bottom-frmBorder ...
(right-left)+2*frmBorder (top-bottom)+2*frmBorder]; uicontrol( ...
'Style','frame', ...
'Units','normalized', ...
'Position',frmPos, ...
'BackgroundColor',[0.50 0.50 0.50]);
% 然后建立文本标签
labelPos=[left top-labelHt (right-left) labelHt];
uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'BackgroundColor',[0.50 0.50 0.50], ...
'ForegroundColor',[1 1 1], ...
'String','信息窗');
% 然后建立可编文本区域
mcwPos=[left bottom (right-left) top-bottom-labelHt-spacing]; mcwHndl=uicontrol( ...
'Style','edit', ...
'HorizontalAlignment','left', ...
'Units','normalized', ...
'Max',10, ...
'BackgroundColor',[1 1 1], ...
'Position',mcwPos, ...
'Callback','w(''quickeval'')');
% 存储此句柄以便将来使用
set(gcf,'UserData',mcwHndl);
%====================================
% 关于所有按钮的信息
labelColor=[0.8 0.8 0.8];
top=0.95;
bottom=0.05;
left=0.75;
yInitLabelPos=0.90;
left=0.75;
labelWid=0.21;
labelHt=0.05;
btnWid=0.21;
btnHt=0.05;
% 同一命令下标签和按钮之间的空隙
btnOffset=0.003;
%某一按钮和下一命令标签之间的空隙
spacing=0.05;
%====================================
% 控制台框架
frmBorder=0.02;
yPos=0.05-frmBorder;
frmPos=[left-frmBorder yPos btnWid+2*frmBorder 0.9+2*frmBorder];
h=uicontrol( ...
'Style','frame', ...
'Units','normalized', ...
'Position',frmPos, ...
'BackgroundColor',[0.50 0.50 0.50]);
%====================================
% 模拟信号及采样频率命令按钮
btnNumber=1;
yLabelPos=top-(btnNumber-1)*(btnHt+labelHt+spacing);
labelStr='模拟信号及采样频率';
labelList='|矩形波fs=2000Hz|矩形波fs=1500Hz|矩形波fs=800Hz|正弦波fs=1800Hz|正弦波fs=1200Hz|正弦波fs=600Hz|锯齿波fs=2500Hz|锯齿波fs=2000Hz|锯齿波fs=800Hz';
cmdList=str2mat( ...
'% 按下窗体右端的按钮可以看到抽样定理与恢复演示实验',...
'square1(2000),%模拟信号表达式为y(t)=2*u(t-0.05)-u(t)-u(t-0.0625),最高频率为750赫兹,fs =2000赫兹即大于模拟信号最高频率的2倍时采样序列的频谱不混叠,恢复信号不失真',...
'square1(1500),%模拟信号表达式为y(t)=2*u(t-0.05)-u(t)-u(t-0.0625),最高频率为750赫兹,fs =1500赫兹即等于模拟信号最高频率的2倍时采样序列的频谱不混叠,恢复信号不失真',...
'square1(800),%模拟信号表达式为y(t)=2*u(t-0.05)-u(t)-u(t-0.0625),最高频率为750赫兹,fs =800赫兹即小于模拟信号最高频率的2倍时采样序列的频谱混叠,恢复信号失真', ...
'sine(1800),%模拟信号表达式为
y(t)=200*exp(-50*sqrt(2)*pi*t)*sin(-50*sqrt(2)*pi*t)最高频率为600赫兹,fs=1800赫兹即大于模拟信号最高频率的2倍时采样序列的频谱不混叠,恢复信号不失真',...
'sine(1200),%模拟信号表达式为
y(t)=200*exp(-50*sqrt(2)*pi*t)*sin(-50*sqrt(2)*pi*t)最高频率为600赫兹,fs=1200赫兹即等于模拟信号最高频率的2倍时采样序列的频谱不混叠,恢复信号不失真',...
'sine(600),%模拟信号表达式为
y(t)=200*exp(-50*sqrt(2)*pi*t)*sin(-50*sqrt(2)*pi*t)最高频率为600赫兹,fs=600赫兹即小于模拟信号最高频率的2倍时采样序列的频谱混叠,恢复信号失真',...
'sawtooth1(2500),%模拟信号表达式为y(t)=20*(t-0.05)最高频率为1000赫兹,fs=2500赫兹大于模拟信号最高频率的2倍时采样序列的频谱不混叠,恢复信号不失真
'sawtooth1(2000),%模拟信号表达式为y(t)=20*(t-0.05)最高频率为1000赫兹,fs=2000赫兹即等于模拟信号最高频率的2倍时采样序列的频谱不混叠,恢复信号不失真' ,.
'sawtooth1(800),%模拟信号表达式为y(t)=20*(t-0.05)最高频率为1000赫兹,fs=800赫兹即小于模拟信号最高频率的2倍时采样序列的频谱混叠,恢复信号失真');
callbackStr='w eval';
% 标签信息
labelPos=[left yLabelPos-2*labelHt labelWid labelHt];
uicontrol( ...
'Style','text', ...
'Units','normalized', ...
'Position',labelPos, ...
'BackgroundColor',labelColor, ...
'HorizontalAlignment','left', ...
'String',labelStr);
% 选项按钮信息
btnPos=[left yLabelPos-2*labelHt-btnHt-btnOffset btnWid btnHt];
hndl1=uicontrol( ...
'Style','popup', ...
'Units','normalized', ...
'Position',btnPos, ...
'String',labelList, ...
'Callback',callbackStr, ...
'UserData',cmdList);
%====================================
uicontrol( ...
'Style','pushbutton', ...
'Units','normalized', ...
'Position',[left bottom+2*btnHt+spacing btnWid 1.5*btnHt], ...
'String','关于', ...
'Callback','w(''info'')');
% 关闭按钮
uicontrol( ...
'Style','pushbutton', ...
'Units','normalized', ...
'Position',[left bottom btnWid 1.5*btnHt], ...
'String','关闭', ...
'Callback','close(gcf)');
% 显示图形
hndlList=[mcwHndl hndl1 ];
watchoff(oldFigNumber);
set(figNumber,'Visible','on', ...
'UserData',hndlList);
w('eval');
elseif strcmp(action,'info'),
helpwin(mfilename)
elseif strcmp(action,'quickeval'),
% 执行小命令窗内的命令
hndlList=get(gcf,'UserData');
mcwHndl=hndlList(1);
evalmcw(mcwHndl);
elseif strcmp(action,'eval')
hndlList=get(gcf,'UserData');
n=length(hndlList);
mcwHndl=hndlList(1);
evalStr=str2mat('');
for count=2:n,
newStrList=get(hndlList(count),'UserData');
newStrVal=get(hndlList(count),'Value');
newStr=deblank(newStrList(newStrVal,:));
if ~isempty(newStr), evalStr=str2mat(evalStr,newStr); end;
end;
set(mcwHndl,'String',evalStr);
evalmcw(mcwHndl); end; % if strcmp(action, ...
附录B
MATLAB is Matrix Laboratories (Matrix Laboratory) means. In addition to a superior numerical ability, it also provides a professional level of symbols, word processing, visualization and modeling and simulation of real-time control functions.
MATLAB is the basic unit of data matrix, and the mathematical expression of the directive, commonly used in the form of projects are very similar, they use MATLAB to solving problems than with C, FORTRAN languages such as End of the same things much more simple in the new Version also joined the C, FORTRAN, c + +, JA V A support can directly call, the user can also prepare themselves to the utility into MATLAB functions in their own convenience after the call, in addition many of the fans are prepared MATLAB A number of classic, users can directly download can be used, very convenient.
MATLAB is based on the matrix, but because of his openness, and mathwork also absorbed as the advantages of software such as maple, MATLAB become a powerful mathematical software Popular MA TLAB 6.5/7.0 including the hundreds of functions within the main pack 30 and several tool kits (Toolbox). Kits can be divided into functional tool kits and tool kits disciplines. Functional tool kits used to expand the MATLAB The symbols, visual modeling and simulation, word processing and real-time control functions. Disciplinary tool kit is relatively strong professional tool kits and tool kits control, signal processing tool kit, communications tool kits and so are such.
Open so that users MA TLAB widely welcomed. In addition to internal functions, all MATLAB main package of documents and various tool kits are readable may amend the document, the source of users to modify or add your own programming tools for the new structure Package.
The advantages and characteristics of MATLAB
(1) friendly work platform and programming environment
MATLAB from a series of tools. These tools user-friendly MATLAB functions and paper, which is used in tool-graphical user interface. MA TLAB, including desktop and command window, history command window, the editor and debugger, the path for users to browse and search assistance, work space, the paper browser. With the commercialization of MATLAB and the continuing escalation of the software itself, MATLAB user interface is more refined, more close to the standard Windows interface, a more interactive, more simple operation. And a new version of the MATLAB provide a complete on-line enquiries, help system, greatly facilitate the use of the user. Simple programming environment provides a more complete debugging systems, procedures do not have to direct the compiler can run, but also to timely report to the mistakes and errors cause analysis.
(2) easy-to-use programming language
MATLAB an advanced matrix / array language, it contains control sentence, function, data structure, input and output and object-oriented programming features. Users can enter the command window statement simultaneously with the Executive Order, can also good preparation of a large complex application procedures (M) after running together. A new version of the MATLAB language is based on the most popular C + + language is based on the characteristics of grammar and therefore C + + language is very similar, but more simple, more in line with scientific and technical personnel of the mathematical expression syntax. Make it more conducive to non-computer professional use of technology. Such language portability, and can develop highly, which is MATLAB can go to scientific research and engineering fields important reason.
(3) powerful scientific computer data-processing capacity
MATLAB is a calculation method includes a large number of collections. Over 600 works in its possession to the use of math functions, users can facilitate the realization of the various computing capabilities. Function algorithms used in scientific research and engineering are calculated in the latest research results, and before the various optimization and fault-tolerant processing. Under normal circumstances, can be used to replace the underlying programming languages such as C and C + +. In the calculation of the same requirements of the cases, the use of MA TLAB programming workload will be significantly reduced. MATLAB, including the collection of these functions from the simplest to the most basic functions such as the matrix, eigenvector, fast Fourier transform the complex functions. Function to resolve the issue of its operations and generally include the matrix of linear equations to solve differential equations and partial differential equations for the group, the symbolic operation, Fourier transform the statistics and data analysis, works in the optimization problem, Sparse matrix calculation, the various complex computing, trigonometric functions and other elementary mathematics, multi-dimensional array of operations and dynamic simulation modeling.
(4) excellent graphics processing
MATLAB generated since the date on the convenience of the data visualization features to be used matrix and vector graphics shown, and can be carried out to mark graphics and printing. High-level mapping, including 2D and 3D visualization, image processing, animation and graphic expression. Can be used for scientific computing and engineering drawings. A new version of the MATLAB graphics processing functions of the whole made a lot of improvement and perfection, so that he not only in the general data visualization software has the functions (such as two-dimensional curves and three-dimensional surface mapping and processing, etc.) has become more perfect, but For some other software does not function (for example, graphics processing of light, and color processing, such as the performance of four-dimensional data), MA TLAB the excellent performance of the same capacity. At the same time, some special visual requirements, such as graphic dialogue, MA TLAB also have the function of the corresponding function, ensuring the requirements of users at different levels. Another new version of the MATLAB also highlighted in the graphical user interface (GUI) on the production made great improvement, in this respect there are special requirements of the users can be met.
(5) a wide range of application modules collection Toolbox
MATLAB for many specialized fields have developed a powerful set of modules and kits. In general, they are given by the experts in the fields of development, users can directly use the toolbox study, application and evaluation of different ways without the need to prepare their own code. At present, MATLAB toolbox to have extended to the scientific research and engineering applications in many fields, such as data collection, database interface, probability and statistics, the kind of fitting, Optimization, partial differential equations to solve, neural network, wavelet analysis, signal processing , Image processing, system identification, control system design, LMI control, robust control, the model forecasts, fuzzy logic, financial analysis, maps, tools, nonlinear control design, rapid prototyping and semi-real-time physical simulation, embedded systems development, sentinel Simulation, DSP and communications, electric power system simulation, all in the toolbox (Toolbox) family has its own place.
(6) for the program interface and publishing platform
A new version of the MATLA
B can use MATLAB Compiler and
C / C + + Math Library and graphics library, their MATLAB automatically converted to run independent of the MATLAB C and C +。

相关文档
最新文档