數(shù)字信號處理試卷試題及答案
數(shù)字信號處理試卷試題及答案,數(shù)字信號,處理,試卷,試題,答案,謎底
Answer to “Digital Signal Processing”Problem 1 (a). x1(n)={3,7,-2,-1,5,-8}, n1=-2:3 x2(n)={3,7,-2,-1,5,-8}, n2=1:6x3(n)={-8,5,-1,-2,7,3 }, n3=-2:3 [3 points](b) y(n)={14,9,-3,21,-11,-17,-5,-40,0}, n=-2:6 [3 points](c).MATLAB program:clear,close all;n=0:5; x=[3,7,-2,-1,5,-8];[x1,n1]=sigshift(x,n,-2); [x2,n2]=sigshift(x,n,1); [x3,n3]=sigfold(x,n); [x3,n3]=sigshift(x3,n3,3); [y1,yn1]=sigadd(2*x1,n1,x2,n2);[y1,yn1]=sigadd(y1,yn1,-x3,n3); [3 points]stem(yn1,y1);title('sequenceY(n)’) Problem 2 (a) 23456456()()430j jnnjjjjjjXexeee??????????????is periodic in with period 2 . [5 points]()je??(b) Matlab program:clear; close all;n = 0:6; x = [4,3,2,0,2,3,4];w = [0:1:100]*pi/100;X = x*exp(-j*n'*w); magX = abs(X); phaX = angle(X);% Magnitude Response Plotsubplot(2,1,1); plot(w/pi,magX);grid;xlabel('frequency in pi units'); ylabel('|X|');title('Magnitude Response');% Phase response plotsubplot(2,1,2); plot(w/pi,phaX*180/pi);grid;xlabel('frequency in pi units'); ylabel('Degrees');title('Phase Response'); axis([0,1,-180,180]) [5 points](c) Because the given sequence x (n)={4,3,2,0,2,3,4} (n=0,1,2,3,4,5,6) is symmetric about ,the phase response satisfied the condition 132N???()jHe??()jHe???so the phase response is a linear function in . [5 points](d) [5 points]sradfT3001.????(e) The difference of amplitude and magnitude response:Firstly, the amplitude response is a real function, and it may be both positive and negative. The magnitude response is always positive. Secondly, the phase response associated with the magnitude response is a discontinuous function. While the associated with the amplitude is a continuous linear function. [5 points]Problem 3 (a) Pole-zero plot – MATLAB script:b=[1,1,0];a=[1,0.5,-0.24];zplane(b,a)Figure : Pole-zero plot in Problem A2Because all the poles and zero are all in the unit circle,so the system is stable. [5 points](b) Difference equation representation.:;112())/(0.5.4)hzz?????After cross multiplying and inverse transforming; [5 points]()0.5().2()()ynynxn??(c) impulse response sequence h(n) using partial fraction representation:?11()0.18/(.).8/(0.3)hzzz?????[5 points]?)nnnu(d) MATLAB verification:(1) b=[1,1];a=[1,0.5,-0.24];[delta,n]=impseq(0,0,9)x=filter(b,a,delta)(2) n=[0:4];x=(-0.1818.*(-0.8).^n+1.1818.*(0.3).^n).*stepseq(0,0,9) [5 points]Problem 4 (a) figure 4.1 figure 4.2sequence x1(n) sequence x2 (n) The plots of x1(n) and x2(n) is shown in figure 4.1 and figure 4.2 [4 points](b) figure 4.3After calculate, we find circular convolution is equal when N is 7 or 8. [4 points](c)If circular convolution is equal to linear convolution ,the minimum N is m+n-1=7.The plots of circular convolution of x1(n) and x2(n) is shown in figure 4.3. [4 points](d) MATLAB program:clear,close all;n=0:7;m=0:6;l=0:3;x1=[1,-1,1,-1];x2=[3,1,1,3];figure,stem(l,x1),title('sequence x1'),box off;figure,stem(l,x2),title('sequence x2'),box off;%8-point circular convolutionx1_fft8=fft(x1,8);x2_fft8=fft(x2,8);y_fft8=x1_fft8.*x2_fft8;y8=real(ifft(y_fft8));figure,subplot(2,1,1),stem(n,y8),title('8-pointcircular convolution '),axis([0 7 -3 3]),box off;%7-point circular convolutionx1_fft7=fft(x1,7);x2_fft7=fft(x2,7);y_fft7=x1_fft7.*x2_fft7;y7=real(ifft(y_fft7));subplot(2,1,2),stem(m,y7),title('7-point circular convolution '),axis([0 7 -3 3]),box off; [4 points] Problem 5 (a) Block diagrams are shown as under:1z? 1z? 1z? 1z? 1z? 1z?1253521()xn ()yn[4 points][4 points]()xn()yn 1z? 1z? 1z?1z?1z?1z?1 2 5 3(b)The advantage of the linear-phase form:1. For frequency-selective filters, linear-phase structure is generally desirable to have a phase-response that is a linear function of frequency. 2. This structure requires 50% fewer multiplications than the direct form. [2 points] Problem 6 (a) we use Hamming window to design the bandpass filter because it can provide us attenuation exceed 50dB [5 points] (b) MATLAB verification:%% Specifications:ws1 = 0.3*pi; % lower stopband edgewp1 = 0.4*pi; % lower passband edgewp2 = 0.5*pi; % upper passband edgews2 = 0.6*pi; % upper stopband edgeRp = 0.5; % passband rippleAs = 50; % stopband attenuation%tr_width = min((wp1-ws1),(ws2-wp2));M = ceil(6.6*pi/tr_width); M = 2*floor(M/2)+1, % choose odd Mn = 0:M-1;w_ham = (hamming(M))';wc1 = (ws1+wp1)/2; wc2 = (ws2+wp2)/2;hd = ideal_lp(wc2,M)-ideal_lp(wc1,M);h = hd .* w_ham;[db,mag,pha,grd,w] = freqz_m(h,1);delta_w = pi/500;Asd = floor(-max(db([1:floor(ws1/delta_w)+1]))), % Actual AttnRpd = -min(db(ceil(wp1/delta_w)+1:floor(wp2/delta_w)+1)), % Actual passband ripple (5)%%% Filter Response Plotssubplot(2,2,1); stem(n,hd); title('Ideal Impulse Response: Bandpass');axis([-1,M,min(hd)-0.1,max(hd)+0.1]); xlabel('n'); ylabel('hd(n)')set(gca,'XTickMode','manual','XTick',[0;M-1],'fontsize',10)subplot(2,2,2); stem(n,w_ham); title('Hamming Window');axis([-1,M,-0.1,1.1]); xlabel('n'); ylabel('w_ham(n)')set(gca,'XTickMode','manual','XTick',[0;M-1],'fontsize',10)set(gca,'YTickMode','manual','YTick',[0;1],'fontsize',10)subplot(2,2,3); stem(n,h); title('Actual Impulse Response: Bandpass');axis([-1,M,min(hd)-0.1,max(hd)+0.1]); xlabel('n'); ylabel('h(n)')set(gca,'XTickMode','manual','XTick',[0;M-1],'fontsize',10)subplot(2,2,4); plot(w/pi,db); title('Magnitude Response in dB');axis([0,1,-As-30,5]); xlabel('frequency in pi units'); ylabel('Decibels')set(gca,'XTickMode','manual','XTick',[0;0.3;0.4;0.5;0.6;1])set(gca,'XTickLabelMode','manual','XTickLabels',['0';'0.3';'0.4';'0.5';'0.6';'1'],.'fontsize',10)set(gca,'TickMode','manual','YTick',[-50;0])set(gca,'YTickLabelMode','manual','YTickLabels',['-50';'0']);grid [10 points]Problem 7Firstly, we use the given specifications of to design an analog lowpass IIR spsAR,,?filter. Secondly, we change the analog lowpass IIR filter into the analog highpass IIR filte. Thirdly, we change the analog highpass IIR filter into the digital highpass IIR filte. [5 points]Digital Signal Processing of 20051Answer to “Digital Signal Processing of 2005”Problem 1(a) even part: odd part: };5.0,17,,15.0{??eX };5.0,13,5.0{???oX(b) 26943,62,?y(c) MATLAB Programn=-4:2;x=[1 -2 4 6 -5 8 10];[x11,n11]=sigshift(x,n,2);[x12,n12]=sigshift(x,n,-1);[x13,n13]=sigfold(x,n);[x13,n13]=sigshift(x13,n13,-2);[x12,n12]=sigmult(x,n,x12,n12);[y,n]=sigadd(2*x11,n11,x12,n12);[y,n]=sigadd(y,n,-1*x13,n13)Problem 2(a) , is periodic in with period 2wjjwjwjjjw eeeeX 6542 42104)( ???????? ()jX??(b) MATLAB Program:clear; close all;n = 0:6; x = [4,2,1,0,1,2,4];w = [0:1:1000]*pi/1000;X = x*exp(-j*n'*w); magX = abs(X); phaX = angle(X);% Magnitude Response Plotsubplot(2,1,1); plot(w/pi,magX);grid;xlabel('frequency in pi units'); ylabel('|X|');title('Magnitude Response');% Phase response plotsubplot(2,1,2); plot(w/pi,phaX*180/pi);grid;xlabel('frequency in pi units'); ylabel('Degrees');title('Phase Response'); axis([0,1,-180,180]) (c) Because the given sequence x (n)={4,2,1,0,1,2,4} (n=0,1,2,3,4,5,6) is symmetric about ,the 132N???phase response satisfied the condition:()jHe??()3jHe?????so the phase response is a linear function in . (d) ;150,350zz???(e) The difference of amplitude and magnitude response:Digital Signal Processing of 20052Firstly, the amplitude response is a real function, and it may be both positive and negative. The magnitude response is always positive. Secondly, the phase response associated with the magnitude response is a discontinuous function. While the associated with the amplitude is a continuous linear function. Problem 3(a) )9.0.1/()() 21????zzHZero:0 and 1;Pole:-0.6 and 1.5;(b) , 11165()220Hzzz??????165()(0.)(1.)(22nnhnu???(c) ROC : , .6.5Z???????633251n nhnu????????????????Problem 4(a) y(n)={50,44,34,52};(b) y(n)={5,16,34,52,45,28,0};(c) N=6;(d) MATLAB Program:Function y=circonv(x1,x2,N)If (length(x1)N)error(“N must not be smaller than the length of sequence”)elsex1=[x1,zeros(1,N-length(x1))];endif(length(x2)N)error(“N must not be smaller than the length of sequence”)Digital Signal Processing of 20053elsex2=[x2,zeros(1,N-length(x2))]; endy1=dft(x1,N).*dft(x2,N);y=idft(y,N);(e) DTFT is discrete in time domain, but continuous in frequency domain. The DFT is discrete both in time and frequency domain.The FFT is a very efficient method for calculating DFT. Problem 5(a) Direct form II uses the little delay and it can decrease the space of the compute.(b)The advantage of the linear-phase form:1. For frequency-selective filters, linear-phase structure is generally desirable to have a phase-response that is a linear function of frequency. 2. This structure requires 50% fewer multiplications than the direct form.(c) Block diagrams are shown as under:1z? 1z? 1z? 1z? 1z? 1z?1253521()xn ()yn()xn()yn 1z? 1z? 1z?1z?1z?1z?1 2 5 3Problem 6(a) we use Hamming or Blackman window to design the bandpass filter because it can provide us attenuation exceed 60dB .(b) According to Blackman window :first, Determine transition width = ;psW?second, Determine the type of the window according to ;sAthird, Compute M using the formula ;Mps?2?fourth, Compute ideal LPF ;sc?fifth, design the window needed, multiply point by point;sixth, determine spAR,(c) MATLAB Program:Digital Signal Processing of 20054%% Specifications about Blackman window:ws1 = 0.2*pi; % lower stopband edgewp1 = 0.3*pi; % lower passband edgewp2 = 0.6*pi; % upper passband edgews2 = 0.7*pi; % upper stopband edgeRp = 0.5; % passband rippleAs = 60; % stopband attenuation%tr_width = min((wp1-ws1),(ws2-wp2));M = ceil(6.6*pi/tr_width); M = 2*floor(M/2)+1, % choose odd Mn = 0:M-1;w_ham = (hamming(M))';wc1 = (ws1+wp1)/2; wc2 = (ws2+wp2)/2;hd = ideal_lp(wc2,M)-ideal_lp(wc1,M);h = hd .* w_ham;[db,mag,pha,grd,w] = freqz_m(h,1);delta_w = pi/500;Asd = floor(-max(db([1:floor(ws1/delta_w)+1]))), % Actual AttnRpd = -min(db(ceil(wp1/delta_w)+1:floor(wp2/delta_w)+1)), % Actual passband ripple (5)%%% Filter Response Plotssubplot(2,2,1); stem(n,hd); title('Ideal Impulse Response: Bandpass');axis([-1,M,min(hd)-0.1,max(hd)+0.1]); xlabel('n'); ylabel('hd(n)')set(gca,'XTickMode','manual','XTick',[0;M-1],'fontsize',10)subplot(2,2,2); stem(n,w_ham); title('Hamming Window');axis([-1,M,-0.1,1.1]); xlabel('n'); ylabel('w_ham(n)')set(gca,'XTickMode','manual','XTick',[0;M-1],'fontsize',10)set(gca,'YTickMode','manual','YTick',[0;1],'fontsize',10)subplot(2,2,3); stem(n,h); title('Actual Impulse Response: Bandpass');axis([-1,M,min(hd)-0.1,max(hd)+0.1]); xlabel('n'); ylabel('h(n)')set(gca,'XTickMode','manual','XTick',[0;M-1],'fontsize',10)subplot(2,2,4); plot(w/pi,db); title('Magnitude Response in dB');axis([0,1,-As-30,5]); xlabel('frequency in pi units'); ylabel('Decibels')set(gca,'XTickMode','manual','XTick',[0;0.3;0.4;0.5;0.6;1])set(gca,'XTickLabelMode','manual','XTickLabels',['0';'0.3';'0.4';'0.5';'0.6';'1'],.'fontsize',10)set(gca,'TickMode','manual','YTick',[-50;0])set(gca,'YTickLabelMode','manual','YTickLabels',['-50';'0']);gridProblem 7Firstly, we use the given specifications of to design an analog lowpass IIR filter. spsAR,,?Secondly, we change the analog lowpass IIR filter into the analog highpass IIR filter. Thirdly, we change the analog highpass IIR filter into the digital highpass IIR filter. Examination A on “Digital Signal Processing”1. Let x(n)={3,7,-2,-1,5,-8},n=0:5; [7](a). Determine the sequences x1(n)=x(n+2) and x2(n)=x(n-1)(b). calculate y(n)=2x(n+2)+x(n-1)(c). Write a MATLAB program to generate the sequence of (b).2. Given sequence x(n)={4,3,2,0,2,3,4} with sample period Ts=0.1sec. [15](a). Determine the expression X(ejω )= DTFT[x(n)], discuss the periodicity of X(ejω ).(b). Write a MATLAB program for plotting magnitude and angle response of X(ejω ), where ω is evenly separated into 100 points between [0,π] radius. (You needn’t plot it)(c). Guess and make comments on the property of its angle plot.(d). Comment on the difference of amplitude and magnitude response. Give the function name in the textbook that can determine the amplitude response.3. Given the system function of a stable discrete system in z-transform: [12]H(z)= (1+z-1)/(1+0.5 z-1-0.24z-2)Determine: (a). Its zero-pole plot. (b). Its difference equation representation.(c). Its impulse response sequence h(n) using partial fraction representation, give the first 5 points.(d). Give two MATLAB statements that can calculate the first 5 points of impulse response.4. Compute the N-point circular convolution for the following sequences: [10](a). x1(n)={1,-1,1,-1}, x2(n)={2,1,1,2}, N=4;(b)Calculate the same circular convolution for N=8;(c) Determine the minimum N when circular convolution equal to linear convolution(d). Write a MATLAB program to calculate the circular convolution using DFT.5. A linear time-invariant system is given by the function: [8]65432125)( ??????zzzzH(a). Draw the flowgraph of the direct structure form.(b). Draw the flowgraph of the linear-phase form, explain its advantage.6. Design a bandpass FIR filter using the window design technique. [15]The specifications are;lower stopband edge: 0.2π upper stopband edge: 0.6πl(wèi)ower passband edge: 0.3π upper passband edge: 0.5πAs = 50dB, Rp=0.5dB(a). Select the proper window function;(b). Give the main design steps and(c). List the corresponding MATLAB program statements.Examination B on “Digital Signal Processing”1. Suppose x(n)=δ(n)+δ(n-1),Do the following: [8](a). Determine X(jω)=DTFT[x(n)],plot its amplitude and phase response.(b). Determine X(k)=DFT[x(n)] with period length N=4. Plot amplitude response |X(k)|~k.2. Given the difference equation of a discete system: y(n)=0.8y(n-1)+0.36y(n-2)+x(n)(a). Determine its system function H(z): [12](b). Suppose x(n)=(0.8)nu(n),calculate the z-transform of x(n) and y(n):X(z) and Y(z)(c). Write two MATLAB programs based on different methods to get the inverse z-transform of Y(z).3. Given the first five values of the 8-point DFT of a real-valued sequence x(n): [8]X(k)=DFT[x(n)]={0.3, 0.2+j0.5, 0 ,0.1-j0.2, 0.6,…}; k=0,1,…4,(a). Explain how to determine the sequence x(n)(n=0,1,…7) by using the properties of DFT.(b). Develop a MATLAB program to solve this problem.4. Given the system function of a filter: [8])7.0(5.90(32)???zzHPlot its: (a)direct structure form flowgraph.(b)cascade structure form flowgraph.5. Design a lowpass Butterworth analog prototype filter. The specifications are; [8]passband edge: 300Hz Rp=1dBstopband edge: 400Hz As = 50dB, (a). Give the main design steps.(b). Give the corresponding MATLAB program statement for each step.6. The MATLAB function imp_invr.m was given in the textbook: [20]function [b,a] = imp_invr(c,d,T)% Impulse Invariance Transformation from Analog to Digital Filter% ---------------------------------------------------------------[R,p,k] = residue(c,d); % statement 1p = exp(p*T); % statement 2[b,a] = residuez(R,p,k); % statement 3b = real(b'); a = real(a'); % statement 4(a). Give the analytical expressions of the impulse invariance transformation(b). Give comments to each of the four statements regarding to the analytical expressions(c). Give comments to each variables in different statements.
收藏
鏈接地址:http://www.szxfmmzy.com/p-458334.html