资源预览内容
第1页 / 共7页
第2页 / 共7页
第3页 / 共7页
第4页 / 共7页
第5页 / 共7页
第6页 / 共7页
第7页 / 共7页
亲,该文档总共7页全部预览完了,如果喜欢就下载吧!
资源描述
.NameName: :SectionSection: :Laboratory Exercise 2Laboratory Exercise 2DISCRETE-TIME SYSTEMS: TIME-DOMAIN REPRESENTATIONDISCRETE-TIME SYSTEMS: TIME-DOMAIN REPRESENTATION2.12.1SIMULATION OF DISCRETE-TIME SYSTEMSSIMULATION OF DISCRETE-TIME SYSTEMSProject 2.1TheMoving Average SystemProject 2.1TheMoving Average SystemA copy of Program P2_1 is given below:% Program P2_1% Simulation of an M-point Moving Average Filter% Generate the input signaln = 0:100;s1 = cos; % A low-frequency sinusoids2 = cos; % A high frequency sinusoidx = s1+s2;% Implementation of the moving average filterM = input;num = ones;y = filter/M;% Display the input and output signalsclf;subplot;plot;axis;xlabel; ylabel;title;subplot;plot;axis;xlabel; ylabel;title;subplot;plot;axis;xlabel; ylabel;title;subplot;plot;axis;xlabel; ylabel;title;axis;Answers:Answers:1 / 7.The output sequence generated by running the above program for M = 2 withxn =s1n+s2nas the input is shown below.The component of the inputxn suppressed by the discrete-time system simulated by thisprogram iss2Q2.2Q2.2Program P2_1 is modified to simulate the LTI systemyn = 0.5 andprocess the inputxn = s1n+s2n resulting in the output sequence shown below:s3=cos2*pi*0.05*;s4= cos2*pi*0.47*;z=s3+s4;y = 0.5*;Q2.1Q2.1The effect of changing the LTI system on the input is -Project 2.2Project 2.2 A Simple Nonlinear Discrete-Time System A Simple Nonlinear Discrete-Time SystemA copy of Program P2_2 is given below:% Program P2_2% Generate a sinusoidal input signalclf;n = 0:200;x = cos;% Compute the output signalx1 = x 0 0;% x1n = xn+1x2 = 0 x 0;% x2n = xnx3 = 0 0 x;% x3n = xn-1y = x2.*x2-x1.*x3;y = y;% Plot the input and output signalssubplotplotxlabel;ylabel;titlesubplotplotxlabel;ylabel;title;Answers:Answers:Q2.5Q2.5The sinusoidal signals with the following frequencies as the input signals were used to generatethe output signals:The output signals generated for each of the above input signals are displayed below:The output signals depend on the frequencies of the input signal according to the following rules:This observation can be explained mathematically as follows:Project 2.3Project 2.3Linear and Nonlinear SystemsLinear and Nonlinear SystemsA copy of Program P2_3 is given below:% Program P2_3% Generate the input sequencesclf;n = 0:40;2 / 7.a = 2;b = -3;x1 = cos;x2 = cos;x = a*x1 + b*x2;num = 2.2403 2.4908 2.2403;den = 1 -0.4 0.75;ic = 0 0; % Set zero initial conditionsy1 = filter; % Compute the output y1ny2 = filter; % Compute the output y2ny = filter; % Compute the output ynyt = a*y1 + b*y2;d = y - yt; % Compute the difference output dn% Plot the outputs and the difference signalsubplotstem;ylabel;title;subplotstem;ylabel;title;subplotstem;xlabel;ylabel;title;Answers:Answers:Q2.7Q2.7The outputsyn, obtained with weighted input, andytn, obtained by combining the twooutputsy1n andy2n with the same weights, are shown below along with the differencebetween the two signals:The two sequences aresame ;we can regard 10 as 0The system isaliner systemQ2.9Q2.9Program 2_3 was run with the following non-zero initial conditions-ic = 2 2;The plots generated are shown below-Based on these plots we can conclude that the system with nonzero initial conditions isas same as thezero initial condition with the time goneProject 2.4Project 2.4Time-invariant and Time-varying SystemsTime-invariant and Time-varying SystemsA copy of Program P2_4 is given below:% Program P2_4% Generate the input sequencesclf;n = 0:40; D = 10;a = 3.0;b = -2;x = a*cos + b*cos;xd = zeros x;num = 2.2403 2.4908 2.2403;den = 1 -0.4 0.75;ic = 0 0; % Set initial conditions% Compute the output yny = filter;% Compute the output ydn3 / 7.yd = filter;% Compute the difference output dnd = y - yd;% Plot the outputssubplotstem;ylabel;title; grid;subplotstemn,yd;ylabel;titleOutput due to Delayed Input xn ?, num2str,; grid;subplotstem;xlabel; ylabel;title; grid;Answers:Answers:Q2.12Q2.12The output sequencesynandydn-10generated by running Program P2_4 are shownbelow -These two sequences are related as followssame, the output dont change with the timeThe system is -Time invariant systemQ2.15Q2.15The output sequencesynandydn-10generated by running Program P2_4 fornon-zero initial conditions are shown below -ic = 5 2;These two sequences are related as followsjust as the sequences aboveThe system isnot related to theinitial conditions2.22.2LINEAR TIME-INVARIANT DISCRETE-TIME SYSTEMSLINEAR TIME-INVARIANT DISCRETE-TIME SYSTEMSProject 2.5Computation of Impulse Responses of LTI SystemsProject 2.5Computation of Impulse Responses of LTI SystemsA copy of Program P2_5 is shown below:% Program P2_5% Compute the impulse response yclf;N = 40;num = 2.2403 2.4908 2.2403;den = 1 -0.4 0.75;y = impz;% Plot the impulse responsestem;xlabel; ylabel;title; grid;Answers:Answers:Q2.19Q2.19The first 41 samples of the impulse response of the discrete-time system of Project 2.3generated by running Program P2_5 is given below:4 / 7.Project 2.6Project 2.6Cascade of LTI SystemsCascade of LTI SystemsA copy of Program P2_6 is given below:% Program P2_6% Cascade Realizationclf;x = 1 zeros; % Generate the inputn = 0:40;% Coefficients of 4th order systemden = 1 1.6 2.28 1.325 0.68;num = 0.06 -0.19 0.27 -0.26 0.12;% Compute the output of 4th order systemy = filter;% Coefficients of the two 2nd order systemsnum1 = 0.3 -0.2 0.4;den1 = 1 0.9 0.8;num2 = 0.2 -0.5 0.3;den2 = 1 0.7 0.85;% Output y1n of the first stage in the cascadey1 = filter;% Output y2n of the second stage in the cascadey2 = filter;% Difference between yn and y2nd = y - y2;% Plot output and difference signalssubplot;stem;ylabel;title; grid;subplot;stemylabel;title; grid;subplot;stemxlabel;ylabel;title; grid;Answers:Answers:Q2.23Q2.23The output sequencesyn, y2n,and the difference signal dngenerated by runningProgram P2_6 are indicated below:The relation betweenynandy2nisyn is theConvolution of y2n and y1nConvolution of y2n and y1nThe 4th order system can do the same job as the cascade systemQ2.24Q2.24The sequences generated by running Program P2_6 with the input changed to asinusoidal sequence are as follows:x = sin;The relation betweenynandy2nin this case issame as the relation aboveProject 2.7Project 2.7ConvolutionConvolutionA copy of Program P2_7 is reproduced below:% Program P2_7clf;h = 3 2 1 -2 1 0 -4 0 3;% impulse responsex = 1 -2 3 -4 3 2 1;% input sequencey = conv;n = 0:14;subplot;stem;xlabel; ylabel;title; grid;5 / 7.x1 = x zeros;y1 = filter;subplot;stem;xlabel; ylabel;title; grid;Answers:Answers:Q2.28Q2.28The sequencesynandy1ngenerated by running Program P2_7 are shown below:The difference betweenynandy1nis - sameThe reason for usingx1n as the input, obtained by zero-paddingxn, for generatingy1nis thelength of x is 7,but the length of theConvolution is 14,and n=14,we need the length ofConvolution is 14,and n=14,we need the length offilter to be 14Project 2.8Project 2.8Stability of LTI SystemsStability of LTI SystemsA copy of Program P2_8 is given below:% Program P2_8% Stability test based on the sum of the absolute% values of the impulse response samplesclf;num = 1 -0.8; den = 1 1.5 0.9;N = 200;h = impz;parsum = 0;for k = 1:N+1; parsum = parsum + absh;if absh 10, break, endend% Plot the impulse responsen = 0:N;stemxlabel; ylabel;% Print the value of abshdisp;dispabsh;Answers:Answers:Q2.32Q2.32The discrete-time system of Program P2_8 is -h,t = impz computes the instantaneous impulse response of the discrete-time filter hdchoosing the number of samples for you, and returns the response in column vector hand a vector of times or sample intervalsin t where . impz returns amatrix h if hd is a vector. Each column of the matrix corresponds to one filter in thevector. When hd is a vector of discrete-time filters, impz returns the matrix h. Eachcolumn of h corresponds to one filter in the vector hd.impz uses FVTool to plot the impulse response of the discrete-time filter hd. If hd is avector of filters, impz plots the response and for each filter in the vector.The impulse response generated by running Program P2_8 is shown below:The value of |h| here is - 1.6761e-0056 / 7.From this value and the shape of the impulse response we can conclude that the system is - ?By running Program P2_8 with a larger value of N the new value of |h| is-9.1752e-007N = 400;From this value we can conclude that the system is- ?Project 2.9Project 2.9Illustration of the Filtering ConceptIllustration of the Filtering ConceptA copy of Program P2_9 is given below:% Program P2_9% Generate the input sequenceclf;n = 0:299;x1 = cos;x2 = cos;x = x1+x2;% Compute the output sequencesnum1 = 0.5 0.27 0.77;y1 = filter; % Output of System #1den2 = 1 -0.53 0.46;num2 = 0.45 0.5 0.45;y2 = filter; % Output of System #2% Plot the output sequencessubplot;plot;axis;ylabel;title; grid;subplot;plot;axis;xlabel; ylabel;title; grid;Answers:Answers:Q2.34Q2.34The output sequences generated by this program are shown below:The filter with better characteristics for the suppression of the high frequency component of the inputsignalxnis system#2DateDate: :SignatureSignature: :7 / 7
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号