CIRCULAR CONVOLUTION
#1

Code:
#include<stdio.h>
#include<math.h>
int m,n,x[30],h[30],y[30],i,j,temp[30],k,x2[30],a[30];
void main()
{
   printf("  enter the length of the first sequence\n");
   scanf("%d",&m);
   printf("  enter the length of the second sequence\n");
   scanf("%d",&n);
   printf("  enter the first sequence\n");
   for(i=0;i<m;i++)
   scanf("%d",&x[i]);
   printf("  enter the second sequence\n");
   for(j=0;j<n;j++)
   scanf("%d",&h[j]);
   if(m-n!=0)            /*If length of both sequences are not equal*/
   {
    if(m>n)            /* Pad the smaller sequence with zero*/
    {
    for(i=n;i<m;i++)
    h[i]=0;
    n=m;
    }
    for(i=m;i<n;i++)
    x[i]=0;
    m=n;
   }
   y[0]=0;
   a[0]=h[0];
   for(j=1;j<n;j++)                    /*folding h(n) to h(-n)*/
   a[j]=h[n-j];
     /*Circular convolution*/
  for(i=0;i<n;i++)
   y[0]+=x[i]*a[i];
  for(k=1;k<n;k++)
  {
   y[k]=0;
   /*circular shift*/
   for(j=1;j<n;j++)
   x2[j]=a[j-1];
   x2[0]=a[n-1];
   for(i=0;i<n;i++)
    {
    a[i]=x2[i];
    y[k]+=x[i]*x2[i];
    }
}
  /*displaying the result*/
  printf("  the circular convolution is\n");
  for(i=0;i<n;i++)
  printf("%d \t",y[i]);
  }
PROCEDURE:
 Open Code Composer Studio; make sure the DSP kit is turned on.
 Start a new project using ‘Project-new ‘ pull down menu, save it in a
separate directory(C:\CCStudio_v3.1\myprojects) with name cir conv.pjt.
 Add the source files Circular Convolution
 to the project using ‘Projectadd files to project’ pull down menu.
 Add the linker command file hello.cmd.
(Path: C:\CCStudio_v3.1\tutorial\dsk6713\hello1\hello.cmd)
 Add the run time support library file rts6700.lib
(Path: C:\CCStudio_v3.1\c6000\cgtools\lib\rts6700.lib)
 Compile the program using the ‘Project-compile’ pull down menu or by
clicking the shortcut icon on the left side of program window.
 Build the program using the ‘Project-Build’ pull down menu or by
clicking the shortcut icon on the left side of program window.
 Load the program(lconv.out) in program memory of DSP chip using the
File-load program’ pull down menu.
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: modulo n circular convolution, circular convolution using idft and dft, matlab code for circular convolution using dft idft, advantage and disadvantage of circular convolution, verilog source code for convolution, circular convolution of the two sequences, c code for circular convolution,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  CIRCULAR CONVOLUTION OF TWO SEQUENCES seminar class 1 4,767 21-11-2012, 12:18 PM
Last Post: seminar details
  CIRCULAR CONVOLUTION OF TWO FINITE LENGTH SEQUENCES USING DFT AND IDFT seminar class 1 9,457 21-11-2012, 12:18 PM
Last Post: seminar details
  LINEAR CONVOLUTION seminar class 0 2,280 06-05-2011, 03:52 PM
Last Post: seminar class
  LINEAR CONVOLUTION OF TWO FINITE LENGTH SEQUENCES USING DFT AND IDFT seminar class 0 3,320 06-05-2011, 03:40 PM
Last Post: seminar class
  3. LINEAR CONVOLUTION OF TWO SEQUENCES seminar class 0 1,968 06-05-2011, 03:29 PM
Last Post: seminar class

Forum Jump: