数字信号处理实验报告材料2.doc
《数字信号处理实验报告材料2.doc》由会员分享,可在线阅读,更多相关《数字信号处理实验报告材料2.doc(16页珍藏版)》请在课桌文档上搜索。
1、wordName:Section:Laboratory Exercise 2DISCRETE-TIME SYSTEMS: TIME-DOMAIN REPRESENTATIONSIMULATION OF DISCRETE-TIME SYSTEMSTheMoving Average System A 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(2*pi*0.
2、05*n); % A low-frequency sinusoids2 = cos(2*pi*0.47*n); % A high frequency sinusoidx = s1+s2;% Implementation of the moving average filterM = input(Desired length of the filter = );num = ones(1,M);y = filter(num,1,x)/M;% Display the input and output signalsclf;subplot(2,2,1);plot(n, s1);axis(0, 100,
3、 -2, 2);xlabel(Time index n); ylabel(Amplitude);title(Signal #1);subplot(2,2,2);plot(n, s2);axis(0, 100, -2, 2);xlabel(Time index n); ylabel(Amplitude);title(Signal #2);subplot(2,2,3);plot(n, x);axis(0, 100, -2, 2);xlabel(Time index n); ylabel(Amplitude);title(Input Signal);subplot(2,2,4);plot(n, y)
4、;axis(0, 100, -2, 2);xlabel(Time index n); ylabel(Amplitude);title(Output Signal); axis;Answers:Q2.1 The output sequence generated by running the above program for M = 2 withxn = s1n+s2nas the input is shown below. The ponent of the input xn suppressed by the discrete-time system simulated by this p
5、rogram is s2 Program P2_1 is modified to simulate the LTI system yn = 0.5(xnxn1) and process the input xn = s1n+s2n resulting in the output sequence shown below:s3=cos(2*pi*0.05*(n-1);s4= cos(2*pi*0.47*(n-1);z=s3+s4;y = 0.5*(x-z);The effect of changing the LTI system on the input is - (Optional) A S
6、imple 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(2*pi*0.05*n);% pute the output signalx1 = x 0 0; % x1n = xn+1 x2 = 0 x 0; % x2n = xnx3 = 0 0 x; % x3n = xn-1y = x2.*x2-x1.*x3;y = y(2:202);% Plot the inpu
7、t and output signalssubplot(2,1,1)plot(n, x)xlabel(Time index n);ylabel(Amplitude);title(Input Signal)subplot(2,1,2)plot(n,y)xlabel(Time index n);ylabel(Amplitude);title(Output signal);Answers: The sinusoidal signals with the following frequencies as the input signals were used to generate the outpu
8、t 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:Linear and Nonlinear SystemsA copy of Program P
9、2_3 is given below:% Program P2_3% 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*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); % pute the output y1ny2 = filter(num,den,
10、x2,ic); % pute the output y2ny = filter(num,den,x,ic); % pute the output ynyt = a*y1 + b*y2; d = y - yt; % pute the difference output 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)s
11、tem(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(Amplitude);title(Difference Signal);Answers:The outputs yn, obtained with weighted input, and ytn, obtained by bining the two outputs y1n and y2n with the same weights, a
12、re shown below along with the difference between the two signals:The two sequences are same ;we can regard 10(-15) as 0 The system is a liner system Program 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
13、that the system with nonzero initial conditions is as same as the zero initial condition with the time goneTime-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(2*pi*0.1*n) + b*cos(2*pi*0
14、.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% pute the output yny = filter(num,den,x,ic);% pute the output ydnyd = filter(num,den,xd,ic);% pute the difference output dnd = y - yd(1+D:41+D);% Plot the outputssubplot(3,1,1)stem(n,y);ylabel(Amp
15、litude); title(Output yn); grid;subplot(3,1,2)stem(n,yd(1:41);ylabel(Amplitude);title(Output due to Delayed Input xn ?, num2str(D),); grid;subplot(3,1,3)stem(n,d);xlabel(Time index n); ylabel(Amplitude);title(Difference Signal); grid; Answers: The output sequences ynandydn-10 generated by running Pr
16、ogram P2_4 are shown below - These two sequences are related as follows same, the output dont change with the timeThe system is -Time invariant system The output sequences ynandydn-10 generated by running Program P2_4 for non-zero initial conditions are shown below - ic = 5 2;These two sequences are
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 数字信号 处理 实验 报告 材料
链接地址:https://www.desk33.com/p-7544.html