filmov
tv
LINEAR CONVOLUTION OF TWO GIVEN SEQUENCES (Two sided sequences)
Показать описание
PROGRAM IN DESCRIPTION BOX:
%main part of computation
%first sequence
x1=[1 2 3 2 1 3 4]
%time vector of first seq
n1=-3:3
%second seq
x2=[ 2 -3 4 -1 0 1]
%time vector of second seq
n2=-1:4
%add first elements of time vector
ybegin=n1(1)+n2(1);
%add last elements of time vector
yend=n1(length(x1))+n2(length(x2));
ny=[ybegin:yend];
y=conv(x1,x2);
disp('linear con of x1 & x2 is y=');
disp(y);
%graphical display with time info
subplot (2,1,1);
stem(ny,y);
xlabel('time index n');
%main part of computation
%first sequence
x1=[1 2 3 2 1 3 4]
%time vector of first seq
n1=-3:3
%second seq
x2=[ 2 -3 4 -1 0 1]
%time vector of second seq
n2=-1:4
%add first elements of time vector
ybegin=n1(1)+n2(1);
%add last elements of time vector
yend=n1(length(x1))+n2(length(x2));
ny=[ybegin:yend];
y=conv(x1,x2);
disp('linear con of x1 & x2 is y=');
disp(y);
%graphical display with time info
subplot (2,1,1);
stem(ny,y);
xlabel('time index n');