% program file w1_20091203.m
clear all;
close all;
x_n = [2 1 1/2 1/4];
nx = [-1 0 1 2];
h_n = [1 1 1 1 ];
nh = [0 1 2 3];
y_n = conv(x_n,h_n);
y_n2 = conv(h_n,x_n);
n0 = nx(1) + nh(1);
N = length(nx)+length(nh)-1;
n = n0:n0 + N-1;
subplot(211);
stem(n,y_n,'b');
grid;
subplot(212);
stem(n,y_n2,'r');
grid;
沒有留言:
張貼留言