课程名称:姓 名:院 系:专 业:学 号:指导教师:
本科实验报告
信号与系统实验
周绮敏、史笑兴、李惠忠
年 月 日
实验时间: 周 第 节课 签到表编号:
专业: 姓名: 学号:
实验报告
日期:5.3—5.24 地点:东四420室
课程名称: 信号与系统实验 指导老师: 史笑兴、周绮敏、李惠忠 成绩: 实验名称: 实验一 MATLAB基本实验 实验类型: 设计型 一、实验目的与要求
1、掌握Matlab的基本使用方法:操作界面、基本语法、基本函数等; 2、掌握Matlab在“信号与系统”课程中的应用: (1)信号的产生与表示;
(2)产生基本信号的Matlab函数; (3)卷积和的计算与表示;
(4)离散时间信号的傅立叶变换的计算与表示,部分傅立叶变换的性质验证。
二、实验内容和原理
1、P168,实验一,习题 1、2、3、4、5、7 2、P169,实验二,习题 1、1的补充题、2、3 3、P170,实验三,习题 1、2、3
三、主要仪器设备
带有matlab的电脑一台
四、操作方法和实验步骤
4.1 新建文本文档并命名,在文本文档中写matlab代码,另存为.m的文件,此时注意名称开头不应为数字,标题中不应出现matlab自带函数的名称; 4.2打开matlab程序,运行已保存好的.m文件,根据提示的错误信息修改代码直至无错误为止,运行代码,记录运行结果。
五、实验数据记录和处理 实验1.1 代码:
clear;clf;clc; %Impulse sequence subplot(2,2,1); n=[-10:10]; z=(n==0); stem(n,z);
axis([-10,10,-1,2]); title('Impulse sequence'); xlabel('n');ylabel('delta[n]');
%Impulse function subplot(2,2,2); t=-10:0.1:10;
y=(t==0); plot(t,y,'r'); axis([-10,10,-1,2]); title('Impulse function'); xlabel('t');ylabel('\\delta(t)');
%Step Sequence subplot(2,2,3); n=[-10:10]; z=(n>=0); stem(n,z);
axis([-10,10,-1,2]); title('Step sequence'); xlabel('n');ylabel('u[n]');
%Step function subplot(2,2,4); t=-10:0.1:10; y=(t>=0); plot(t,y,'b'); axis([-10,10,-1,2]); title('Step function'); xlabel('t');ylabel('u(t)');
结果:
实验1.2 代码:
%sine wave subplot(2,2,1);
t=-2*pi:pi/20:2*pi; plot(t,sin(t));
axis([-2*pi,2*pi,-1.5,1.5]); title('Sine wave');
xlabel('t');ylabel('sin(t)');
%Triangular wave subplot(2,2,2); t=-5*pi:pi/100:5*pi; x=sawtooth(t,0.5); plot(t,x);
axis([-5*pi,5*pi,-1.5,1.5]); title('Triangular wave'); xlabel('t');ylabel('x');
%Sawtooth wave subplot(2,2,3); t=-5*pi:pi/100:5*pi; z=sawtooth(t,0); plot(t,z);
axis([-5*pi,5*pi,-1.5,1.5]); title('Sawtooth wave t=0'); xlabel('t');ylabel('z');
subplot(2,2,4); t=-5*pi:pi/100:5*pi; z=sawtooth(t,1); plot(t,z);
axis([-5*pi,5*pi,-1.5,1.5]); title('Sawtooth wave t=1'); xlabel('t');ylabel('z');
结果:
实验1.3 代码:
clear;clf;clc; %Sinc function t=-4*pi:pi/20:4*pi; subplot(2,1,1); plot(t,sinc(t));
axis([-4*pi,4*pi,-0.5,1.5]); title('Sinc function'); grid on;
xlabel('t');ylabel('sinc(t)');
%Sample function subplot(2,1,2); plot(t,sinc(t/pi));
axis([-4*pi,4*pi,-0.5,1.5]); title('Sample function'); grid on;
xlabel('t');ylabel('sa(t)');
结果:
实验1.4 代码:
u1=stepseq(0,-5,20);u3=stepseq(5,-5,20); x=u1-u3; n=[-5:20]; h=delta(n-5);
subplot(3,1,1);stem(n,x);axis([-5,20,0,1.2]);title('x[n]'); xlabel('n');ylabel('x[n]');
subplot(3,1,2);stem(n,h);axis([-5,20,0,1.2]);title('h[n]');