0% found this document useful (0 votes)
72 views

ASSIGNMENT 1: Linear Convolution and De-Convolution

This document discusses linear convolution and deconvolution. It provides code to perform linear convolution on input sequences x(n) and h(n) and plot the resulting output sequence y(n). It also lists properties of linear convolution, including commutation, association, and distribution. Sequences x1(n), x2(n), x3(n) are defined and the document asks to mathematically prove the convolution properties and generate/plot sequences involving the convolution of these inputs. Finally, it asks to use deconvolution to determine the input x(n) that would generate a given output y(n) using a given impulse response h(n).

Uploaded by

Jam Magat
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views

ASSIGNMENT 1: Linear Convolution and De-Convolution

This document discusses linear convolution and deconvolution. It provides code to perform linear convolution on input sequences x(n) and h(n) and plot the resulting output sequence y(n). It also lists properties of linear convolution, including commutation, association, and distribution. Sequences x1(n), x2(n), x3(n) are defined and the document asks to mathematically prove the convolution properties and generate/plot sequences involving the convolution of these inputs. Finally, it asks to use deconvolution to determine the input x(n) that would generate a given output y(n) using a given impulse response h(n).

Uploaded by

Jam Magat
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

ASSIGNMENT 1: Linear Convolution and De-Convolution

% Linear Convolution
x=[3 11 7 0 -1 4 2];
% input signal
h=[2 3 0 -5 2 1];
% impulse response
nx=[-3:3];
% beginning point and end point of x(n)
nh=[-1:4];
% beginning point and end point of h(n)
nyb=nx(1)+nh(1);
% beginning point of y(n)
nye=nx(length(x))+nh(length(h));
% end point of y(n)
ny=[nyb:nye]
% beginning point and end point of y(n)
y=conv(x,h)
% CONV(A, B) convolves vectors A and B.
% The resulting vector is length LENGTH(A)+LENGTH(B) - 1.

%Program for linear convolution of the sequence x(n) and h(n)


x=input('Enter the first sequence[ ]= ');
nx=input('Enter the beginning and end point of x(n)[ ]= ');
h=input('Enter the second sequence[ ]= ');
nh=input('Enter the beginning and end point of h(n)[ ]= ');
nyb=nx(1)+nh(1);
nye=nx(length(x))+nh(length(h));
ny=[nyb:nye]
y=conv(x,h)
%Program for linear convolution of the sequence x(n) and h(n)
x=input('Enter the first sequence[ ]= ');
nx=input('Enter the beginning and end point of x(n)[ ]= ');
h=input('Enter the second sequence[ ]= ');
nh=input('Enter the beginning and end point of h(n)[ ]= ');
nyb=nx(1)+nh(1);
nye=nx(length(x))+nh(length(h));
ny=[nyb:nye]
y=conv(x,h)
figure;
subplot(3,1,1);plot(x,nx);stem(x,nx);ylabel('Amplitude x(n)');xlabel('(a) n-->');
subplot(3,1,2);plot(h,nh);stem(h,nh);ylabel('Amplitude h(n)');xlabel('(b) n-->');
subplot(3,1,3);plot(y,ny);stem(y,ny);ylabel('Amplitude y(n)');xlabel('(c) n-->');
disp('The resultant signal is');y

The linear convolution has several properties:


x1(n) * x2(n) = x2(n) * x1(n)
: Commutation
[x1(n) * x2(n)]* x3(n) = x1(n) *[ x2(n)* x3(n)] : Association
x1(n) * [x2(n) + x3(n)] = x1(n) * x2(n) + x1(n)* x3(n) :Distribution
x1(n) = n[u(n + 5) u(n 5)]
x2(n) = cos(0.1n)[u(n) u(n 10)]
x3(n) = 1.2n [u(n + 5) u(n 5)]

(1)
(2)

Mathematically prove these properties.


Using Matlab M-file, generate and plot the following
sequences.
(a)
(b)
(c)
(d)
(e)
(f)

(3)

x1(n) = n[u(n + 5) u(n 5)]


x2(n) = cos(0.1n)[u(n) u(n 10)]
x3(n) = 1.2n [u(n + 5) u(n 5)]
y1(n) = x1(n) * x2(n)
y2(n) = x1(n) * x2(n)* x3(n)
y3(n) = x1(n) * x2(n) + x1(n)* x3(n)

Consider a system with impulse response


h(n) = (1/2)n ,

0<n<4

Using Matlab, determine the input x(n) for 0 < n < 8


that will generate the output sequence
y(n) = {1, 2, 2.5, 3, 3, 3, 2, 1}

You might also like