Professional Documents
Culture Documents
1A
Waveform Generation
Output graphs:
Unit impulse function
Unit step function
Ramp function
Sine wave
Cosine wave
Triangular wave
Gaussian signal
Parabolic signal
Rectangular pulse
Result: From this experiment, I was able to generate parabolic, step, sine,
rectangular, square, ramp, impulse, pulse, sawtooth, sinc, triangular,
exponentially increasing and decreasing signals using MATLAB and plot the
outcomes.
Inference: By the help of this experiment, I was able to study about the signals
that use the elementary signals as their inputs and understand the behaviour of
these systems.
References:
1. Signals and Systems by P. Ramesh Babu and R. Anandanatarajan(4th
Edition)
2. Digital Signal Processing by P. Ramesh Babu(4th Edition)
EXPERIMENT NO. 1B
Convolution of Signals
Aim: To determine the linear and circular convolutions of any two sequences
manually using a method other than matrix multiplication and verify the results
using MATLAB.
Apparatus Required: MATLAB R2016A, Windows 10- 64 bit operating system
Theory: Convolution is a mathematical operation used to express the relation
between input and output of an LTI system. It relates input, output and impulse
response of an LTI system as
y(t)=x(t)∗h(t)y(t)=x(t)∗h(t)
Where y (t) = output of LTI
x (t) = input of LTI
h (t) = impulse response of LTI
There are two types of convolutions:
Continuous convolution
Discrete convolution
Continuous Convolution
y(t)=x(t)∗h(t)y(t)=x(t)∗h(t)
=∫x(τ)h(t−τ)dτ=∫x(τ)h(t−τ)dτ (integrating from -∞ to ∞)
(or)
=∫x(t−τ)h(τ)dτ=∫x(t−τ)h(τ)dτ (integrating from -∞ to ∞)
Discrete Convolution
y(n)=x(n)∗h(n)y(n)=x(n)∗h(n)
=Σx(k)h(n−k)=Σx(k)h(n−k) (summation from -∞ to ∞)
(or)
=Σx(n−k)h(k)=Σx(n−k)h(k) (summation from -∞ to ∞)
By using convolution we can find zero state response of the system.
Procedure: First we clear the command window and delete all the previous
variables. Then we get the two sequences as the user input and find the third
sequence by means of convolution by logic or by using conv() function directly
and plot the graph by using stem() function. We do the same for circular
convolution i.e. find the third sequence by means of circular convolution by
logic or by cconv() command.
Manual calculations:
MATLAB program:
%Program for linear convolution using syntax
clc;
clear all;
close all;
x=input('Enter the first sequence');
N1=length(x);
h=input('Enter the second sequence');
N2=length(h);
n=0:1:N1-1;
subplot(2,2,1);
stem(n,x);
xlabel('Time');
ylabel('Amplitude');
title('X Sequence Response');
n=0:1:N2-1;
subplot(2,2,2);
stem(n,h);
xlabel('Time');
ylabel('Amplitude');
title('H Sequence Response');
y=conv(x,h)
N=N1+N2-1;
n=0:1:N-1;
subplot(2,2,4);
stem(n,y);
xlabel('Time');
y=conv(x,h)
N=N1+N2-1;
n=0:1:N-1;
subplot(2,2,4);
stem(n,y);
xlabel('Time');
ylabel('Amplitude');
title('Convolution of X&H Response');
for n=1:N
y(n)=0;
for i=1:N
j=n-i+1;
if(j<=0)
j=N+j;
end
y(n)=y(n)+x(i)*h(j);
end
end
disp('Convolution of x and h is');
subplot(2,2,3);
stem(y);
xlabel('Time');
ylabel('Amplitude');
title('Convolution of X and H response');
y=
6 5 13 10 8 5 1
y=
6 5 13 10 8 5 1
Samples of x[n][3 1 3 1]
Sample of h[n][2 1 2 1]
Convolution of two signals
N=
4
Convolution of x and h is
Samples of x[n][1 -1 -2 3]
Samples of h[n][1 2 3]
y=
1 10 -1 -4
Circular Convolution
Result: From this experiment, I was able to determine the linear and circular
convolutions of any two sequences manually using a method other than matrix
multiplication and verify the results using MATLAB.
Applications:
1. Image Processing
2. Signal Filtering
Inference: From this experiment, I was able to understand that convolution is a
mathematical way of combining two signals to form a third signal. Systems are
described by a signal called the impulse response. Convolution is important
because it relates the three signals of interest: the input signal, the output signal,
and the impulse response.
References:
1. Signals and Systems by P. Ramesh Babu and R. Anandanatarajan(4th
Edition)
2. Digital Signal Processing by P. Ramesh Babu(4th Edition)