Ngày tải lên :
12/09/2012, 16:20
... subplot(2,1,2);stem(k1,x);xlabel('n'),ylabel('x(n)');grid;
subplot(2,1,2);stem(k1,h);xlabel('n'),ylabel('h(n)');grid;
subplot(2,1,2);stem(k2,y);xlabel('n'),ylabel('y(n)');grid;
Lập trình Matlab.
a.
code:
num=[1 0];
den=[1 -0.7];
h=tf(num,den)
Transfer function:
- .ss 0 7
b. Đáp ứng tần số biên độ.
Code:
[h w]=freqz([1],[1 -0.7],1024);
phi=180*unwrap(angle(h))/pi;
... k2=linspace(-2*n0,2*n0,length_output);
subplot(2,1,2);stem(k1,x);xlabel('n'),ylabel('x(n)');grid;
subplot(2,1,2);stem(k1,h1);xlabel('n'),ylabel('h(n)');grid;
y=conv(x,h);
length_output=length(x)+length(h)-1;
k2=linspace(-2*n0,2*n0,length_output);
subplot(2,1,2);stem(k1,x);xlabel('n'),ylabel('x(n)');grid;
subplot(2,1,2);stem(k1,h);xlabel('n'),ylabel('h(n)');grid;
subplot(2,1,2);stem(k2,y);xlabel('n'),ylabel('y(n)');grid;
Lập ... h(n)=0,7
n
u(n).
code:
n0=10;
n=-n0:n0;
u1=n>=0;
u2=(n-2)>=0;
x=u1-u2;
h=(0.7).^n;
h1=h.*u1;
k1=-n0:n0;
y=conv(x,h1);
length_output=length(x)+length(h1)-1;
k2=linspace(-2*n0,2*n0,length_output);
subplot(2,1,2);stem(k1,x);xlabel('n'),ylabel('x(n)');grid;
subplot(2,1,2);stem(k1,h1);xlabel('n'),ylabel('h(n)');grid;
...