数字信号处理作业 第五章
- 格式:doc
- 大小:2.97 MB
- 文档页数:6
5.1解:差分方程为: 421nxnxny
5.3解:(a)由题可得 2122213020xxxy
113221203121xxxy
21223320213222xxxy
12233221223323xxxy
23223122233424xxxy
32213123243525xxxy
11213124253626xxxy
15263727xxxy
16273828xxxy
17283929xxxy
1829310210xxxy
即
n 0 1 2 3 4 5 6 7 8 9 10
y[n] 2 1 2 -1 2 3 1 1 1 1 1
(b) matlab中画图:
x=[1 2 3 2 1 1 1 1 1 1 1];
h=[2 -3 2];
y=conv(h,x);
subplot(2,1,1);
stem(x);
xlabel('n');ylabel('x(n)');
subplot(2,1,2);
stem(y);
xlabel('n');ylabel('y(n)');
(c)由题可得 22132nnnnh
h[n]
2
0 1 2
n
-3
5.4解:(a)直接型:
2
x[n]
-3
x[n-1]
x[n-2] 2
y[n] Unit delay
Unit delay (b)转置型:
2
x[n]
-3
2
y[n]
5.7解:由题可得 5,9,13,7,3kb
5,17解:(a)由题可得 1][1nxnxnh
2112nhnhnh
11223nhnhnh
(b)
12121nhnhnhnhnhl
mlnhmlhmxnhnxnyml21
(c)
mlnxmlnxmlnxmlnxmnxmnxmxmlnhmlnhmnxmnxmxnymlml32112111 Unit delay Unit delay E2,1,2
%ILLustration of convolution
a=input('Type in the first sequence =');
b=input('Type in the second sequence =');
c=conv(a,b);
M=length(c)-1;
n=0:1:M;
disp('Output sequence =');disp(c);
stem(n,c);
xlabel('Time index n');ylabel('Amplitude');
执行结果:
Type in the first sequence =[2,4,6,4,2]
Type in the second sequence =[3,-1,2,1]
Output sequence =
6 10 18 16 18 12 8 2
E2.1.3
%Smoothing by a Moving-Average Filter
R=50;
d=rand(R,1)-0.5;
m=0:1:R-1;
s=2*m.*(0.9.^m);
x=s+d';
plot(m,d,'r-',m,s,'b--',m,x,'g:');
xlabel('Time index n');ylabel('Amplitude');
legend('d[n]','s[n]','x[n]'); pause;
M=input('Number of input sample =');
b=ones(M,1)/M;
y=filter(b,1,x);
plot(m,s,'r-',m,y,'b--');
legend('s[n]','y[n]');
xlabel('Time index n');ylabel('Amplitude');
执行结果:
M=2
M=5
M=20