Professional Documents
Culture Documents
Aim: To write a program to verify Linear Convolution of a periodic sequences using Code Composer
Studio
Equipment Required: A Computer
Software Required: Code Composer Studio v3 or higher
Procedure:
Program Code:
/* Program to Verify Linear Convolution of a periodic sequences using Code Composer Studio */
#include<stdio.h>
#include<math.h>
int m=4; //length of the input sample sequence
int n=4; //length of the impulse sequence
int i=0,j;
int x[4]={1,2,3,4}; // input sample sequence
int h[4]={4,3,2,1}; //impulse sample sequence at the end of the samples pad ‘ m’ and ‘n ‘ zeros
int y[20];
main()
{
int i;
for(i=0;i<m+n-1;i++)
{
y[i]=0;
for(j=0;j<=i;j++)
y[i]+=x[j]*h[i-j];
}
/*displaying the result*/
for(i=0;i<m+n-1;i++)
printf("%d\n",y[i]);
}
Output:
The linear convolution output is {4,11,20,30,20,11,4}
Output: