好文档 - 专业文书写作范文服务资料分享网站

信号与系统实验教程只有答案

天下 分享 时间: 加入收藏 我要投稿 点赞

信 号 与 系 统

实 验 教 程(只有答案)

(实验报告)

这么玩!

目录

实验一 信号与系统的时域分析

三、实验内容及步骤

实验前,必须首先阅读本实验原理,读懂所给出的全部范例程序。实验开始时,先在计算机上运行这些范例程序,观察所得到的信号的波形图。并结合范例程序应该完成的工作,进一步分析程序中各个语句的作用,从而真正理解这些程序。

实验前,一定要针对下面的实验项目做好相应的实验准备工作,包括事先编写好相应的实验程序等事项。

Q1-1:修改程序Program1_1,将dt改为,再执行该程序,保存图形,看看所得图形的效果如何?

dt = 时的信号波形 dt = 时的信号波形

这两幅图形有什么区别,哪一幅图形看起来与实际信号

形更像?

答:

Q1-2:修改程序Program1_1,并以Q1_2为文件名存盘,

生实指数信号x(t)=。 要求在图形中加上网格线,并使用数axis()控制图形的时间范围在0~2秒之间。然后执行该序,保存所的图形。

产函程

修改Program1_1后得到的程序Q1_2如下: 信号x(t)=的波形图

clear, % Clear all variables close all, % Close all figure windows dt = ; % Specify the step of time variable t = -2:dt:2; % Specify the interval of time x = exp*t); % Generate the signal plot(t,x) grid on;

axis ([0 2 0 1 ]) title('Sinusoidal signal x(t)') xlabel('Time t (sec)')

Q1-3:修改程序Program1_1,并以Q1_3为文件名存

盘,使之能够仿真从键盘上任意输入的一个连续时间信号,并利用该程序仿真信号x(t)=e。

-2t

修改Program1_1后得到的程序Q1_3如下:

信号x(t)=e的波形图 clear, close all, dt = ; t = -2:dt:2;

-2t

x=input('Input x(t):'); plot(t,x) grid on;

axis ([0 2 -1 1 ]) title('Sinusoidal signal x(t)') xlabel('Time t (sec)')

Q1-4:将实验原理中所给的单位冲激信号和单位阶跃信号的函数文件在MATLAB文件编辑器中编写

好,并分别以文件名delta和u存入work文件夹中以便于使用。

抄写函数文件delta如下: 抄写函数文件u如下:

function y = delta(t) % Unit step function dt = ; function y = u(t)

y = (u(t)-u(t-dt))/dt; y = (t>=0); % y = 1 for t > 0, else y = 0

Q1-5:修改程序Program1_4,并以Q1_5为文件名存盘,利用axis()函数,将图形窗口的横坐标

范围改为-2≤n≤5,纵坐标范围改为≤ x ≤。

修改Program1_4后得到的程序Q1_5如下: 信号的波形图

clear, close all, n = -5:5;

x = [zeros(1,4), , , , 0, , zeros(1,2)]; stem (n,x,'.') grid on, axis([-2 5 ]);

title ('A discrete-time sequence x[n]') xlabel ('Time index n')

Q1-6:仿照前面的示例程序的编写方法,编写一个MATLAB程序,以Q1_6为文件名存盘,使之能

够在同一个图形窗口中的两个子图中分别绘制信号x[n]=选择的时间窗能够表现出信号的主要部分(或特征)。

|n|

和x(t)=cos(2πt)[u(t)-u(t-3)]。要求

编写的程序Q1_6如下: 信号x[n]=

clear,close all, t = -1::4;

|n|

的波形图和信号x(t)=cos(2πt)[u(t)-u(t-3)]的波形图

xt = cos(2*pi*t).*(u(t)-u(t-3)); n=-5:5; xn=.^abs(n); subplot(211)

plot(t,xt) grid on,

title ('Original signal x(t)') subplot(212)

stem(n,xn,'.') grid on,

title ('Original signal x(n)') xlabel ('Time t (sec)')

Q1-7:根据示例程序的编程方法,编写一个MATLAB程序,以Q1_7为文件名存盘,由给定信号x(t)

= (t) 求信号y(t) = x+3),并绘制出x(t) 和y(t)的图形。

编写的程序Q1_7如下:

编写产生x(t)的函数文件 function y=x(t) y=exp*t).*u(t); clear,close all, t = -3::4;

xt = x(t); % Generate the original signal x(t) yt=x*t+3); subplot(211)

plot(t,xt) % Plot x(t) grid on,

title ('Original signal x(t)') subplot(212)

plot(t,yt) % Plot x(t) grid on,

title ('Original signal y(t)') xlabel ('Time t (sec)')

信号x(t)的波形图 信号y(t) = x+3) 的波形图

Q1-8:给定一个离散时间信号x[n] = u[n] – u[n-8],仿照示例程序Program1_5,编写程序Q1_8,

产生x[n]的左移序列x1[n] = x[n+6]和右移序列x2[n] = x[n-6],并在同一个图形窗口的三个子图中分别绘制这三个序列的图形。

编写的程序Q1_8如下:

编写产生x(t)的函数文件 function y=xx(n) y=u(n)-u(n-8); clear,close all, n = -10:15;

x =xx(n); % Generate the original signal x(n)

x1 = xx(n+6); % Shift x(t) to the left by 2 second to get x1(n+6) x2 =xx(n-6); % Shift x(t) to the right by 2 second to get x2(n-6) subplot(311)

stem(n,x,'.') % Plot x(t) grid on,

title ('Original signal x(n)') subplot (312)

stem (n,x1,'.') % Plot x1(t) grid on,

title ('Left shifted version of x(n)') subplot (313)

stem (n,x2,'.') % Plot x2(t) grid on,

title ('Right shifted version of x(n)') xlabel ('Time t (sec)')

信号波形图

Q1-9:编写程序Q1_9,使之能够接受以键盘方式输入的定义在不同时间段的两个不同连续时间信

号并完成卷积运算,分别绘制这两个信号及其卷积的结果的图形,图形按照2?2分割成四个子图。

编写的程序Q1_9如下:

clear;close all; dt = ;

t0=input('Input first signal t0:');t1=input('Input first first signal t1:'); tx = t0:dt:t1;

x = input('Input first signal variable(tx) :');

t2=input('Input second signal t0:');t3=input('Input second signal t1:'); th=t2:dt:t3;

h = input('Input second signal variable(th) :')

y = dt*conv(x,h); % Compute the convolution of x(t) and h(t) subplot(221)

plot(tx,x), grid on, title('Signal x(t)') xlabel('Time t sec') subplot(222)

plot(th,h), grid on, title('Signal h(t)') xlabel('Time t sec') subplot(313)

plot(y), grid on, title('The convolution of x(t) and h(t)')

xlabel('Time t sec')信号x (t)、h(t)和x (t)*h(t)的波形图

Q1-10:给定两个离散时间序列

x[n] = {u[n]-u[n-8]} h[n] = u[n]-u[n-8]

编写程序Q1_10,计算它们的卷积,并分别绘制x[n]、h[n]和它们的卷积y[n]的图形。

编写的程序Q1_10如下:

n=0:10;

x = .^n.*(u(n)-u(n-8)); h = u(n)-u(n-8);

y =conv(x,h); % Compute the convolution of x(t) and h(t) subplot(221)

stem(n,x,'.'), grid on, title('Signal x(n)') subplot(222)

stem(n,h,'.'), grid on, title('Signal h(n)') subplot(212)

stem(y), grid on, title('The convolution of x(n) and h(n)'), xlabel('Time t sec');

信号x[n]、h[n]和y[n]的波形图

信号与系统实验教程只有答案

信号与系统实验教程(只有答案)(实验报告)这么玩!目录实验一信号与系统的时域分析三、实验内容及步骤实验前,必须首先阅读本实验原理,读懂
推荐度:
点击下载文档文档为doc格式
08cfq25gpf1emx02sb8q8qp2012imx011fq
领取福利

微信扫码领取福利

微信扫码分享