Ex 1 linear and circular convolution
Ex 1 linear and circular convolution
AIM:
To write a program to perform the Linear convolution and to verify using MATLAB.
APPARATUS REQUIRED:
PC with MATLAB software
ALGORITHM:
LINEAR CONVOLUTION
1. Start
2. Get the two input sequences.
3. Obtain the linear convolution of two sequences.
4. Calculate the lengths of input sequences.
5. Assign the length of resultant sequence(N) equal to length of first sequence (L) +
length of second sequence (M) – 1 (N = L + M – 1).
6. Plot the input sequences and output sequence in discrete form corresponding to
their lengths.
7. Label the x and y axes.
8. Display the resultant sequence values.
9. Stop
CIRCULAR CONVOLUTION
1. Start
2. Get the two input sequences.
3. Check the maximum length (N) of two sequences.
4. By zero padding, make both the two sequences with equal length (N).
5. Calculate circular convolution of equal length sequences.
6. Plot the input sequences and output sequence in discrete form corresponding to their
lengths.
7. Label the x and y axes.
8. Display the resultant sequence values.
9. Stop
PROCEDURE:
1. Get two signals x(n) and h(n) in matrix form.
2. The convolute signal is denoted as y(n).
3. y(n) is given by the formula
y(n) = x(k)h(n-k)
4. n = length(X) returns the size of the longest dimension of X. If X is a vector, this is
OUTPUT: