Vietnam National University
Ho Chi Minh City University of Technology
Digital Signal Processing
LAB 3 REPORT
Experiments on Convolution
Using TMS320C5515 eZDSPTM USB Stick
Instructor: Assoc. Prof. Dr. Thuong Le -Tien
Teaching Asisstants: Chi Hieu, Quoc Huy
Group 7:
Dat Nguyen-Si ID: ILI11006 In-class ID: 2
Trung Le ID: 41103857 In-class ID: 3
March, 13th 2014
Table of Contents
Table of Contents...........................................................1 March, 13th 2014
Abstract..........................................................................2
Introduction....................................................................3
Matlab codes..................................................................4
Source codes..................................................................5
Conclusion......................................................................6
References......................................................................7
1 Lab 3 report
Abstract
This report outlines steps to perform a March, 13th 2014
Convolution of two vectors using TMS320C5515
eZDSPTM USB Stick Development Tool. The report
includes a Matlab-based demonstration and
hardware-based programming to calculate y[n]
from given x[n] and h[n].
2 Lab 3 report
Introduction
Convolution is a mathematical way of combining two signals to form a thirdMarch, signal.13Itthis2014
the
single most important technique in Digital Signal Processing. Using the strategy of impulse
decomposition, 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.
Consider a causal FIR filter of order M with impulse response h[n], n = 0, 1, . . . , M; an input
signal x[n] and an output signal y[n], the direct and LTI forms of convolution are given by:
While n is the range of values of the output index, and m is the precise range of summation.
3 Lab 3 report
A graphic demonstration of Convolution calculation
In this Lab session, we use the second formula to calculate y[n].
Matlab codes
% Input x[n] March, 13th 2014
x = input('Input the length of first matrix:');
for i=1:x
string = fprintf('x[%d]',i-1);
x(i) = input(':');
end
% Input h[n]
h = input('Input the length of second matrix:');
for i=1:h
string = fprintf('h[%d]',i-1);
h(i) = input(':');
end
% Show the results
disp('Convolution of the two matrices is:');
y = conv(x,h)
4 Lab 3 report
With following ( given) inputs:
- x[n]={-2,1,3,4,0,3,2,-4,5,-2}
- h[n]={-3,-2,1,4,-1}
The result shown on the display is:
y=6 1 -13 -25 1 6 1 7 7 -3 -9 22 -13 2
These results are the same as the ones done by hand.
Source codes
Only the modification of main.c ( as being shown below) is needed.
March, 13th 2014
#include "stdio.h"
#include "usbstk5515.h"
void main( )
{
int x[50],h[50],y[50];
int i,j,m,n;
// Input lengths of x[n] and h[n]
printf("\n Enter length of x(n): ");
scanf("%d", &m);
printf("\n Enter length of y(n): ");
scanf("%d", &n);
// Input elements of x[n] and h[n]
printf ("\n Input elements of x(n):\n");
for (i=0;i<m;i++)
scanf("%d",&x[i]);
printf ("\n Input elements of h(n):\n");
for (i=0;i<n;i++)
scanf("%d",&h[i]);
5 // Assign 0s to expand x[n] and h[n] Lab 3 report
for(i=m;i<=m+n-1;i++) x[i]=0;// length of h[n]: m + n - 1
for(i=n;i<=m+n-1;i++) h[i]=0;
// Do the discrete convolution using the definition formula
for(i=0;i<m+n-1;i++)
{
y[i]=0;
for(j=0;j<=i;j++)
{
y[i]=y[i]+(x[j]*h[i-j]); }
}
// Show the results
printf("x(n) (*) h(n) = y[n]");
for (i=0;i<m+n-1;i++) printf("\n y[%d] = %d",i,y[i]);
return 0;
}
Using the same x[n] and h[n] as above, the result shown on the display is:
y=6 1 -13 -25 1 6 1 7 7 -3 -9 22 -13 2
The results are matched!
Conclusion
March, 13th 2014
In this lab session, we succeeded in getting the Matlab codes and CCS codes run smoothly.
We learn how to perform Convolution using Matlab and USB Stick. The experiment also
gives us further insights into Convolution done by a computer. The knowledge gained in this
Lab session might be useful on future experiments and learning.
6 Lab 3 report
References
[1] Texas Instruments, C5515 eZDSP USB Stick Development Tool description 13th 2014
and features,
March,
http://www.ti.com/tool/tmdx5515ezdsp, retrieved on February, 27th 2014.
[2] sensorasia, TMS320C5515_eZdip_USB stick.MP4, http://www.youtube.com/watch?
v=ZFnvH1iZoY8, retrieved on February, 27th 2014.
[3] Sophocles J. Orfanidis, Introduction to Signal Processing, Pearson Education, .Inc, New
Jersey, 2009.
Illustrating images of C5515 eZDSP USB Stick Development Tool are taken from
http://www.ti.com.
All source codes in this report are taken from the usbstk5515_v1 library associated with
C5515 eZDSP USB Stick Development Tool, provided by Spectrum Digital Inc..
7 Lab 3 report