100% found this document useful (1 vote)
96 views8 pages

Convolution Experiments with TMS320C5515

This document reports on an experiment to perform convolution using a TMS320C5515 eZDSPTM USB Stick. Matlab code was used to demonstrate convolution between two vectors. The source code for the USB stick was also modified to calculate the convolution of the two vectors. The results obtained from both methods matched, showing that convolution was successfully performed using the USB stick hardware.

Uploaded by

Nguyễn Tài
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
96 views8 pages

Convolution Experiments with TMS320C5515

This document reports on an experiment to perform convolution using a TMS320C5515 eZDSPTM USB Stick. Matlab code was used to demonstrate convolution between two vectors. The source code for the USB stick was also modified to calculate the convolution of the two vectors. The results obtained from both methods matched, showing that convolution was successfully performed using the USB stick hardware.

Uploaded by

Nguyễn Tài
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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,
[Link] retrieved on February, 27th 2014.
[2] sensorasia, TMS320C5515_eZdip_USB stick.MP4, [Link]
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
[Link]

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

Common questions

Powered by AI

Using both Matlab and TMS320C5515 eZDSP provides a comprehensive learning experience by allowing students to understand both theoretical and practical aspects of convolution. Matlab offers a quick, abstracted view useful for initial learning, while the hardware approach provides insight into low-level operations, reinforcing understanding through implementation detail .

The Matlab implementation prompts the user to input the lengths and elements of two matrices. It uses a for loop to input signal values, and the 'conv' function is used to calculate and display the convolution result .

Based on the insights gained, advancements could include developing interactive simulation platforms that integrate both software and hardware elements, providing real-time visualization of convolution processes, and fostering deeper engagement through tangible experimentation .

The impulse response is crucial because it characterizes the system being analyzed. In convolution, it allows the combination with an input signal to produce the output signal, effectively describing how the system responds to different inputs .

The report concluded that the results from Matlab and TMS320C5515 eZDSP implementations matched each other, confirming the correctness and reliability of both approaches for performing convolution operations .

Input decomposition into simpler signals like impulses is crucial as it allows for the calculation of convolutions by determining system response to these basic inputs, subsequently summing these responses to achieve the overall output .

The report suggests that the experiments provided insights into how computers handle convolution operations, equipping students with practical knowledge that may apply to future experiments and enhancing their understanding of signal processing .

The TMS320C5515 eZDSPTM USB Stick uses C-based code to perform convolutions manually through loops and array manipulations, expanding input arrays with zeros and applying the discrete convolution formula, as opposed to Matlab's straightforward 'conv' function .

Impulse decomposition is significant because it simplifies complex systems into a set of simple impulsive signals. This approach allows for easier calculation and understanding of system behavior through convolution, as it focuses on the response to simple impulses, enabling the synthesis of complex outputs .

Convolution is described as the single most important technique in Digital Signal Processing because it combines two signals to form a third one, relating the input signal, output signal, and impulse response .

You might also like