DSP PROGRAMS IN C
1. Linear Convolution
To verify Linear Convolution.
RS232 Serial Cable
Convolution is a formal mathematical operation, just as multiplication, addition, and integration. Addition takes two numbers and produces a third number, while convolution takes two signals and produces a third signal. Convolution is used in the mathematics of many fields, such as probability and statistics. In linear systems, convolution is used to describe the relationship between three signals of interest: the input signal, the impulse response, and the output signal.
In this equation, x1(k), x2 (n-k) and y(n) represent the input to and output from the system at time n. Here we could see that one of the input is shifted in time by a value everytime it is multiplied with the other input signal. Linear Convolution is quite often used as a method of implementing filters of various types.
Step 1 Declare three buffers namely Input buffer, Temporary Buffer, Output Buffer.
Step 2 Get the input from the CODEC, store it in Input buffer and transfer it to the first location of the
Step 3 Make the Temporary buffer to point to the last location.
Step 4 Multiply the temporary buffer with the coefficients in the data memory and accumulate it with
the previous output.
Step 5 Store the output in the output buffer.
Step 6 Repeat the steps from 2 to 5.
printf("\n enter value for m");
printf("\n enter value for n");
printf("Enter values for i/p\n");
printf("Enter Values for n \n");
printf("\n The Value of output y[%d]=%d",i,y[i]);
enter value for m4
enter value for n4
Enter values for i/p
1 2 3 4
Enter Values for n
1 2 3 4
The Value of output y=1
The Value of output y=4
The Value of output y=10
The Value of output y=20
The Value of output y=25
The Value of output y=24
The Value of output y=16