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

发布时间 : 星期六 文章信号与系统实验教程(只有答案)更新完毕开始阅读

信号x(t)的波形图 信号y(t) = x(1.5t+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)的函数文件xx.m

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 = 0.01;

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,

convolution of x(t) and xlabel('Time t sec')信号(t)*h(t)的波形图

title('The h(t)')

x (t)、h(t)和x

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

x[n] = 0.5n{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 = (0.5).^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]的波形图

Q1-11已知一个序列为

x[n]???n,?0,0?n?4otherwise

编写MATLAB程序Q1_11,能够将x[n]以N = 8为周期进行周期延拓得到一个周期为N =8的周期序列y[n],并分别绘制x[n]和y[n]图形。

编写的程序Q1_11如下:

U4.m

function y=u4(n) y=n.*(u(n)-u(n-5));

Q1——11.m clear, close all; n =-16:32 x=u4(n); T = 8; y = 0; for k = -2:4;

y =y+u4(n-k*T); end

subplot(211) stem(n,x,'.'); grid on,

title ('Original signal x(n)') xlabel('Time t sec') subplot(212) stem(n,y);

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

grid on,信号x[n]的波形图 信号y[n]的波形图

联系合同范文客服:xxxxx#qq.com(#替换为@)