版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Project 2.3Linear and Nonlinear Systems线性和非线性系统:假定系统为:(2.1)用程序仿真该系统,输入三个不同的输入序列,和计算并求出相应的输出相应,A copy of Program P2_3 is given below: Insert program code here. Copy from m-file(s) and paste. % Generate the input sequencesclf;n = 0:40;a = 2;b = -3;x1 = cos(2*pi*0.1*n);x2 = cos(2*pi*0.4*n);x = a*x1 + b
2、*x2;num = 2.2403 2.4908 2.2403;den = 1 -0.4 0.75;ic = 0 0; % Set zero initial conditionsy1 = filter(num,den,x1,ic); % Compute the output y1ny2 = filter(num,den,x2,ic); % Compute the output y2ny = filter(num,den,x,ic); % Compute the output ynyt = a*y1 + b*y2; d = y - yt; % Compute the difference outp
3、ut dn% Plot the outputs and the difference signalsubplot(3,1,1)stem(n,y);ylabel(Amplitude);title(Output Due to Weighted Input: a cdot x_1n + b cdot x_2n);subplot(3,1,2)stem(n,yt);ylabel(Amplitude);title(Weighted Output: a cdot y_1n + b cdot y_2n);subplot(3,1,3)stem(n,d);xlabel(Time index n);ylabel(A
4、mplitude);title(Difference Signal);Y = filter(B,A,X) ,输入X为滤波前序列,Y为滤波结果序列,B/A 提供滤波器系数,B为分子, A为分母Answers:Q2.7The outputs yn, obtained with weighted input, and ytn, obtained by combining the two outputs y1n and y2n with the same weights, are shown below along with the difference between the two signals
5、:运行程序P2_3.m,将由加权输入得到的与进行比较,是在相同权系数下输出和相加得到的。这两个序列和他们的差异显示如下: 两个序列是否相等? 答:相等该系统是否是线性系统? 答:是线性系统Q2.8 Program P2_3 was run for the following three different sets of values of the weighting constants, a and b, and the following three different sets of input frequencies:用一组不同的权系数a和b的值以及一组不同的输入频率重做习题Q2.7,
6、将结果显示如下: The plots generated for each of the above three cases are shown below:将a和b及x1、x2分别改为a = 5;b = -10;x1 = cos(2*pi*0.2*n);x2 = cos(2*pi*0.8*n);Based on these plots we can conclude that the system with different weights is 线性的Q2.9 Program 2_3 was run with the following non-zero initial conditio
7、ns 用下面的初始条件:ic = 0 1;The plots generated are shown below 结果显示:Based on these plots we can conclude that the system with nonzero initial conditions is 在这个基础上我们知道,当初始条件不是零的时候系统是线性系统吗? 答:不是线性系统Q2.11 Program P2_3 was modified to simulate the system:假定一个系统为:yn = xnxn1The output sequences y1n, y2n,and yno
8、f the above system generated by running the modified program are shown below: 修改程序P2_3.m,计算这个系统的输出序列y1n, y2n,and yn。比较yn with ytn是否相等,结果显示如下:Comparing yn with ytn we conclude that the two sequences are 都不是线性系统 This system is 这个系统是线性系统吗? 答:不是Project 2.4 Time-invariant and Time-varying Systems时不变和时变系统
9、用程序P2_4.m仿真(2.1)式中给出的系统,以产生两个不同的输入序列,计算并画出相应的输出序列。A copy of Program P2_4 is given below: % Generate the input sequencesclf;n = 0:40; D = 10;a = 3.0;b = -2;x = a*cos(2*pi*0.1*n) + b*cos(2*pi*0.4*n);xd = zeros(1,D) x;num = 2.2403 2.4908 2.2403;den = 1 -0.4 0.75;ic = 0 0; % Set initial conditions% Comp
10、ute the output yny = filter(num,den,x,ic);% Compute the output ydnyd = filter(num,den,xd,ic);% Compute the difference output dnd = y - yd(1+D:41+D);% Plot the outputssubplot(3,1,1)stem(n,y);ylabel(Amplitude); title(Output yn); grid;subplot(3,1,2)stem(n,yd(1:41);ylabel(Amplitude);title(Output due to
11、Delayed Input xn ?, num2str(D),); grid;subplot(3,1,3)stem(n,d);xlabel(Time index n); ylabel(Amplitude);title(Difference Signal); grid;Answers:Q2.12 The output sequences yn and ydn-10 generated by running Program P2_4 are shown below 运行程序P2_4.m并比较yn and ydn-10,这两个序列有什么关系?该系统是时不变系统吗?These two sequence
12、s are related as follows - ydn-10 是由yn 向右平移10个单位得到的The system is 线性时不变系统Q2.13 The output sequences yn and ydn-D generated by running Program P2_4 for the following values of the delay variable D 用一个不同的延时变量D,重做习题Q2.12,结果显示如下:are shown below 将D改为20 In each case, these two sequences are related as foll
13、ows 由 yn 向右平移20个单位得到The system is 线性时不变系统Q2.14 The output sequences yn and ydn-10 generated by running Program P2_4 for the following values of the input frequencies -用一个不同的输入,重做习题Q2.12,结果显示如下:are shown below - In each case, these two sequences are related as follows - ydn-10是由yn向右平移10个单位得到的The syst
14、em is -线性时不变系统Q2.15 The output sequences yn and ydn-10 generated by running Program P2_4 for non-zero initial conditions are shown below 在非零的初始条件下ic = 0 1;重做习题Q2.12,结果显示如下:该系统是时不变吗?These two sequences are related as follows - ydn-10是由yn向右平移10个单位得到的The system is 不是时不变系统2.2LINEAR TIME-INVARIANT DISCRE
15、TE-TIME SYSTEMSProject 2.5Computation of Impulse Responses of LTI Systems线性时不变系统的冲激相应函数A copy of Program P2_5 is shown below:程序P2_5% Compute the impulse response yclf;N = 40;num = 2.2403 2.4908 2.2403;den = 1 -0.4 0.75;y = impz(num,den,N);% Plot the impulse responsestem(y);xlabel(Time index n); ylab
16、el(Amplitude);title(Impulse Response); grid;Answers:Q2.19 The first 41 samples of the impulse response of the discrete-time system of Project 2.3 generated by running Program P2_5 is given below:运行程序,生成式(2.1)所给出的离散时间系统的冲激相应:Q2.20 The required modifications to Program P2_5 to generate the impulse res
17、ponse of the following causal LTI system:yn + 0.71yn-1 0.46yn-2 0.62yn-3 = 0.9xn 0.45xn-1 + 0.35xn-2 + 0.002xn-3 are given below:修改程序,产生如下因果线性时不变系统的冲激相应的前45个样本:yn + 0.71yn-1 0.46yn-2 0.62yn-3= 0.9xn 0.45xn-1 + 0.35xn-2 + 0.002xn-3(2.2)程序是: % Compute the impulse response yclf;N = 45;num = 0.9 -0.45 0
18、.35 0.002;den = 1 0.71 -0.46 -0.62;y = impz(num,den,N);% Plot the impulse responsestem(y);xlabel(Time index n); ylabel(Amplitude);title(Impulse Response); grid;The first 45 samples of the impulse response of this discrete-time system generated by running the modified is given below:结果是:Q2.21 The MAT
19、LAB program to generate the impulse response of a causal LTI system of Q2.20 using the filter command is indicated below:利用filter命令编写一个程序,生成(2.2)给出的因果线性时不变系统的冲激相应,计算并画出40个样本,把你的结果和Q2.20中得到的结果相比较。 clf;n=0:39;num=0.9 -0.45 0.35 0.002;den=1 0.71 -0.46 -0.62;x=1 zeros(1,39);y=filter(num,den,x);stem(y);x
20、label(Time index n); ylabel(Amplitude);title(Impulse Response); grid;The first 40 samples of the impulse response generated by this program are shown below:Comparing the above response with that obtained in Question Q2.20 we conclude - 两个冲击响应是相同的Project 2.7Convolution卷积:可通过命令conv实现A copy of Program
21、P2_7 is reproduced below: clf;h = 3 2 1 -2 1 0 -4 0 3; % impulse responsex = 1 -2 3 -4 3 2 1; % input sequencey = conv(h,x);n = 0:14;subplot(2,1,1);stem(n,y);xlabel(Time index n); ylabel(Amplitude);title(Output Obtained by Convolution); grid;x1 = x zeros(1,8);y1 = filter(h,1,x1);subplot(2,1,2);stem(
22、n,y1);xlabel(Time index n); ylabel(Amplitude);title(Output Generated by Filtering); grid;Answers:Q2.28 The sequences yn and y1n generated by running Program P2_7 are shown below:运行结果:The difference between yn and y1n is - 区别:yn用卷积函数conv来计算卷积,而y1n是用滤波器函数filter(p,d,x)实现差分方程的仿真来计算卷积的,它们的结果相同The reason
23、for using x1n as the input, obtained by zero-padding xn, for generating y1n is 为什么要使用xn补零后得到的x1n作为输入来产生y1n?答:filter函数y(n)是从n=0开始,认为所有n0都为0;而conv是从卷积公式计算,包括n0部分。输出的结果个数等于x的长度与h的长度之和减去1,因此filter 和conv 的结果长短不同,要想使y1n的长度与yn相同,必须要补length(h)-1个零Q2.29 The modified Program P2_7 to develop the convolution of
24、 a length-5 sequence hn with a length-6 sequence xnis indicated below:修改程序P2_7,计算长度为5的序列hn和长度为10的序列xn的卷积,重做问题Q2.28,样本值自己定: clf;h = 3 2 1 -2 1 ; % impulse responsex = 1 -2 3 -4 3 2 1 0 -4 0; % input sequencey = conv(h,x);n = 0:13;subplot(2,1,1);stem(n,y);xlabel(Time index n); ylabel(Amplitude);title(
25、Output Obtained by Convolution); grid;x1 = x zeros(1,4);y1 = filter(h,1,x1);subplot(2,1,2);stem(n,y1);xlabel(Time index n); ylabel(Amplitude);title(Output Generated by Filtering); grid;The sequences yn and y1n generated by running modified Program P2_7 are shown below:The difference between yn and y
26、1n is - yn用卷积函数conv来计算卷积,而y1n是用滤波器函数filter(p,d,x)实现差分方程的仿真来计算卷积的,它们的结果相同 5.1THE SAMPLING PROCESS IN THE TIME-DOMAIN时域上信号采样Project 5.1Sampling of a Sinusoidal SignalA copy of Program P5_1 is given below: clf;t = 0:0.0005:1;f = 13;xa = cos(2*pi*f*t);subplot(2,1,1)plot(t,xa);gridxlabel(Time, msec);ylab
27、el(Amplitude);title(Continuous-time signal x_a(t);axis(0 1 -1.2 1.2)subplot(2,1,2);T = 0.1;n = 0:T:1;xs = cos(2*pi*f*n);k = 0:length(n)-1;stem(k,xs);grid;xlabel(Time index n);ylabel(Amplitude);title(Discrete-time signal xn);axis(0 (length(n)-1) -1.2 1.2)Answers:Q5.1The plots of the continuous-time s
28、ignal and its sampled version generated by running Program P5_1 are shown below:产生连续信号及其抽样形式,并显示它们:Q5.2The frequency of the sinusoidal signal in Hz is 13HzThe sampling period in seconds is - 0.1Q5.3The effects of the two axis commands are 设定坐标轴的范围Q5.4The plots of the continuous-time signal and its s
29、ampled version generated by running Program P5_1 for the following four values of the sampling period are shown below:Based on these results we make the following observations - 抽样频率越高得到的离散信号越多Q5.5The plots of the continuous-time sinusoidal signal of frequency 3 Hz and its sampled version generated
30、by running a modified Program P5_1 are shown below: The plots of the continuous-time sinusoidal signal of frequency 7 Hz and its sampled version generated by running a modified Program P5_1 are shown below: Based on these results we make the following observations - 连续函数的频率的改变不影响抽样的值Project 5.2Alias
31、ing Effect in the Time-Domain时域中的混叠效果A copy of Program P5_2 is given below: clf;T = 0.1;f = 13;n = (0:T:1);xs = cos(2*pi*f*n);t = linspace(0.5,1.5,500);ya = sinc(1/T)*t(:,ones(size(n) - (1/T)*n(:,ones(size(t)*xs;plot(n,xs,o,t,ya);grid;xlabel(Time, msec);ylabel(Amplitude);title(Reconstructed continuous-time signal y_a(t);axis(0 1 -1.2 1.2);Answers:Q5.6The plots of the discrete-time signal and its continuous-time equivalent obtained by running Program P5_2 are shown below:Q5.7The ran
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年5个测试题答案大全及答案
- 2026年23年烟台语文中考试卷及答案
- 2026年6年级试卷测试题答案
- 2026年6s培训考试试题答案
- 2026年7年级月考题库及答案
- 2026葫芦岛市中考地理考前冲刺卷含答案
- 2026张家口市中考地理知识点背诵清单练习含答案
- 2026厦门中考地理考前一周加分卷含答案
- 2026黑龙江中考生物考前3天预测卷含答案
- 2026宿迁市中考语文查缺补漏专练含答案
- 招标代理机构选取服务方案投标文件(技术方案)
- 2024年广东省第二次普通高中学业水平合格性考试历史试题含答案
- 财务国企面试题及答案
- 豆包AI课件教学课件
- 酒店疫情期间客房消毒规范
- 控烟毕业论文
- 内科护理学副高答辩题库及答案
- 红色文化知识竞赛试题及答案
- DB42∕T 1046-2021 住宅厨房、卫生间集中排气系统技术规程
- 教育培训机构招生课件
- 装配式综合支吊架施工方案
评论
0/150
提交评论