星期三, 11月 18, 2009

matlab 2009 11/19 02


% program file lab20091119w1.m
clear all;
clf;
x_n = 10*ones(1,800);
r = 2;
l = 1;
ts = 0.01;
a = [1/ts + r/l -1/ts];
b = [1/l];
y_n = filter(b,a,x_n);
n = 0:1:800-1;

l2= 5;
a2 = [1/ts + r/l2 -1/ts];
b2 = [1/l2];
y2_n = filter(b2,a2,x_n);

x2_n = 10*(n>=50);
y2_n = filter(b2,a2,x2_n);

subplot(211);
stem(n,x2_n,'b');
grid;
subplot(212);
stem(n,y2_n,'b');
grid;


沒有留言: