Download as pdf or txt
Download as pdf or txt
You are on page 1of 62

Department Of Electronics and Communication

RAJ KUMAR GOEL INSTITUTE OF


TECHNOLOGY

(ISO 9001:2015 Certified)

DIGITAL SIGNAL PROCESSING LAB


MANUAL
KEC-553 A

DEPARTMENT OF ELECTRONICS AND COMMUNICATION


ENGINEERING

5TH Km STONE, DELHI MEERUT BYPASS ROAD GHAZIABAD


Tel: (0120) 2788409, Fax: (0120) 2788350
website :- www.rkgit.edu.in

Digital Signal Processing Lab- KEC-553A Page 1


Department Of Electronics and Communication

Contents
SYLLABUS & COURSE OUTCOMES ........................................................................................... 3
STUDY & EVALUATION SCHEME................................................................................. ..............4

EXPERIMENT - 1 Introduction to MATLAB and or Open Source Software, Scilab (Using Spoken
Tutorial MOOCs). ......................................................................................................................... 5
EXPERIMENT - 2Write a Program for the generation of basic signals such as unit impulse, unit step,
ramp, exponential, sinusoidal and cosine. ........................................................................................ .9
EXPERIMENT - 3 Implement IIR Butterworth analog Low Pass for a 4 KHz cut off frequency.
…………………………………………… 13

EXPERIMENT -4 Verify Blackman and Hamming windowing techniques. … ………... 17

EXPERIMENT-5Evaluate 4-point DFT of and IDFT of x(n) = 1, 0 ≤ n ≤ 3; 0 elsewhere. ........ ....24


EXPERIMENT-6 Verify Linear convolution of two sequences using Code Composer
Studio………………………………… ………………28

EXPERIMENT-7 Verify Circular Convolution of two sequences using FFT.. .............................. 31


EXPERIMENT-8 To verify FFT as sample
interpolator.………………………………………………………....................................................36

EXPERIMENT-9 To implement Tone Generation…………………………………………………39

EXPERIMENT-10 To implement Tone Generation..........................................................................44

EXPERIMENT-11 To study about DSP Processors and architecture of TMS320C6713 DSP


processor.……………………………………………………………………………………………47

Experiments (Beyond the Syllabus)

Experiment -1 Generate Frequency Modulation having carrier frequency 1KHz and modulating
frequency 200 Hz with the modulating index of 0.7. ......................................................................54

Experiment -2 Generate a FSK wave form for transmitting the digital data of the given bit
sequence......................................................................................................................................... .57

Experiment -3 Generate a PSK wave form for transmitting the digital data of the given bit sequence.
..........................................................................................................................................................59

Experiment -4Blinking of On Board LED (TMS320C6713)...........................................................61

Digital Signal Processing Lab- KEC-553A Page 2


Department Of Electronics and Communication

SYLLABUS FOR DSP LAB

KEC-553A: Digital Signal Processing Lab

1.Introduction to MATLAB and or Open Source Software, Scilab (Using Spoken


Tutorial MOOCs).
2. Write a Program for the generation of basic signals such as unit impulse, unit step,
ramp, exponential, sinusoidal and cosine.
3. Implement IIR Butterworth analog Low Pass for a 4 KHz cut off frequency.
4. Verify Blackman and Hamming windowing techniques.
5. Evaluate 4-point DFT of and IDFT of x(n) = 1, 0 ≤ n ≤ 3; 0 elsewhere.
6. Verify Linear convolution of two sequences using FFT
7. Verify Circular Convolution of two sequences using FFT.
8. To verify FFT as sample interpolator.
9. To implement Tone Generation.
10. To implement floating point arithmetic.
11. To study about DSP Processors and architecture of TMS320C6713 DSP processor.

Course Outcomes
After studying this course the students would be able to-

Course Outcomes: At the end of this course students will demonstrate the ability to:

C03558.1. Understand the handling of discrete/digital signals using MATLAB/Scilab.

C03558.2. Implement and understand the basic operations of Signal processing .

C03558.3. Analyse the spectral parameter of window functions

C03558.4. Design IIR, and FIR filters for band pass, band stop, low pass and high pass filters.

C03558.5. Design the signal processing algorithm using MATLAB/Scilab.

Digital Signal Processing Lab- KEC-553A Page 3


Department Of Electronics and Communication

STUDY AND EVALUATION SCHEME

Sub Code Subject L-T-P Lab Marks Total Credit


Name

ESE Sessional

KEC-553A DSP LAB 0-0-2 25 25 50 1

Digital Signal Processing Lab- KEC-553A Page 4


Department Of Electronics and Communication

EXPERIMENT - 1
Objective:-

Introduction to MATLAB and or Open Source Software.

Introduction to MATLAB:-
This is very important tool used for making long complicated calculations and plotting graphs
of different functions depending upon our requirement. Using MATLAB an m-file created in
which the basic operations are performed which the basic operations are performed which leads
to simple short and simple computations of very complicated problems in no or very short time.
Important functions performed by MATLAB are Matrix computations, Vector Analysis,
Differential equations computations, Integration is possible, Computer language programming
Simulations, Graph 2D and 3D plotting.

LIBRARY FUNCTIONS:

clc

Clear Command Window : clc clears all input and output from the Command Window display,
giving you a "clean screen."

Close all

Remove specified figure, closes deletes the current figure or the specified figure(s). It
optionally returns the status of the close operation.

clear all

Remove items from workspace, freeing up system memory

• clear removes all variables from the workspace, releasing them from system memory.

• clear name removes just the M-file or MEX-file function or variable name from your
base workspace. If called from a function, clear name removes name from both the
function workspace and in your base workspace.

ones

• Create array of all ones

• Y = ones(n) returns an n-by-n matrix of 1s. An error message appears if n is not a scalar.

• Y = ones(m,n) or Y = ones([m n]) returns an m-by-n matrix of ones

Digital Signal Processing Lab- KEC-553A Page 5


Department Of Electronics and Communication

zeros

• Create array of all zeros

• B = zeros(n) returns an n-by-n matrix of zeros. An error message appears if n is not a


scalar.

• B = zeros(m,n) or B = zeros([m n]) returns an m-by-n matrix of zeros.

plot

• 2-D line plot

• plot(Y) plots the columns of Y versus the index of each value when Y is a real number.
For complex Y, plot(Y) is equivalent to plot(real(Y),imag(Y)).

subplot

• Create axes in tiled positions

• subplot divides the current figure into rectangular panes that are numbered rowwise.
Each pane contains an axes object which you can manipulate using Axes Properties.
Subsequent plots are output to the current pane.

• h = subplot(m,n,p) or subplot(mnp) breaks the figure window into an m-by-n matrix of


small axes, selects the pth axes object for the current plot, and returns the axes handle.
The axes are counted along the top row of the figure window, then the second row, etc.

xlabel, ylabel, zlabel

• Label x-, y-, and z-axis•

• Each axes graphics object can have one label for the x-, y-, and z-axis. The label appears
beneath its respective axis in a two-dimensional plot and to the side or beneath the axis
in a three-dimensional plot.

• xlabel('string') labels the x-axis of the current axes.

title

Add title to current axes•

• Each axes graphics object can have one title. The title is located at the top and in the
center of the axes.

• title('string') outputs the string at the top and in the center of the current axes.
Digital Signal Processing Lab- KEC-553A Page 6
Department Of Electronics and Communication

• title(fname) evaluates the function that returns a string and displays the string at the top
and in the center of the current axes.

stem

• Plot discrete sequence data

• A two-dimensional stem plot displays data as lines extending from a baseline along the
x-axis. A circle (the default) or other marker whose y-position represents the data value
terminates each stem.

• stem(Y) plots the data sequence Y as stems that extend from equally spaced and
automatically generated values along the x-axis. When Y is a matrix, stem plots all
elements in a row against the same x value.

• stem(X,Y) plots X versus the columns of Y. X and Y must be vectors or matrices of the
same size. Additionally, X can be a row or a column vector and Y a matrix with
length(X) rows.

Result:
The study of basics of MATLAB been accomplished.

Viva Questions:

1. Explain what is MATLAB?

Ans: MatLab is a high-level programming language with an interactive environment for


visualization, numerical computation and programming function.

2. What does MATLAB consist of?

Ans: MATLAB consists of five main parts

• MATLAB Language
• MATLAB working environment
• Handle Graphics
• MATLAB function library
• MATLAB Application Program Interface (API)

Digital Signal Processing Lab- KEC-553A Page 7


Department Of Electronics and Communication

3. Explain MATLAB API (Application Program Interface)?

Ans : MatLab API is a library that enables you to write Fortran and C programs that interact
with MatLab. It contains the facilities for calling routines from MatLab, for reading and writing
Mat files and calling Matlab as a computational engine.

4. What are the types of loops does MATLAB provides?

Ans : Matlab provides loops like

• While Loop
• For Loop
• Nested Loops

Digital Signal Processing Lab- KEC-553A Page 8


Department Of Electronics and Communication

EXPERIMENT- 2

Objective:-

Write a Program for the generation of basic signals such as unit impulse, unit step, ramp,
exponential, sinusoidal and cosine.

Apparatus Required:-
Hardware: Personal Computer
Software : MATLAB

Procedure:-
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

Program:-
(Generation of Discrete Time Signals)
%Program for unit step sequence
clc;
N=input('Enter the length of unit step sequence(N)= ');
n=0:1:N-1;
y=ones(1,N);
subplot(3,2,1);
stem(n,y,'k');
xlabel('Time')
ylabel('Amplitude')
title('Unit step sequence');

%Program for unit ramp sequence


N1=input('Enter the length of unit ramp sequence(N1)= ');
n1=0:1:N1-1;
y1=n1;
subplot(3,2,2);
stem(n1,y1,'k');
xlabel('Time');
ylabel('Amplitude');
title('Unit ramp sequence');
%Program for sinusoidal sequence
Digital Signal Processing Lab- KEC-553A Page 9
Department Of Electronics and Communication

N2=input('Enter the length of sinusoidal sequence(N2)=


');
n2=0:0.1:N2-1;
y2=sin(2*pi*n2);
subplot(3,2,3);
stem(n2,y2,'k');
xlabel('Time');
ylabel('Amplitude');
title('Sinusoidal sequence');

%Program for cosine sequence


N3=input('Enter the length of the cosine sequence(N3)=');
n3=0:0.1:N3-1;
y3=cos(2*pi*n3);
subplot(3,2,4);
stem(n3,y3,'k');
xlabel('Time');
ylabel('Amplitude');
title('Cosine sequence');

%Program for exponential sequence

N4=input('Enter the length of the exponential


sequence(N4)= ');
n4=0:1:N4-1;
a=input('Enter the value of the exponential sequence(a)=
');
y4=exp(a*n4);
subplot(3,2,5);
stem(n4,y4,'k');
xlabel('Time');
ylabel('Amplitude');
title('Exponential sequence');

%Program for unit impulse


n=-3:1:3;
y=[zeros(1,3),ones(1,1),zeros(1,3)];
subplot(3,2,6);
stem(n,y,'k');
xlabel('Time');
ylabel('Amplitude');
title('Unit impulse');

Digital Signal Processing Lab- KEC-553A Page 10


Department Of Electronics and Communication

Output Waveform:

Result: -

Thus the MATLAB programs for discrete time signal sequences were written using
using MATLAB function and results were plotted.

Viva Questions :

1. What are the advantages of frequency sampling method ?

Ans:-1. Simple method of design.


2. Simple realization in frequency domain.
3. Better control over ωp and ωs.

2. What is difference between MATLAB and C-program magnitude/phase plots?

Ans:- The MATLAB plot is in dB, whereas C-program plot is linear. Hence, the difference is
there. But window coefficient of both the programs are same.

Digital Signal Processing Lab- KEC-553A Page 11


Department Of Electronics and Communication

3. What are advantages of using DFT for long duration sequences ?

Ans:- 1. Long duration sequences are filtered using overlap save method and overlap add
method.
2. DFT is implemented using FFT algorithms, which is computationally efficient.

Digital Signal Processing Lab- KEC-553A Page 12


Department Of Electronics and Communication

EXPERIMENT- 3

Objective: -

Implement IIR Butterworth analog Low Pass for given specifications.

Apparatus Required:-

1. Hardware: Personal Computer


2. Software : MATLAB

Theory:-

IIR filters are digital filters with infinite impulse response. Unlike FIR filters, they have the
feedback (a recursive part of a filter) and are known as recursive digital filters therefore. For
this reason IIR filters have much better frequency response than FIR filters of the same order.
Unlike FIR filters, their phase characteristic is not linear which can cause a problem to the
systems which need phase linearity. For this reason, it is not preferable to use IIR filters in
digital signal processing when the phase is of the essence. Otherwise, when the linear phase
characteristic is not important, the use of IIR filters is an excellent solution. There is one
problem known as a potential instability that is typical of IIR filters only. FIR filters do not
have such a problem as they do not have the feedback. For this reason, it is always necessary to
check after the design process whether the resulting IIR filter is stable or not.

IIR FILTER DESIGN :-

For the given specifications to Design a digital IIR filter, first we need to design analog filter
(Butterworth or chebyshev). The resultant analog filter is transformed to digital filter by using
either “Bilinear transformation or Impulse Invariant transformation”.

Program:
clc;
clear all;
close all;
disp('enter the IIR filter design specifications');
rp=input('enter the passband ripple:');
rs=input('enter the stopband ripple:');

Digital Signal Processing Lab- KEC-553A Page 13


Department Of Electronics and Communication

wp=input('enter the passband freq:');


ws=input('enter the stopband freq:');
fs=input('enter the sampling freq:');
w1=2*wp/fs;w2=2*ws/fs;
[n,wn]=buttord(w1,w2,rp,rs,'s');
disp('Frequency response of IIR LPF is:');
[b,a]=butter(n,wn,'low','s');
w=0:.01:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
figure,subplot(2,1,1);plot(om/pi,m);
title('magnitude response of IIR filter is:');
xlabel('(a) Normalized freq. -->');
ylabel('Gain in dB-->');
subplot(2,1,2);plot(om/pi,an);
title('phase response of IIR filter is:');
xlabel('(b) Normalized freq. -->');
ylabel('Phase in radians-->');

Input: -
enter the IIR filter design specifications

enter the passband ripple:15

enter the stopband ripple:60

enter the passband freq:1500

enter the stopband freq:3000

enter the sampling freq:7000

Digital Signal Processing Lab- KEC-553A Page 14


Department Of Electronics and Communication

Output Waveform:-

Result:-

IIR filter is designed according to the given specifications and output waveforms are observed.

Viva Questions:-
1:- Which of the filter can be realized in both recursive and non recursive structure?

a) Butterworth filter b) Chebyshev filter c) II R filter d) FIR filter

Ans:- [d ]

2:- Which filter is free of Limit cycle oscillations when implemented on a finite word length
digital system

Digital Signal Processing Lab- KEC-553A Page 15


Department Of Electronics and Communication

a) Butterworth filter b) Chebyshev filter c) II R filter d) FIR filter

Ans:-[d]

3:- In which filter the memory requirement and execution time are very high.

a) Butterworth filter b) Chebyshev filter c) II R filter d) FIR filter

Ans:- [d ]

4:- Which of the following window is used instead of Hanning window for the same main lobe
width

a) Rectangular window b) Triangular window

c) Hamming window d) Kaiser Window

Ans:- [c ]

5:- The cascaded form of realization is used.

a) When complex poles with absolute magnitude less than one

b) When complex poles with absolute magnitude greater than one

c) When complex zeros with absolute magnitude less than one

d) When complex zeros with absolute magnitude greater than one

Ans:- [c ]

Digital Signal Processing Lab- KEC-553A Page 16


Department Of Electronics and Communication

EXPERIMENT -4
Verify Blackman and Hamming windowing techniques.

Apparatus Required:-

1. Hardware: Personal Computer


2. Software : MATLAB

Theory:-

FIR filters are digital filters with finite impulse response. They are also known as non-
recursive digital filters as they do not have the feedback. An FIR filter has two important
advantages over an IIR design: Firstly, there is no feedback loop in the structure of an FIR
filter. Due to not having a feedback loop, an FIR filter is inherently stable. Meanwhile, for an
IIR filter, we need to check the stability. Secondly, an FIR filter can provide a linear-phase
response. As a matter of fact, a linear-phase response is the main advantage of an FIR filter over
an IIR design otherwise, for the same filtering specifications; an IIR filter will lead to a lower
order

Window Design Method :-


In the window design method, one first designs an ideal IIR filter and then truncates the infinite
impulse response by multiplying it with a finite length window function. The result is a finite
impulse response filter whose frequency response is modified from that of the IIR filter.

Procedure:-
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

Digital Signal Processing Lab- KEC-553A Page 17


Department Of Electronics and Communication

Program:-
clc;
clear all;
rp = input('Enter the passband ripple = ');
rs = input('Enter the stopband ripple = ');
fp = input('Enter the passband frequency = ');
fs = input('Enter the stopband frequency = ');
f = input('Enter the sampling frequency = ');
wp = 2*fp/f;
ws = 2*fs/f;
num = -20*log10(sqrt(rp*rs))-13;
dem = 14.6*(fs-fp)/f;
n = ceil(num/dem);
n1 = n+1;
if (rem(n,2)==50)
n1 = n;
n = n-1;
end
y = hamming(n1);
% low-pass filter
b = fir1(n,wp,y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,1);
plot(o/pi,m);
title('Magnitude Response of LPF');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;
Digital Signal Processing Lab- KEC-553A Page 18
Department Of Electronics and Communication

% high-pass filter
b = fir1(n,wp,'high',y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,2);
plot(o/pi,m);
title('Magnitude Response of HPF');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;
% band pass filter
wn = [wp ws];
b = fir1(n,wn,y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,3);
plot(o/pi,m);
title('Magnitude Response of BPF');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;
% band stop filter
b = fir1(n,wn,'stop',y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,4);
plot(o/pi,m);

title('Magnitude Response of BSF');

ylabel('Gain in dB ---->');
Digital Signal Processing Lab- KEC-553A Page 19
Department Of Electronics and Communication

xlabel('Normalised Frequency ---->');

grid on;

Expected Output :

Program:-
clc;
clear all;
rp = input('Enter the passband ripple = ');
rs = input('Enter the stopband ripple = ');
fp = input('Enter the passband frequency = ');
fs = input('Enter the stopband frequency = ');
f = input('Enter the sampling frequency = ');
wp = 2*fp/f;
ws = 2*fs/f;
num = -20*log10(sqrt(rp*rs))-13;

dem = 14.6*(fs-fp)/f;

n = ceil(num/dem);

Digital Signal Processing Lab- KEC-553A Page 20


Department Of Electronics and Communication

n1 = n+1;
if (rem(n,2)==50)
n1 = n;
n = n-1;
end
y = blackman(n1);
% low-pass filter
b = fir1(n,wp,y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,1);
plot(o/pi,m);
title('Magnitude Response of LPF');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;
% high-pass filter
b = fir1(n,wp,'high',y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,2);
plot(o/pi,m);
title('Magnitude Response of HPF');

ylabel('Gain in dB ---->');

xlabel('Normalised Frequency ---->');

grid on;

Digital Signal Processing Lab- KEC-553A Page 21


Department Of Electronics and Communication

% band pass filter


wn = [wp ws];
b = fir1(n,wn,y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,3);
plot(o/pi,m);
title('Magnitude Response of BPF');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;
% band stop filter
b = fir1(n,wn,'stop',y);
[h,o] = freqz(b,1,256);
m = 20*log10(abs(h));
subplot(2,2,4);
plot(o/pi,m);
title('Magnitude Response of BSF');
ylabel('Gain in dB ---->');
xlabel('Normalised Frequency ---->');
grid on;

Expected Output :-

Digital Signal Processing Lab- KEC-553A Page 22


Department Of Electronics and Communication

Result:-

The hamming and Blackman window functions have been verified for various filters.

Viva Questions:-
1.Define filter.

2. What are the different types of filters?

3. Why are FIR filters generally preferred over IIR filters in multirate (decimating and
interpolating) systems/

4. Difference between IIR and FIR filters?

5. Differentiate ideal filter and practical filter responses.

6. What is the filter specifications required to design the analog filters?

7. What is meant by frequency response of filter?

8. What is meant by magnitude response?

9. What is meant by phase response?

10. Difference between FIR low pass filter and high pass filter.

Digital Signal Processing Lab- KEC-553A Page 23


Department Of Electronics and Communication

EXPERIMENT-5

Objective:-
To find Discrete Fourier Transform and Inverse Discrete Fourier Transform of given digital signal.

Apparatus Required:-
Hardware: Personal Computer
Software : MATLAB

Theory:-

Basic equation to find the DFT of a sequence is given below.

Basic equation to find the IDFT of a sequence is given below.

Algorithm:
Step I: Get the input sequence.

Step II: Find the DFT of the input sequence using direct equation of DFT.

Step III: Find the IDFT using the direct equation.

Step IV: Plot DFT and IDFT of the given sequence using matlab command stem.

Step V: Display the above outputs.

Digital Signal Processing Lab- KEC-553A Page 24


Department Of Electronics and Communication

Procedure:-
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

Program:-

clc;
close all;
clear all;
xn=input('Enter the sequence x(n)'); %Get the sequence from user
ln=length(xn); %find the length of the sequence
xk=zeros(1,ln); %initialize an array of same size as that of input sequence
ixk=zeros(1,ln); %initialize an array of same size as that of input sequence
%DFT of the sequence %-----------------------------------------------------
for k=0:ln-1
for n=0:ln-1
xk(k+1)=xk(k+1)+(xn(n+1)*exp((i)*2*pi*k*n/ln));
end
end
%------------------------------------------------------
%Plotting input sequence
%-----------------------------------------------------
t=0:ln-1;
subplot(221);
stem(t,xn);
ylabel ('Amplitude');
xlabel ('Time Index');
title('Input Sequence');
%---------------------------------------------------------------
magnitude=abs(xk); % Find the magnitudes of individual DFT points
% plot the magnitude response
%------------------------------------------------------------
t=0:ln-1;
subplot(222);
stem(t,magnitude);
ylabel ('Amplitude');
xlabel ('K');
title('Magnitude Response');
%------------------------------------------------------------
phase=angle(xk); % Find the phases of individual DFT points % plot the magnitude sequence
%------------------------------------------------------------
t=0:ln-1; subplot(223);
stem(t,phase);
Digital Signal Processing Lab- KEC-553A Page 25
Department Of Electronics and Communication

ylabel ('Phase');
xlabel ('K');
title ('Phase Response');

%------------------------------------------------------------
%IDFT of the sequence
%-----------------------------------------------------------
for n=0:ln-1
for k=0:ln-1
ixk(n+1)=ixk(n+1)+(xk(k+1)*exp(i*2*pi*k*n/ln));
end
end
ixk=ixk./ln;
%-----------------------------------------------------------
- %code block to plot the input sequence
%------------------------------------------------------------
t=0:ln-1;
subplot(224);
stem(t,ixk);
ylabel ('Amplitude');
xlabel ('Time Index');
title ('IDFT sequence'); %------------------------------------------------------

Output: -

X(n)=[1 2 3 4 5]
X(k) = 15,-2.50+3.44i,-2.50+0.81i,-2.49-0.81i,-2.49-3.44i

Output Waveform:-

Result :

DFT and IDFT of given sequence is implemented and waveforms are plotted.
Digital Signal Processing Lab- KEC-553A Page 26
Department Of Electronics and Communication

Viva Questions:-

1:- What is the advantage of calculating circular convolution using DFT and IDFT

Ans:- 1. DFT and IDFT can be efficiently calculated using FFT algorithms.
2. Frequency domain analysis of the signal can also be performed simultaneously.

2:- Which method do you prefer for calculation of circular convolution?

Ans:- It is better to implement circular convolution using DFT & IDFT.

3:- What are the applications of circular convolution?

Ans:-1. Linear filtering.


2. Spectrum analysis.
3. Speech processing

4:-What are advantages of using DFT for long duration sequences?

Ans:- 1. Long duration sequences are filtered using overlap save method and overlap add
method.
2. DFT is implemented using FFT algorithms, which is computationally efficient.

5:-State applications of DFT.


Ans:- 1. Spectrum analysis.
2. Linear filtering.
3. Radar signal Processing.
4. Speech signal processing.

Digital Signal Processing Lab- KEC-553A Page 27


Department Of Electronics and Communication

EXPERIMENT-6

Objective:-
Verify Linear Convolution using code composer studio

Apparatus Required:-
HARDWARE : Personal Computer & TMS320C6713 kit
SOFTWARE : Code Composer Studio

Theory :-
Linear convoluted sequence y(n) between x(n) with duration N1and h(n) with duration N2 is
defined as

Where N = N1+N2 –1 is the duration of convoluted sequence y(n).

DFT does not support linear convolution, because of x(n) and h(n) are of different durations.
That’s why we can go for circular convolution.

Procedure:
1. Open Code Composer Studio.
2. To create the New Project
File->New->CCS Project
3. To create a Source file
a) A new project dialog box will appear. Fill in the following settings:

i) Target: TMS320C6713

ii) Connection: Spectrum Digital DSK-EVM-eZdsp onboard USB Emulator

iii) Project Name: Your desired project name

4. To Add Library to Project

4.1) Show Build Settings>CCS Build->C6000 Linker->File Search Path

4.2) select the paper icon with the green plus

Digital Signal Processing Lab- KEC-553A Page 28


Department Of Electronics and Communication

4.3) Type in dsk6713bsl.lib and select OK

4.4) Repeat Step 4.2 to add another library named csl6713.lib

5. Repeat Step 4 for the Release configuration by selecting the combo box at the top and
changing it from Debug to Release
6. TargetConfigs>TMS320C6713.ccxml>TMS320671X>initialization script> Add gel
file(DSK6713.gel)

Compile:-

1. To Compile: Project_ Compile


2. To Rebuild: project _ rebuild,
Which will create the final .out executable file. ( Eg. vvit.out).
3. Procedure to Lode and Run program:
Load the Program to DSK: File_ Load program _vvit.out
To Execute project: Debug _ Run

Program:-
#define CHIP_6713

#include<stdio.h>
#include"dsk6713.h"
#include"dsk6713_led.h"
#include<math.h>
int m=4;
int n=4;
int i=0,j;
int x[10]={1,2,3,4};
int h[10]={1,2,3,4};
int y[20];
main()
{
int i;
for(i=0;i<m+n-1;i++)
{
y[i]=0;
for(j=0;j<=i;j++)
y[i]+=x[j]*h[i-j];
}
for(i=0;i<m+n-1;i++)
printf(“%d\n”,y[i]);
}
OUTPUT:
1.0 4.000000 10.000000 20.000000 25.000000 24.000000 16.000000

Digital Signal Processing Lab- KEC-553A Page 29


Department Of Electronics and Communication

Result :-
Linear convolution of the sequence is found and the code is implemented on
the DSP processor to verify the results.

Viva Questions:

1 .Explain the significance of convolution.

2. Define linear convolution.

3. Why linear convolution is called as a periodic convolution?

4. Why zero padding is used in linear convolution?

5. What are the four steps to find linear convolution?

Digital Signal Processing Lab- KEC-553A Page 30


Department Of Electronics and Communication

EXPERIMENT-7

Objective:-
Verify Circular Convolution using code composer studio

Apparatus Required:-
HARDWARE : Personal Computer & TMS320C6713 kit
SOFTWARE : Code Composer Studio

Theory:-
Convolution is a special operation, operated between two signals and which includes
the following operations.
1. Folding.
2. Shifting.
3. Multiplication.
4. Addition
Convolution sum is useful to obtain the response of discrete LTI system with input
x(n) and impulse response h(n).

In circular convolution the length of both input sequences must be same.

Procedure:
1. Open Code Composer Studio.
2. To create the New Project
File->New->CCS Project
3. To create a Source file
a) A new project dialog box will appear. Fill in the following settings:

i) Target: TMS320C6713

ii) Connection: Spectrum Digital DSK-EVM-eZdsp onboard USB Emulator

iii) Project Name: Your desired project name

4. To Add Library to Project

4.1) Show Build Settings>CCS Build->C6000 Linker->File Search Path

4.2) select the paper icon with the green plus

4.3) Type in dsk6713bsl.lib and select OK

4.4) Repeat Step 4.2 to add another library named csl6713.lib

Digital Signal Processing Lab- KEC-553A Page 31


Department Of Electronics and Communication

5. Repeat Step 4 for the Release configuration by selecting the combo box at the top and
changing it from Debug to Release
6. TargetConfigs>TMS320C6713.ccxml>TMS320671X>initialization script> Add gel
file(DSK6713.gel)

Compile:-
1. To Compile: Project_ Compile
2. To Rebuild: project _ rebuild,
Which will create the final .out executable file. ( Eg. vvit.out).
3. Procedure to Load and Run program:
Load the Program to DSK: File_ Load program _vvit.out
To Execute project: Debug _ Run

Program :
#define CHIP_6713

#include<stdio.h>
#include"dsk6713.h"
#include"dsk6713_led.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 1st sequence\n");
scanf("%d",&m);
printf("enter the length of the second sequence\n");
scanf("%d",&n);
printf("enter the 1st 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(m>n)
{
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];

Digital Signal Processing Lab- KEC-553A Page 32


Department Of Electronics and Communication

for(j=1;j<n;j++)
a[j]=h[n-j];
for(i=0;i<n;i++)
y[0]+=x[i]*a[i];
for(k=1;k<n;k++)
{
y[k]=0;
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];
}
}
printf("the circular convolution is\n");
for(i=0;i<n;i++)
printf("%d\t",y[i]);

Input:

(Circular Convolution)
Enter the length of the 1st sequence 5
Enter the length of the second sequence 5
Enter the 1st sequence 1 2 3 4 5
Enter the second sequence 1 2 3 4 5

Output:

The circular convolution is


45 50 50 45 35

Digital Signal Processing Lab- KEC-553A Page 33


Department Of Electronics and Communication

Result:
Thus the C- Program for Circular convolution was written and the output was
verified.

Viva Questions :

1. What do you mean by aliasing in circular convolution?

Ans: In circular convolution if value of N < L+M-1 then last M-1 values of y[n] wraps
around gets added with first M-1 values of y[n]. This is called aliasing.

2. What is the difference between circular convolution and periodic convolution?

Ans: In periodic convolution input signals are originally periodic with common value of
period. In circular convolution, if input signals are not periodic then they are assumed to be
periodic with period = N where N = max (L, M) where L is the length of first signal and M is
length of second signal.

3. Why circular convolution is important in DSP?


Ans: The Discrete Fourier Transform (DFT) is used for the analysis and design of discrete
time systems using digital computers. The DFT supports only circular convolution. Hence
Digital Signal Processing Lab- KEC-553A Page 34
Department Of Electronics and Communication

when DFT techniques are employed, the results of linear convolution are obtained only via
circular convolution.

4. How to perform linear convolution using circular convolution?


Ans: If two signals x (n) and y (n) are of length n1 and n2, then the linear convoluted
output z (n) is of length n1+n2-1. Each of the input signals is padded with zeros to make it
of length n1+n2-1. Then circular convolution is done on zero padded sequences to get
the linear convolution of original input sequences x (n) and y (n)z.

Digital Signal Processing Lab- KEC-553A Page 35


Department Of Electronics and Communication

EXPERIMENT-8

Objective: -
To verify FFT as sample interpolator.

Apparatus Required:-

1. Hardware: Personal Computer


2. Software : MATLAB

Theory:-
“Upsampling” is the process of inserting zero-valued samples between original samples to
increase the sampling rate. (This is called “zero-stuffing”.) “Interpolation”, is the process of
upsampling followed by filtering. The filtering removes the undesired spectral images. The
primary reason to interpolate is simply to increase the sampling rate at the output of one system
so that another system operating at a higher sampling rate can input the signal.

Procedure:-
1. Start the MATLAB program.
2. Open new M-file
3. Type the program
4. .Save in current directory
5. Compile and Run the program
6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

Digital Signal Processing Lab- KEC-553A Page 36


Department Of Electronics and Communication

Program: -
clc; clear all;
close all;

dx=3*pi/30; x=0:dx:3*pi;
f=sin(x).^2.*cos(x);

subplot(2,1,1) plot(x,f,'o')
title('input function');
xlabel('time(n)');
ylabel('Amplitude');

N=300;

y=interpft(f,N);

dy=dx*length(x)/N;
x2=0:dy:3*pi;
y=y(1:length(x2));

subplot(2,1,2)
plot(x2,y,'*');

title('FFT interpolation of FFT function'); xlabel('time(n)');

ylabel('Amplitude');

Expected Output :-

Digital Signal Processing Lab- KEC-553A Page 37


Department Of Electronics and Communication

Result:
FFT has been verified as sample interpolator,

Digital Signal Processing Lab- KEC-553A Page 38


Department Of Electronics and Communication

EXPERIMENT-9

Objective: -
To implement Tone Generation./ Generation of DTMF Signal

Apparatus Required:-
Hardware: Personal Computer
Software : MATLAB

Theory:-
The DTMF stands for “Dual Tone Multi Frequency”, and is a method of representing
digits with tone frequencies, in order to transmit them over an analog communications
network, for example a telephone line. In telephone networks, DTMF signals are used to
encode dial trains and other information. Dual-tone Multi-Frequency (DTMF) signaling is
the basis for voice communications control and is widely used worldwide in modern
telephony to dial numbers and configure switchboards. It is also used in systems such as in
voice mail, electronic mail and telephone banking. A DTMF signal consists of the sum of
two sinusoids - or tones - with frequencies taken from two mutually exclusive groups.
These frequencies were chosen to prevent any harmonics from being incorrectly detected
by the receiver as some other DTMF frequency. Each pair of tones contains one frequency
of the low group (697 Hz, 770 Hz, 852 Hz, 941 Hz) and one frequency of the high group
(1209 Hz, 1336 Hz, 1477Hz) and represents a unique symbol.

Procedure:-

1. Start the MATLAB program.


2. Open new M-file
3. Type the program
4. Save in current directory
5. Compile and Run the program
Department Of Electronics and Communication

6. If any error occurs in the program correct the error and run it again
7. For the output see command window\ Figure window
8. Stop the program.

Program:-
Clc;
Clear all;
Close all;
t = -2:0.05:2;
x=input('enter the input number');
fr1=697;
fr2=770;
fr3=852;
fr4=941;
fc1=1209;
fc2=1336;
fc3=1477;
fc4=1633;
y0 = sin(2*pi*fr4*t) + sin(2*pi*fc2*t); % 0
y1 = sin(2*pi*fr1*t) + sin(2*pi*fc1*t); % 1
y2 = sin(2*pi*fr1*t) + sin(2*pi*fc2*t); % 2
y3 = sin(2*pi*fr1*t) + sin(2*pi*fc3*t); % 3
y4 = sin(2*pi*fr2*t) + sin(2*pi*fc1*t); % 4
y5 = sin(2*pi*fr2*t) + sin(2*pi*fc2*t); % 5
y6 = sin(2*pi*fr2*t) + sin(2*pi*fc3*t); % 6
y7 = sin(2*pi*fr3*t) + sin(2*pi*fc1*t); % 7
y8 = sin(2*pi*fr3*t) + sin(2*pi*fc2*t); % 8
y9 = sin(2*pi*fr3*t) + sin(2*pi*fc3*t); % 9
y_start = sin(2*pi*fr4*t) + sin(2*pi*fc1*t); % *
y_canc = sin(2*pi*fr4*t) + sin(2*pi*fc3*t); % #

Digital Signal Processing Lab- KEC-553A Page 40


Department Of Electronics and Communication

if (x==1)
plot(t,y1)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==2) plot(t,y2)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==3)
plot(t,y3)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==4)
plot(t,y4)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==5)
plot(t,y5)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==6)
plot(t,y6)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==7)
plot(t,y7)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==8)
plot(t,y8)

Digital Signal Processing Lab- KEC-553A Page 41


Department Of Electronics and Communication

xlabel('time(t)')
ylabel('amplitude')
elseif (x==9)
plot(t,y9)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==0)
plot(t,y0)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==11)
plot(t,y_start)
xlabel('time(t)')
ylabel('amplitude')
elseif (x==12)
plot(t,y_canc)
xlabel('time(t)')
ylabel('amplitude')
else disp('enter the correct input')
end

Input:
Enter the input number = 7

Digital Signal Processing Lab- KEC-553A Page 42


Department Of Electronics and Communication

Output:

Result :
DTMF generation is completed and output is observed.

Viva Questions: -
1. Expand DTMF?

2. Define frequency groups for all symbols?

3. Define DTMF?

4. Give the applications of DTMF?

5. Define low frequency group and high frequency group?

Digital Signal Processing Lab- KEC-553A Page 43


Department Of Electronics and Communication

EXPERIMENT-10

Objective: -
To implement floating point arithmetic

Apparatus Required:-
HARDWARE : Personal Computer & TMS320C6713 kit
SOFTWARE : Code Composer Studio

Theory:

In computing, floating-point arithmetic (FP) is arithmetic using formulaic representation


of real numbers as an approximation so as to support a trade-off between range
and precision. For this reason, floating-point computation is often found in systems which
include very small and very large real numbers, which require fast processing times. A
number is, in general, represented approximately to a fixed number of significant
digits (the significand) and scaled using an exponent in some fixed base; the base for the
scaling is normally two, ten, or sixteen. A number that can be represented exactly is of the
following form:

The term floating point refers to the fact that a number's radix point (decimal point, or,
more commonly in computers, binary point) can "float"; that is, it can be placed anywhere
relative to the significant digits of the number. This position is indicated as the exponent
component, and thus the floating-point representation can be thought of as a kind
of scientific notation.

We will implement the code for floating point multiplication of two numbers.

Digital Signal Processing Lab- KEC-553A Page 44


Department Of Electronics and Communication

Procedure:
1. Open Code Composer Studio.
2. To create the New Project
File->New->CCS Project
3. To create a Source file
a) A new project dialog box will appear. Fill in the following settings:

i) Target: TMS320C6713

ii) Connection: Spectrum Digital DSK-EVM-eZdsp onboard USB


Emulator

iii) Project Name: Your desired project name

4. To Add Library to Project

4.1) Show Build Settings>CCS Build->C6000 Linker->File Search Path

4.2) select the paper icon with the green plus

4.3) Type in dsk6713bsl.lib and select OK

4.4) Repeat Step 4.2 to add another library named csl6713.lib

5. Repeat Step 4 for the Release configuration by selecting the combo box at the top and
changing it from Debug to Release
6. TargetConfigs>TMS320C6713.ccxml>TMS320671X>initialization script> Add gel
file(DSK6713.gel)

Compile:-

1. To Compile: Project_ Compile


2. To Rebuild: project _ rebuild,
Which will create the final .out executable file. ( Eg. vvit.out).
3. Procedure to Lode and Run program:
Load the Program to DSK: File_ Load program _vvit.out
To Execute project: Debug _ Run

Program:-

// C program to multiply two floating point numbers


#define CHIP_6713

#include<stdio.h>
#include"dsk6713.h"
#include"dsk6713_led.h"

Digital Signal Processing Lab- KEC-553A Page 45


Department Of Electronics and Communication

int main()
{
float A, B, product = 0.0f;

// Ask user to enter the two numbers


printf("Enter two floating numbers A and B : \n");

// Read two numbers from the user || A = 2.12, B = 3.88


scanf("%f%f", &A, &B);

// Calclulate the multiplication of A and B


// using '*' operator
product = A * B;

// Print the product


printf("Product of A and B is: %f", product);

return 0;
}

Output:

Enter two floating numbers A and B: 2.12 3.88


Product of A and B is: 8.225600

Digital Signal Processing Lab- KEC-553A Page 46


Department Of Electronics and Communication

EXPERIMENT - 11
Objective:-

To study about DSP Processors and architecture of TMS320C6713 DSP processor

Introduction:

The hardware experiments in the DSP lab are carried out on the Texas Instruments
TMS320C6713 DSP Starter Kit (DSK), based on the TMS320C6713 floating point DSP
running at 225MHz. The basic clock cycle instruction time is 1/(225 MHz)= 4.44
nanoseconds. During each clock cycle, up to eight instructions can be carried out in
parallel, achieving up to 8×225 = 1800 million instructions per second (MIPS). The DSK
board includes a 16MB SDRAM memory and a 512KB Flash ROM. It has an on-board
16-bit audio stereo codec (the Texas Instruments AIC23B) that serves both as an A/D and
a D/A converter. There are four 3.5 mm audio jacks for microphone and stereo line input,
and speaker and headphone outputs. The AIC23 codec can be programmed to sample
audio inputs at the following sampling rates: fs = 8, 16, 24, 32, 44.1, 48, 96 kHz.

The ADC part of the codec is implemented as a multi-bit third-order noise-shaping delta-
sigma converter) that allows a variety of oversampling ratios that can realize the above
choices of fs. The corresponding oversampling decimation filters act as anti-aliasing
prefilters that limit the spectrum of the input analog signals effectively to the Nyquist
interval [−fs/2,fs/2]. The DAC part is similarly implemented as a multi-bit second-order
noiseshaping delta-sigma converter whose oversampling interpolation filters act as almost
ideal reconstruction filters with the Nyquist interval as their pass band.

The DSK also has four user-programmable DIP switches and four LEDs that can be used
to control and monitor programs running on the DSP. All features of the DSK are managed
by the Code Composer Studio (CCS). The CCS is a complete integrated development
environment (IDE) that includes an optimizing C/C++ compiler, assembler, linker,
debugger, and program loader. The CCS communicates with the DSK via a USB
connection to a PC. In addition to facilitating all programming aspects of the C6713 DSP,
the CCS can also read signals stored on the DSP‟s memory, or the SDRAM, and plot them
in the time or frequency domains. The following block diagram depicts the overall
operations involved in all of the hardware experiments in the DSP lab. Processing is
interrupt-driven at the sampling rate fs, as explained below.

Digital Signal Processing Lab- KEC-553A Page 47


Department Of Electronics and Communication

Architecture:-
The 67XX DSPs use an advanced, modified Harvard architecture that maximizes
processing power by maintaining one program memory bus and three data memory buses.
These processors also provide an arithmetic logic unit (ALU) that has a high degree of
parallelism, application-specific hardware logic, on-chip memory, and additional on-chip
peripherals. These DSP families also provide a highly specialized instruction set, which is
the basis of the operational flexibility and speed of these DSPs. Separate program and data
spaces allow simultaneous access to program instructions and data, providing the high
degree of parallelism. Two reads and one write operation can be performed in a single
cycle. Instructions with parallel store and application-specific instructions can fully utilize
this architecture. In addition, data can be transferred between data and program spaces.
Such parallelism supports a powerful set of arithmetic, logic, and bit-manipulation
operations that can all be performed in a single machine cycle. Also included are the
control mechanisms to manage interrupts, repeated operations, and function calls.

Digital Signal Processing Lab- KEC-553A Page 48


Department Of Electronics and Communication

1. Central Processing Unit (CPU): The CPU of the ‟67XX devices contains:

• A 40-bit arithmetic logic unit (ALU)

• Two 40-bit accumulators • A barrel shifter

• A 17 -bit multiplier/adder

• A compare, select, and store unit (CSSU)

2. Arithmetic Logic Unit (ALU):The ‟67XX devices perform 2s-complement arithmetic


using a 40-bit ALU and two 40-bit accumulators (ACCA and ACCB). The ALU also can
perform Boolean operations. The ALU can function as two 16-bit ALUs and perform two
16- bit operations simultaneously when the C16 bit in status register 1 (ST1) is set.

3. Accumulators: The accumulators, ACCA and ACCB, store the output from the ALU or
the multiplier / adder block; the accumulators can also provide a second input to the ALU
or the multiplier / adder. The bits in each accumulator are grouped as: Guard bits (bits 32–
39) , A high-order word (bits 16–31) , A low-order word (bits 0–15) .

4. Barrel Shifter: The ‟67XX‟s barrel shifter has a 40-bit input connected to the
accumulator or data memory (CB, DB) and a 40-bit output connected to the ALU or data
memory (EB). The barrel shifter produces a left shift of 0 to 31 bits and a right shift of 0 to
16 bits on the input data. The shift requirements are defined in the shift-count field (ASM)
of ST1 or defined in the temporary register (TREG), which is designated as a shift-count

Digital Signal Processing Lab- KEC-553A Page 49


Department Of Electronics and Communication

register. This shifter and the exponent detector normalize the values in an accumulator in a
single cycle. The least significant bits (LSBs) of the output are filled with 0s and the most
significant bits (MSBs) can be either zero-filled or sign extended, depending on the state of
the sign-extended mode bit (SXM) of ST1.

5. Multiplier/Adder: The multiplier / adder perform 17-bit 2s-complement multiplication


with a 40- bit accumulation in a single instruction cycle. The multiplier / adder block
consists of several elements: a multiplier, adder, signed/unsigned input control, fractional
control, a zero detector, a rounder (2s-complement), overflow/saturation logic, and TREG.
The multiplier has two inputs: one input is selected from the TREG, a data memory
operand, or an accumulator; the other is selected from the program memory, the data
memory, an accumulator, or an immediate value. The fast on-chip multiplier allows the
C67XX to perform operations such as convolution, correlation, and filtering efficiently. In
addition, the multiplier and ALU together execute multiply/accumulate (MAC)
computations and ALU operations in parallel in a single instruction cycle. This function is
used in determining the Euclid distance, and in implementing symmetrical and least mean
square (LMS) filters, which are required for complex DSP algorithms.

6. Compare, Select, and Store Unit (CSSU) The compare, select, and store unit (CSSU)
performs maximum comparisons between the accumulator’s high and low words, allows
the test/control (TC) flag bit of status register 0 (ST0) and the transition (TRN) register to
keep their transition histories, and selects the larger word in the accumulator to be stored in
data memory. The CSSU also accelerates Viterbi-type butterfly computation with
optimized on-chip hardware.

7. Program Control: Program control is provided by several hardware and software


mechanisms: The program controller decodes instructions, manages the pipeline, stores the
status of operations, and decodes conditional operations. Some of the hardware elements
included in the program controller are the program counter, the status and control register,
the stack, and the address-generation logic. Some of the software mechanisms used for
program control includes branches, calls, and conditional instructions, are peat instruction,
reset, and interrupt.

8. Status Registers (ST0, ST1): The status registers, ST0 and ST1, contain the status of the
various conditions and modes for the ‟67XX devices. ST0 contains the flags (OV, C, and
TC) produced by arithmetic operations and bit manipulations in addition to the data page
pointer (DP) and the auxiliary register pointer (ARP) fields. ST1 contains the various
modes and instructions that the processor operates on and executes.

9. Auxiliary Registers (AR0–AR7): The eight 16-bit auxiliary registers (AR0–AR7) can be
accessed by the central arithmetic logic unit (CALU) and modified by the auxiliary register
arithmetic units (ARAUs). The primary function of the auxiliary registers is generating 16-
bit addresses for data space. However, these registers also can act as general-purpose
registers or counters.

Digital Signal Processing Lab- KEC-553A Page 50


Department Of Electronics and Communication

10. Temporary Register (TREG): The TREG is used to hold one of the multiplicands for
multiply and multiply/accumulate instructions. It can hold a dynamic (execution-time
programmable) shift count for instructions with a shift operation such as ADD, LD, and
SUB. It also can hold a dynamic bit address for the BITT instruction. The EXP instruction
stores the exponent value computed into the TREG, while the NORM instruction uses the
TREG value to normalize the number. For ACS operation of Viterbi decoding, TREG
holds branch metrics used by the DADST and DSADT instructions.

11. Transition Register (TRN): The TRN is a 16-bit register that is used to hold the
transition decision for the path to new metrics to perform the Viterbi algorithm. The CMPS
(compare, select, max, and store) instruction updates the contents of the TRN based on the
comparison between the accumulator high word and the accumulator low word.

12. Stack-Pointer Register (SP): The SP is a 16-bit register that contains the address at the
top of the system stack. The SP always points to the last element pushed onto the stack.
The stack is manipulated by interrupts, traps, calls, returns, and the PUSHD, PSHM,
POPD, and POPM instructions. Pushes and pops of the stack pre decrement and post
increment, respectively, all 16 bits of the SP.

13. Circular-Buffer-Size Register (BK): The 16-bit BK is used by the ARAUs in circular
addressing to specify the data block size.

14. Block-Repeat Registers (BRC, RSA, REA): The block-repeat counter (BRC) is a 16-
bit register used to specify the number of times a block of code is to be repeated when
performing a block repeat. The block repeat start address (RSA) is a 16-bit register
containing the starting address of the block of program memory to be repeated when
operating in the repeat mode. The 16- bit block-repeat end address (REA) contains the
ending address if the block of program memory is to be repeated when operating in the
repeat mode.

15. Interrupt Registers: (IMR, IFR) The interrupt-mask register (IMR) is used to mask off
specific interrupts individually at required times. The interrupt-flag register (IFR) indicates
the current status of the interrupts.

16. Processor-Mode Status Register (PMST): The processor-mode status registers (PMST)
controls memory configurations of the 67XX devices.

17. Power-Down Modes There are three power-down modes, activated by the IDLE1,
IDLE2, and IDLE3 instructions. In these modes, the ‟67XX devices enter a dormant state
and dissipate considerably less power than in normal operation. The IDLE1instruction is
used to shut down the CPU. The IDLE2 instruction is used to shut down the CPU and on-
chip peripherals. The IDLE3 instruction is used to shut down the ‟67XX processor
completely. This instruction stops the PLL circuitry as well as the CPU and peripherals.

Digital Signal Processing Lab- KEC-553A Page 51


Department Of Electronics and Communication

Result:
Thus the study of architecture TMS320VC6713 and its functionalities has been identified.

Viva Questions:

1 .What is the clock frequency of TMS320C6713 DSP processor?

Ans: 225 MHz.

2. What is the function of circular buffer size register?

Ans : The 16-bit BK is used by the ARAUs in circular addressing to specify the data
block size.

3. What is the significance of status registers?

Ans: : The status registers, ST0 and ST1, contain the status of the various conditions
and modes for the ‟67XX device.

Digital Signal Processing Lab- KEC-553A Page 52


Department Of Electronics and Communication

EXPERIMENTS BEYOND
SYLLABUS

Digital Signal Processing Lab- KEC-553A Page 53


Department Of Electronics and Communication

EXPERIMENT- 1

Objective-
Generate Frequency Modulation having carrier frequency 1Khz and modulating frequency
200 Hz with the modulating index of 0.7.

Apparatus Required:-
Hardware: Personal Computer
Software : MATLAB

Program:-

clc;

clear all;

close all;

fm=input('Message Frequency=');

fc=input('Carrier Frequency=');

mi=input('Modulation Index=');

t=0:0.0001:0.1;

m=sin(2*pi*fm*t);

subplot(3,1,1);

plot(t,m);

xlabel('Time');

ylabel('Amplitude');

title('Message Signal');

grid on;

c=sin(2*pi*fc*t);

subplot(3,1,2);
Digital Signal Processing Lab- KEC-553A Page 54
Department Of Electronics and Communication

plot(t,c);

xlabel('Time');

ylabel('Amplitude');

title('Carrier Signal');

grid on;

y=sin(2*pi*fc*t+(mi.*sin(2*pi*fm*t)));%Frequency changing w.r.t Message

subplot(3,1,3);

plot(t,y);

xlabel('Time');

ylabel('Amplitude');

title('FM Signal');

grid on;

Output Waveform:

Digital Signal Processing Lab- KEC-553A Page 55


Department Of Electronics and Communication

Result:
Frequency modulated wave has been generated, waveform is observed.

Digital Signal Processing Lab- KEC-553A Page 56


Department Of Electronics and Communication

EXPERIMENT- 2
Objective :-
Generate a FSK wave form for transmitting the digital data of the given bit sequence.

Apparatus Required:-
Hardware: Personal Computer
Software : MATLAB

Program:-
clear all;
close all;

fc1=40;
fc2=20;
g=[1 1 0 0 1 1 1 0 1 0 0 0 1];%modulante
n=1;

while n<=length(g)
if g(n)==0
tx=((n-1)*0.1:.1/100:n*.1);
p=(1)*sin(2*pi*fc2*tx);
plot(tx,p);
hold on;
else
tx=((n-1)*0.1:.1/100:n*.1);
p=(1)*sin(2*pi*fc1*tx);
plot(tx,p);
hold on;
end

Digital Signal Processing Lab- KEC-553A Page 57


Department Of Electronics and Communication

n=n+1;
end

Output Waveform:-

Result:
FSK wave has been generated, waveform is observed.

Digital Signal Processing Lab- KEC-553A Page 58


Department Of Electronics and Communication

EXPERIMENT- 3

Objective :-
Generate a PSK wave form for transmitting the digital data of the given bit sequence.

Apparatus Required:-
Hardware: Personal Computer
Software : MATLAB

Program:-

clear all;
close all;
clc;
fc1=40;

g=[1 1 0 0 1 0]
n=1;
while n<=length(g)
if g(n)==0
tx=((n-1)*.1:.1/100:n*.1)
p=sin(pi+2*pi*fc1*tx)
plot(tx,p);
hold on;
else
tx=((n-1)*.1:.1/100:n*.1);
p=sin(2*pi*fc1*tx)
plot(tx,p)
hold on;
end

Digital Signal Processing Lab- KEC-553A Page 59


Department Of Electronics and Communication

n=n+1;
end

Output Waveform:-

PSK Waveform

Result:
PSK wave has been generated, waveform is observed.

Digital Signal Processing Lab- KEC-553A Page 60


Department Of Electronics and Communication

EXPERIMENT- 4
OBJECTIVE
Blinking of On Board LED (TMS320C6713)

Apparatus Required:-
HARDWARE : Personal Computer & TMS320C6713 kit
SOFTWARE : Code Composer Studio

Procedure:
1. Open Code Composer Studio.
2. To create the New Project
File->New->CCS Project
3. To create a Source file
a) A new project dialog box will appear. Fill in the following settings:

i) Target: TMS320C6713

ii) Connection: Spectrum Digital DSK-EVM-eZdsp onboard USB


Emulator

iii) Project Name: Your desired project name

4. To Add Library to Project

4.1) Show Build Settings>CCS Build->C6000 Linker->File Search Path

4.2) select the paper icon with the green plus

4.3) Type in dsk6713bsl.lib and select OK

4.4) Repeat Step 4.2 to add another library named csl6713.lib

5. Repeat Step 4 for the Release configuration by selecting the combo box at the top and
changing it from Debug to Release
6. TargetConfigs>TMS320C6713.ccxml>TMS320671X>initialization script> Add gel
file(DSK6713.gel)

Compile:-

1. To Compile: Project_ Compile


2. To Rebuild: project _ rebuild,
Which will create the final .out executable file. ( Eg. vvit.out).
3. Procedure to Lode and Run program:
Load the Program to DSK: File_ Load program _vvit.out
Department Of Electronics and Communication

To Execute project: Debug _ Run

Program:-

#define CHIP_6713
#include "dsk6713.h"
#include "dsk6713_led.h"
Void main(void)
{
DSk6713_init();
DSK6713_LED_init();
While(1)
{
DSK6713_LED_toggle(1);
DSK6713_waitusec(1000000);
}
}

Result:
Blinking of LED observed.

Digital Signal Processing Lab- KEC-553A Page 62

You might also like