Professional Documents
Culture Documents
10 - Convolution Using TMS320C5x
10 - Convolution Using TMS320C5x
:
Date:
C ONVOL UT ION
A IM :
COMPONENTS REQUIRED:
1. C50 processor kit
2. CRO
3. Function generator
4. Power cable and probes
THEORY:
In general, convolution operations is of 2 types. They are:
1. Linear convolution
2. Circular convolution
Linear convolution is a complex operation and this can be carried
out using MAC and MACD instructions. It is given by: y(n)=x(n)*h(n) where
y(n) is the output sequence and x(n) & h(n) are the input
sequences
Convolution in frequency domain is calculated by process of multiplication
and accumulation with proper shifting of sequences. MAC and MACD
instructions are used in TMS processor for this purpose of performing
linear convolution.
Differences between MAC and MACD:
MAC MACD
The syntax is: The syntax is:
MAC pma,{ind},[nextARP] (or) MACD pma, dma (or)
MAC pma,dma MACD pma,{ind},[nextARP]
Data shift is not automatically produced It provides shifting automatically
CIRCULAR CONVOLUTION:
Consider two finite duration sequence of length N namely x(n) and y(n). Their
respective N-point DFT’s are
N1
j* 2**n*k / N
N1
j*2**n*k /N
Multiplying the DFT’s together ,the result is a DFT, say Z(k) of a sequence z(n) of length
N.
Zn
1
zke j*2**n*k / N
N
k 0
Substituting the values and rearranging the above equation we get the following term,
1
zn N 1
xnN 1
yn e j*2** mn1*k
N
N
n0 i0
The inner sum in the brackets of the above equation is of the form
N1
a N, a
k 1
and
k0 a 1 a /1 a
k N
e re a is d e fi
wh j* 2 ** m n 1 *k N ned as
e .
we observe that a=1 when m-n-1 is a multiple of N. On the other hand aN =1 for any value
a=0.
a N, l
k
m npN mnN , p is an integer
k0
0, otherwise
N1
This expression has the form of a convolution sum. It is not the linear
convolution which relates the output sequences of linear system to the
input sequence of x(n) and the impulse response h(n). Instead, the
convolution sum involves the index (m-n) N and is called the CIRCULAR
CONVOLUTION. Thus we conclude that multiplication of the DFT’s of two
sequences is equivalent to the circular convolution of two sequences in
time domain.
PROCEDURE:
LINEAR CONVOLUTION:
CODING:
;--------------------------------------------------------------------
; LINEAR CONVOLUTION " y(n) = x(n)*h(n)"
;--------------------------------------------------------------------
.mmregs
.text
START:
LDP #100H
LAR AR1,#(8100H+4H) ; x(n) Input Location
(8100h) ZAC
MAR *,AR1
RPT #2H
SACL *+
Next_YN:
LAR AR1,#8100H
LAR AR2,#(8200H+6H)
LAR AR0,#06H
ZAC
SACL 0H
MAR *,AR1
LT *+,AR2
Loop_MAC:
MPY *-,AR1
LTP *+,AR0
ADD 0H
SACL 0H
BANZ Loop_MAC,*-,AR2
LACC0H
MAR *,AR3
SACL *- ; Store O/P Data "y(n)"
CIRCULAR CONVOLUTION
Mnemonic Comments
LDP #0100H Load data pointer with value of 0100
H: B H End
RESULT:
Thus the linear and circular convolution of two entered sequence is
performed using DSP processor.
;INPUT ( x(n) )
; 8100 - 1
; 8101 - 3
; 8102 - 1
; 8103 - 3
;INPUT ( h(n) )
; 8200 - 1
; 8201 - 2
; 8202 - 1
; 8203 - 0
;OUTPUT (y(n) )
; 8300 - 1
; 8301 - 5
; 8302 - 8
; 8303 - 8
; 8304 - 7
; 8305 - 3
; 8306 - 0
;----------------------------------------------------------------
Memory Data location
8050 0001
8051 0002
8052 0003
8053 0004
h(n):
8061 0006
8062 0007
8063 0008
8011 0040
8012 003E
8013 0040