15UEC727 - Master Record-1

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 70

SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

SETHU INSTITUTE OF TECHNOLOGY


(An Autonomous Institution| Accredited with ‘A’ Grade by
NAAC)
PULLOOR, KARIAPATTI – 626 115.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

15UEC727- SIGNAL PROCESSING LABORATORY (R-2015)

MASTER RECORD

IV YEAR EEE- VII SEMESTER

PREPARED BY

Mr.B.Muthupandian

Mrs.G.Ramu Priya
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

Institute Vision To promote excellence in technical education and scientific research for

the benefit of the society

Institute Mission  To provide quality technical education to fulfill the aspiration of

the student and to meet the needs of the Industry

 To provide holistic learning ambience

 To impart skills leading to employability and entrepreneurship

 To establish effective linkage with industries

 To promote Research and Development activities

 To offer services for the development of society through

education and technology

Core Values

 Quality

 Commitment

 Innovation

 Team work

 Courtesy
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

B.E. ELECTRICAL AND ELECTRONICS


PROGRAMME
ENGINEERING
Department Vision
To achieve Excellence in Education and Research in the field
of Electrical and Electronics Engineering and provide
knowledge based contribution for the development of
economy and society

Department Mission
 To provide quality technical education to fulfill the
aspiration of the student and to meet the needs of the
industry.
 To provide holistic learning ambience.
 To impart skills leading to employability and
entrepreneurship.
 To establish effective linkage with industries.
 To promote research and development activities.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

PROGRAMME EDUCATIONAL OBJECTIVES

Exhibit technical competency in Electrical and Electronics Engineering


PEO – I
and related fields (Core Competency)

Engage in life-long learning for professional development and research


PEO – II (Life Long Learning)

Exhibit effective communication skills, team work and lead their


profession with ethics
PEO – III
(Professional and Ethical Skills)

PROGRAMME OUTCOMES

Apply knowledge of Mathematics, Science, Engineering fundamentals to solve


1 complex Electronics and Communication Engineering problems. (Engineering
knowledge)

Identify, formulate and analyze complex Electronics and Communication


2 Engineering problems to achieve demonstrated conclusions using mathematical
principles and engineering sciences. (Problem Analysis)

Design solutions for complex engineering problems in the areas of VLSI and
3 Communication systems. (Design and Development of Solutions)

Conduct investigation of complex problems in the areas of VLSI and


4 Communication systems and provide valid conclusions. (Investigation of
Complex Problems)

Select and apply appropriate techniques and modern engineering tools for the
5 design of VLSI and communication systems. (Modern Engineering Tools)

Apply reasoning with appropriate knowledge to assess societal, health, safety,


6 legal and cultural issues and the consequent responsibilities relevant to
Electronics and Communication engineering practice. (Engineer and Society)

Examine the impact of Electronics and Communication engineering solutions in


7 societal and environmental contexts and utilize the knowledge for sustained
development. (Environment and Sustainability)

8 Apply ethical principles and commit to professional ethics and responsibilities as


SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

professionals in the field of engineering (Ethics)

Perform effectively as an individual and as a member or leader in


9 multidisciplinary teams. (Individual and Team Work)

Communicate on engineering activities with the engineering community and with


10 society at large through effective documentation, presentation and give and
receive clear instructions (Communication)
Apply project management techniques and financial management concepts to
11 manage multidisciplinary projects. (Project Management and Finance)

Recognize the need for and have the preparation and ability to engage in
independent and life-long learning to follow developments in Electronics and
12
Communication Engineering. (Life-long learning)

PROGRAMME SPECIFIC OUTCOMES

Demonstrate technical competency in the design and analysis of electrical machines.


PSO – I

PSO – II Design and analyze power electronic interfaces for renewable energy systems.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

15UEC727- SIGNAL PROCESSING LABORATORY 0 0 3 2

AIM
To introduce the student to various Digital Signal Processing techniques using TMS 320c5x family
processors and MATLAB.

OBJECTIVES:
 To implement the processing techniques using the instructions of TMS320C5X/TMS320C
67XX/ADSP 218X/219X/BS531/532/561
 To implement the IIR and FIR filter using MATLAB.

EXPERIMENTS USING TMS320C5416


1. Study of various addressing modes of DSP using simple
programming examples.
2. Sampling of input signal and display.
3. Implementation of FIR filter
4. Calculation of FFT
EXPERIMENTS USING MATLAB
5. Generation of Signals
6. Linear and circular convolution of two sequences
7. Sampling and effect of aliasing
8. Design of FIR filters
9. Design of IIR filters
10. Calculation of FFT of a signal

COURSE OUTCOMES:
After successful completion of this course, the Students will be able to:

 Program digital signal processing algorithms using simulation software


 Use simulation software tool to analyze discrete system and design digital filters
 Implement signal processing algorithms in digital signal processor
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

LIST OF EXPERIMENTS

CYCLE-I
EXPERIMENTS USING MATLAB
1.Generation of Signals
2.Linear and circular convolution of two sequences
3.Sampling and effect of aliasing
4.Design of FIR filters
5.Design of IIR filters
6.Calculation of FFT of a signal
.

CYCLE-II
EXPERIMENTS USING TMS320C5416

1.Study of various addressing modes of DSP using simple programming examples.


2.Sampling of input signal and display.
3.Implementation of FIR filter
4.Calculation of FFT.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX.NO.1. GENERATION OF DISCRETE TIME SIGNALS

OBJECTIVE:

To write a MATLAB program to generate some discrete time signals such as


a) Unit step
b) Unit ramp
c) Unit Impulse
d) Exponential signal
e) Sinusoidal signal
f) Cosine signal

EQUIPMENTS AND ACCESSORIES REQUIRED:


MATLAB 7.8

ALGORITHM:

1. Generate the desired signal using suitable MATLAB functions.


2. Plot the signal
3. Specify the label to the axes.
4. Give titles to all the signals.

PROGRAM:
a) Create a unit step input which satisfies the below equation
u(n)=1; n>=0
=0; n<0
(N=Number of sequences=10)
clc;
clear all;
close all;
N=input('Enter the Value of N');
t=-N:1:N;
u=[zeros(1,N),ones(1,N+1)];
figure(1);
subplot(2,2,1);
stem(t,u);
xlabel('n----->');
ylabel('Amplitude----->');
title('UNIT STEP SEQUENCE');
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

b) Create a unit ramp signal which satisfies the below equation


ur (n)=n ; n>=0
=0 ; n<0

t=0:1:N-1;
r=t;
figure(1);
subplot(2,2,2);
stem(t,r);
xlabel('n----->');
ylabel('Amplitude----->');
title('UNIT RAMP SEQUENCE');
b) Unit Impulse:
s(n)=1; n>=0
=0; n<0
(N=Number of sequences=10)

t=-N:1:N;
s=[zeros(1,N),ones(1,1),zeros(1,N)];
figure(1);
subplot(2,2,3);
stem(t,s);
xlabel('n----->');
ylabel('Amplitude----->');
title('UNIT IMPULSE SEQUENCE');.

c) Exponential signal:
t=0:1:N-1
a=input('Enter the a value');
y=exp(a*t);
figure(1);
subplot(2,2,4);
stem(t,y);
xlabel('n----->');
ylabel('Amplitude----->');
title('EXPONENTIAL SEQUENCE');

e) Generate a Sinusoidal signal of frequency with interval 0.25 sec t=0 to 5 sec
t=0:0.25:5;
u=sin(0.5*pi*t);
figure(2);
subplot(2,2,1);
stem(t,u);
xlabel('n----->');
ylabel('Amplitude----->');
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

title('SINSUOIDAL SEQUENCE');

f) Cosine signal
t=0:0.25:5;
u=cos(0.5*pi*t);
figure(2);
subplot(2,2,2);
stem(t,u);
xlabel('n----->');
ylabel('Amplitude----->');
title('COSINE SEQUENCE');
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

VIVA:
1. Define signal and classify it
A signal is the entity that carries information. They are classified as
1. Periodic and non-Periodic
2. Deterministic and random
3. Energy and Power
4. Even and Odd
2. Identify the operations involved in the following signal x(2n) &x(n/2)
Ans: x(2n)- Compression
X(n/2)-Expansion
3. How unit step and impulse functions are related?

δ(n)=u(n)-u(n-1)
δ(t)=du(t)/dt
4. Consider the following 2 sequence of length 5 defined for 0≤n≤4
C(n)={3.2, 41, 36,-9.5,0}
d(n)={1.7,-0.5,0,0.8,1}

find 1). C(n)*d(n) 2). C(n)+d(n) 3). 7/2c(n)


ans: 1). C(n)*d(n)={5.44,-20.5,0,-7.6,0}
2). C(n)+d(n)={4.9,40.5,36,-8.7,1}
3). 7/2c(n)={11.2,143.5,126,-33.25,0}
5. A discrete time signal x(n)=-2,-1,0,1*,-1,1 is multiplied by u(-n-2) is the resulting signal
Ans: the sequence u(-n-2) is given by
U(-n-2)=1 for n≤-2
0 for n>-2

then the resulting signal is -2,-1,0,0*

RESULT:
Thus basic discrete time signals are generated using MATLAB programs and the
output is verified.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX.NO.2 LINEAR AND CIRCULAR CONVOLUTION OF TWO SEQUENCES

OBJECTIVE:
To write a MATLAB program to find the convolution for the sequences x(n)={1,1,2} and
h(n)= {2,0,2,0} using
(i) Linear convolution
(ii) Circular Convolution.
Analyze the convolution results with all the three methods

EQUIPMENTS AND ACCESSORIES REQUIRED:


MATLAB 7.8

(i) Linear Convolution:


Algorithm:
1) Get the sequence a.
2) Get the sequence b.
3) Compute the convolution of both the sequence.
4) Display the result.
5) Plot the resultant sequence.
6) To the graph X label, Y label and title are provided.

PROGRAM:
clc;
clear all;
close all;
x=input('Enter the 1st sequence');
h=input('Enter the 2nd sequence');
n1=length(x);
n2=length(h);
y=conv(x,h);
n3=length(y);
figure(1);
subplot(2,2,1);
stem(x);
xlabel('n----->');
ylabel('Amplitude----->');
title('Input signal 1');
subplot(2,2,2);
stem(h);
xlabel('n----->');
ylabel('Amplitude----->');
title('Input signal 2');
subplot(2,2,3);
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

stem(y);
xlabel('n----->');
ylabel('Amplitude----->');
title('Output convoluted signal');
disp('The resultant signal is');
disp(y);
disp('length of the output sequence is:');

OBSERVATION:
Enter the 1st sequence[ 2 3 1 0]
Enter the 2nd sequence[ 3 5 2 0]
The resultant signal is
6 19 22 11 2 0 0
length of the output sequence is: 7
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

(ii)Circular convolution of two sequences::


Algorithm:
1. Get the sequence.
2. Compute the length of sequences.
3. Compute the circular convolution of two sequences.
4. Display the result.
5. Plot the resultant sequences.
6. Plot the graph, x label, y label and title.
Program:
clc; clear all; close all;
a=input('enter for a');
b=input('enter for b');
N1=length(a);
N2=length(b);
N=max(n1,n2);
N3=N1-N2;
if(N3>0)
b=[b,zeros(1,n3)];
else
a=[a,zeros(1,-n3)];
end
for n=1:N
y(n)=0;
for i=1:n
j=n-i+1;
if (j<=0)
j=n+j
end
y(n)=y(n)+a(i)*b(j);
end
end
subplot(2,2,1);
stem(a);
grid on;
xlabel('time');
ylabel('amplitude');
title('a');
subplot(2,2,2);
stem(b);
grid on;
xlabel('time');
ylabel('amplitude');
title('a');
subplot(2,2,3);
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

stem(y);
grid on;
xlabel('time');
ylabel('amplitude');
title('a');
OBSERVATION:
Enter for a [2 3 4 5]
Enter for b [1 2 3]
y = 2 7 16 22

VIVA:
1.State the Properties of convolution.
i.x(n)*h(n)=h(n)*x(n)
ii.For cascade of 2 systems,h1(n)*h2(n)
iii.For parallel connection of 2 systems h1(n)+h2(n)
2.Which steps are performed in convolution
i.Folding
ii.Shifting
iii.Multiplication
iv.Integration/Summation
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

3. Differentiate circular and linear convolution?


Linear convolution Circular convolution
1.If x(n) is a sequence of L number of 1.If x(n) is a sequence of L No. of
samples & h(n) with M no. of samples samples & h(n) with M samples after
after convolution y(n) will contain convolution y(n) will contain
N=L+M-1 samples. N=max(L,M) sample.
2.Zero padding is not needed. 2.Zero padding needed.

4.What is Zero padding?


Let the Sequence x(n) has a length L.If we want to find the N-point DFT(N>L) of
the sequence x(n),we have to add (N-L)zeros to the sequence x(n).This is known as zero
padding
5.How will you obtain linear convolution from circular convolution?
Consider 2 finite duration sequences x(n) and h(n) of duration L samples and M
samples.The linear convolution produces L+M-1 samples and circular convolution
produces an N=Max(L,M).Now append appropriate number of zero valued samples to the
x(n) and h(n) and then circularly convolving results same as that of linear convolution

RESULT:
Thus the linear and circular convolution program is executed and verified using
MATLAB
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX. NO: 3 SAMPLING AND EFFECT OF ALIASING

(A) SINGLE TONE SAMPLING


OBJECTIVE:
To write a MATLAB program to perform sampling and to analyse the effect of aliasing for
a single tone signal.
EQUIPMENTS AND ACCESSORIES REQUIRED:
MATLAB 7.8
ALGORITHM:
1. Get the value of f(frequency) as input.
2. Generate a sine wave for the value of 1/f.
3. Generate a sine wave for the value of less than 1/f and this is the under sampled sequence.
4. Generate a sine wave for the value of greater than 1/f and this is the under sampled
sequence.
5. Plot the resultant sequence.
6. Give X label, Y label and title to the graph.

(B) MULTI-TONE SAMPLING


To write a MATLAB program to perform sampling and see the effect of aliasing for a
multi tone signal.
ALGORITHM:
1. Get the value of f1, f2 as input.
2. Generate a cosine wave for the value of 1/f1.
3. Calculate the sampling frequency fs=2*f2 and generate a cosine wave and this is the under
sampled sequence.
4. Calculate for frequency greater than 1/f1 and generate a cosine wave and this is the under
sampled sequence.
5. Plot the resultant sequence.
6. To the graph X label, Y label and title are provided.
PROGRAM:(SINGLE TONE SAMPLING)
clc;
clear all;
close all;
f=1;
t=0:.001:4;
S=sin(2*3.14*f*t);
figure(1);
subplot(3,1,1);
plot(t,S);
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

grid on;
xlabel('n-------->');
ylabel('u(n)------>');
title('sine');
%under sampling
t=0:.2:4;
S=sin(2*3.14*f*t);
subplot(3,1,2);
stem(t,S);
grid on;
xlabel('n--------->');
ylabel('u(n)------->');
%aliasing
t=0:.6:4;
S=sin(2*3.14*f*t);
subplot(3,1,3);
stem(t,S);grid on;
xlabel('n--------->') ;
ylabel('u(n)--------->’);
OBSERVATION:
sine
1
u(n)------>

-1
0 0.5 1 1.5 2 2.5 3 3.5 4
n-------->
1
u(n)------->

-1
0 0.5 1 1.5 2 2.5 3 3.5 4
n--------->
1
u(n)---------->

-1
0 0.5 1 1.5 2 2.5 3 3.5 4
n--------->
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

PROGRAM:(MULTI TONE SAMPLING)

clc; clear all; close all;


f1=1; f2=2;
t=0:.001:4;
S=sin(2*3.14*f1*t)+ sin(2*3.14*f2*t);
figure(1);
subplot(3,1,1);
plot(t,S);
grid on;
xlabel('n-------->');
ylabel('u(n)------>');
title('sine');
f=max(f1,f2);
t=1/(2*f);
%under sampling
t=0:.1:4;
S=sin(2*3.14*f1*t)+ sin(2*3.14*f2*t);
subplot(3,1,2);
stem(t,S);
grid on;
xlabel('n--------->');
ylabel('u(n)------->');
%aliasing
t=0:.5:4;
S=sin(2*3.14*f1*t)+ sin(2*3.14*f2*t);subplot(3,1,3);
stem(t,S);
grid on;
xlabel('n--------->');
ylabel('u(n)---------->');
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

Observation

VIVA
1.State Sampling Theorem.
A continuous time signal can be completely represented in its samples and recovered back if the
sampling frequency Fs ≥2W where Fs = sampling frequency W-=Max frequency present in
the signal.
2.What is aliasing
Due to under sampling, high frequencies appear as low frequencies and they interfere with each
other. This effect is called aliasing.
3. How aliasing can be avoided
i.To have sampling rate higher than Nyquist rate
ii.To pass the signal through pre-alias filter before sampling.
4. What is pre-alias filter?
A pre-alias filter is low pass filter which blocks all frequencies above Hz. Basically it is
bandlimiting operation.
5. What is Nyquist rate and Nyquist interval?
Nyquist rate= 2*highest signal frequency
Nyquist interval= 1/Nyquist rate

Result: Thus the sampling and the effect of aliasing for a single tone signal and multi tone signals
were performed using MATLAB
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX. NO: 4 DESIGN OF FIR FILTERS

OBJECTIVE:
To write a MATLAB program to design FIR filters for Pass Band Frequency1000,
StopBand Frequency 2000, Pass Band Ripple 0.05, Stop Band Ripple 0.04, Frequency 10000

EQUIPMENTS AND ACCESSORIES REQUIRED:


MATLAB 7.8
(A) KAISER WINDOW
ALGORITHM:
1.
Get the pass band, stop band, pass band ripple, stop band ripple and sampling frequency.
2.
Calculate the value of ωp =(2*fp)/Fs, ωs=(2*fs)/Fs.
3.
Assign ωn = ωp then calculate the value of N.
4.
Then plot the graph for low pass, high pass, band pass and band reject filter for the Kaiser
filter with the respective formulas in separate figure windows.
PROGRAM:
clc;
clear all;
close all;
fp=input('Enter PassBand Frequency');
fs=input('Enter StopBand Frequency');
rp=input('Enter PassBand Ripple');
rs=input('Enter StopBand Ripple');
f=input('Enter Frequency');
num=(-20*log10(sqrt(rp*rs)))-13;
den=(14.6*(fs-fp))/f;
N=ceil(num/den);
wp=2*fp/f;
ws=2*fs/f;
wn=wp;
b=fir1(N,wn,kaiser(N+1,.1));
figure(1);
freqz(b,1,256);
title('LPF Filter-Kaiser window');
wn=ws;
b=fir1(N,wn,'high',kaiser(N+1,.1));
figure(2);
freqz(b,1,256);
title('HPF Filter-Kaiser window');
wn=[wp ws];
b=fir1(N,wn,'band',kaiser(N+1,.1));
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

figure(3);
freqz(b,1,256);
title('BPF Filter-Kaiser window');
wn=[wp ws];
b=fir1(N,wn,'stop',kaiser(N+1,.1));
figure(4);
freqz(b,1,256);
title('BSF Filter-Kaiser window');
Observation:
Enter PassBand Frequency 1000
Enter StopBand Frequency 2000
Enter PassBand Ripple 0.05
Enter StopBand Ripple 0.04
Enter Frequency 10000

LPF Filter-Kaiser window


0
Magnitude (dB)

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

0
Phase (degrees)

-100

-200

-300
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

HPF Filter-Kaiser window


20

0
Magnitude (dB)

-20

-40

-60
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

200
Phase (degrees)

-200

-400

-600
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

BSF Filter-Kaiser window


0
Magnitude (dB)

-10

-20

-30
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

-200
Phase (degrees)

-400

-600

-800

-1000
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

(B) HANNING WINDOW


To write a MATLAB program to design Hanning FIR filters.

ALGORITHM:
1. Get the pass band, stop band, pass band ripple, stop band ripple and sampling frequency.
2. Calculate the value of ωp =(2*fp)/Fs, ωs=(2*fs)/Fs
3. Assign ωn = ωp then calculate the value of N.
4. Then plot the graph for low pass, high pass, band pass and band reject filter for the
Hanning filter with the respective formulas in separate figure windows.
PROGRAM:
clc; clear all; close all;
fp=input('Enter PassBand Frequency');
fs=input('Enter StopBand Frequency');
rp=input('Enter PassBand Ripple');
rs=input('Enter StopBand Ripple');
f=input('Enter Frequency');
num=(-20*log10(sqrt(rp*rs)))-13;
den=(14.6*(fs-fp))/f;
N=ceil(num/den);
wp=2*fp/f; ws=2*fs/f;
wn=wp;
b=fir1(N,wn,hann(N+1));
figure(1);
freqz(b,1,256);
title('LPF Filter-Hanning window');
wn=ws;
b=fir1(N,wn,'high',hann(N+1));
figure(2);
freqz(b,1,256);
title('HPF Filter-Hanning window');
wn=[wp ws];
b=fir1(N,wn,'band',hann(N+1));
figure(3);
freqz(b,1,256);
title('BPF Filter-Hanning window');
wn=[wp ws];
b=fir1(N,wn,'stop',hann(N+1));
figure(4);
freqz(b,1,256);
title('BSF Filter-Hanning window');

OBSERVATION:
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

Enter PassBand Frequency 1000


Enter StopBand Frequency2000
Enter PassBand Ripple0.05
Enter StopBand Ripple0.04
Enter Frequency10000

LPF Filter-Hanning window


0
M agnitude (dB)

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

0
Phase (degrees )

-100

-200

-300

-400

-500
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

HPF Filter-Hanning window


50
M a g n itu d e (d B )

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

400
P h a s e (d e g re e s )

200

-200

-400

-600
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

BPF Filter-Hanning window


50
Magnitude (dB)

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

0
Phase (degrees)

-200

-400

-600

-800
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

BSF Filter-Hanning window


2
Magnitude (dB)

-2

-4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

-200
Phase (degrees)

-400

-600

-800

-1000
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

(c) Hamming Window


Aim:
To write a MATLAB program to design Hamming FIR filters.

ALGORITHM:
1. Get the pass band, stop band, pass band ripple, stop band ripple and sampling frequency.
2. Calculate the value of ωp =(2*fp)/Fs, ωs=(2*fs)/Fs.
3. Assign ωn = ωp then calculate the value of N.
4. Then plot the graph for low pass, high pass, band pass and band reject filter for the
Hamming filter with the respective formulas in separate figure windows.
PROGRAM:
clc; clear all; close all;
fp=input('Enter PassBand Frequency');
fs=input('Enter StopBand Frequency');
rp=input('Enter PassBand Ripple');
rs=input('Enter StopBand Ripple');
f=input('Enter Frequency');
num=(-20*log10(sqrt(rp*rs)))-13;
den=(14.6*(fs-fp))/f;
N=ceil(num/den);
wp=2*fp/f; ws=2*fs/f; wn=wp;
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

b=fir1(N,wn,hamming(N+1));
figure(1);
freqz(b,1,256);
title('LPF Filter-Hamming window');
wn=ws;
b=fir1(N,wn,'high',hamming(N+1));
figure(2);
freqz(b,1,256);
title('HPF Filter-Hamming window');
wn=[wp ws];
b=fir1(N,wn,'band',hamming(N+1));
figure(3);
freqz(b,1,256);
title('BPF Filter-Hamming window');
wn=[wp ws];
b=fir1(N,wn,'stop',hamming(N+1));
figure(4);
freqz(b,1,256);
title('BSF Filter-Hamming window');
OBSERVATION:
Enter PassBand Frequency 1000
Enter StopBand Frequency 2000
Enter PassBand Ripple 0.05
Enter StopBand Ripple 0.04
Enter Frequency 10000

LPF Filter-Hamming window


M a g n it u d e (d B )

-50

-100

-150
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
P h a s e (d e g re e s )

-200

-400

-600

-800
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

HPF Filter-Hamming window


50
M agnitude (dB )

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

400
P has e (degrees )

200

-200

-400

-600
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

BPF Filter-Hamming window


50
Magnitude (dB)

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

0
Phase (degrees)

-200

-400

-600

-800
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

BSF Filter-Hamming window


2

0
Magnitude (dB)

-2

-4

-6
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

-200
Phase (degrees)

-400

-600

-800

-1000
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

(d) Rectangular Window


Aim:
To write a MATLAB program to design rectangular FIR filters.

Algorithm:
1. Get the pass band, stop band, pass band ripple, stop band ripple and sampling frequency.
2. Calculate the value of ωp =(2*fp)/Fs, ωs=(2*fs)/Fs.
3. Assign ωn = ωp then calculate the value of N.
4. Then plot the graph for low pass, high pass, band pass and band reject filter for the
rectangular filter with the respective formulas in separate figure windows.
Program:
clc; clear all; close all;
fp=input('Enter PassBand Frequency');
fs=input('Enter StopBand Frequency');
rp=input('Enter PassBand Ripple');
rs=input('Enter StopBand Ripple');
f=input('Enter Frequency');
num=(-20*log10(sqrt(rp*rs)))-13;
den=(14.6*(fs-fp))/f;
N=ceil(num/den);
wp=2*fp/f;
ws=2*fs/f;
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

wn=wp;
b=fir1(N,wn,boxcar(N+1));
figure(1);
freqz(b,1,256);
title('LPF Filter-Rectangular window');
wn=ws;
b=fir1(N,wn,'high',boxcar(N+1));
figure(2);
freqz(b,1,256);
title('HPF Filter-Rectangular window');
wn=[wp ws];
b=fir1(N,wn,'band',boxcar(N+1));
figure(3);
freqz(b,1,256);
title('BPF Filter-Rectangular window');
wn=[wp ws];
b=fir1(N,wn,'stop',boxcar(N+1));
figure(4);
freqz(b,1,256);
title('BSF Filter-Rectangular window');
OBSERVATION:
Enter PassBand Frequency 1000
Enter StopBand Frequency2000
Enter PassBand Ripple0.05
Enter StopBand Ripple0.04
Enter Frequency10000
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

M a g n it u d e ( d B )
LPF Filter-Rectangular window
0

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
P h a s e (d e g re e s )

-100

-200

-300
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

HPF Filter-Rectangular window


20
M a gn itu de (dB )

-20

-40

-60
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

200
P ha s e (de gre es )

-200

-400

-600
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

BPF Filter-Rectangular window


50
Magnitude (dB)

-50

-100
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

300
Phase (degrees)

200

100

-100

-200
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

BSF Filter-Rectangular window


0
M agnitude (dB )

-10

-20

-30
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

0
P has e (degrees )

-200

-400

-600

-800

-1000
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

VIVA
1.What is FIR filter? State the properties of FIR filter?
FIR stands for Finite Impulse Response filter. It’s length of impulse response is finite.
 FIR filters have linear phase.
 FIR filters are inherently stable.
 FIR filters need higher orders for similar magnitude response compare to IIR filter

2.. How linear phase is achieved in FIR filters?


FIR filters have linear phase, if
h(n) = ±h(M-1-n)
3. Which are the different FIR filter design methods?
 FIR filters design using windows.
 FIR filters design using windows frequency sampling.
 Optimal or minmax FIR filter design.

4. How FIR filter is designed using windows?


The desired unit sample response hd(n) is obtained from desired frequency response Hd(ω).
This desired unit sample response is then passed through suitable window. i.e.,
h(n)= hd(n). ω(n)
5.What is Gibbs phenomenon or oscillation?
One possible way of finding FIR filter that approximates H(ejω) would be to truncate the infinite
fourier series at n=±(N-1/2).Abrupt truncation of the series will lead to oscillation both in passband
and in stopband.this phenomenon is known as Gibbs phenomenon

RESULT:
Thus the various FIR filters using rectangular, hamming, hanning and Blackman window
programs were written and executed successfully.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX. NO: 5 DESIGN OF IIR FILTERS

OBJECTIVE:
Design an IIR filter for the following Specifications
Pass Band Frequency1000, Stop Band Frequency2000 and Sampling freq10000

EQUIPMENTS AND ACCESSORIES REQUIRED:


MATLAB 7.8

ALGORITHM:
1. Get the pass band, stop band, pass band attenuation, stop band attenuation and sampling
frequency.
2. Calculate the value of ωp = (2*fp)/Fs, ωs = (2*fs)/Fs.
3. Plot the analog low pass filter using butter function, digital impulse invariant filter using
impinvar function, digital bilinear filter using bilinear function.
4. Plot the analog high pass filter using butter function.

PROGRAM:
clc;
clear all;
close all;
fp=input('Enter PassBand Frequency');
fs=input('Enter StopBand Frequency');
rp=5;
rs=50;
f=input('Enter sampling freq');
wp=(2*fp)/f;
ws=(2*fs)/f;
[N wn]=buttord(wp,ws,rp,rs);
[b a]=butter(N,wn,'s');
figure(1);
freqs(b,a);
title('analog low pass filter');
[b1 a1]=impinvar(b,a);
figure(2);
freqz(b1,a1);
title('digital impvar filter');
[b2 a2]=bilinear(b,a,f);
figure(3);
freqz(b2,a2);
title('digital bilinear filter');
plot(omega,phase);
grid;
title('phase plot');
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

OBSERVATION:

Enter PassBand Frequency1000


Enter StopBand Frequency2000
Enter sampling freq10000

0
analog low pass filter
10
M a g n it u d e

-5
10
-2 -1 0
10 10 10
Frequency (rad/s)

200
P h a s e (d e g re e s )

100

-100

-200
-2 -1 0
10 10 10
Frequency (rad/s)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

digital impvar filter


100
M agnitude (dB )

-100

-200
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

0
P has e (degrees )

-200

-400

-600

-800
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

digital bilinear filter


0

-100
Magnitude (dB)

-200

-300

-400
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

280

260
Phase (degrees)

240

220

200

180
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

PROGRAM-
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

HIGHPASS –IIR
clc;
clear all;
close all;
fp=input('Enter PassBand Frequency');
fs=input('Enter StopBand Frequency');
rp=5;
rs=50;
f=input('Enter sampling freq');
wp=(2*fp)/f;
ws=(2*fs)/f;
[N wn]=buttord(wp,ws,rp,rs);
[b a]=butter(N,wn,'high','s');
figure(1);
freqs(b,a);
title('analog low pass filter');
[b1 a1]=impinvar(b,a);
figure(2);
freqz(b1,a1);
title('digital impvar filter');
[b2 a2]=bilinear(b,a,f);
figure(3);
freqz(b2,a2);
title('digital bilinear filter');
OBSERVATION:
Enter PassBand Frequency 1000
Enter StopBand Frequency2000
Enter sampling freq10000
0
analog low pass filter
10
M a g n it u d e

-5
10

-10
10
-2 -1 0 1
10 10 10 10
P h a s e (d e g re e s )

Frequency (rad/s)

200

100

-100

-200
-2 -1 0 1
10 10 10 10
Frequency (rad/s)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

digital impvar filter


10
M a g n itu d e (d B )

-10

-20

-30
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

300
P h a s e (d e g re e s )

200

100

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

digital impvar filter


10
M a g n itu d e (d B )

-10

-20

-30
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

300
P h a s e (d e g re e s )

200

100

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized Frequency ( rad/sample)

VIVA
1.What is IIR filter? What are various methods to design IIR filter?

IIR filter has infinite impulse response


 Approximation of derivatives
 Impulse invariance
 Bilinear transformation.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

2. Which of the above method do you prefer? Why?


Bilinear transformation is better, since there is no aliasing in it.

3. What is prewarping?
Frequency warping or nonlinear frequency relationship is the main problem of bilinear
transformation.
Prewarping is the method of introducing nonlinearily in frequency relationship to
compensate warping effect.
Formula Ὠ=2/T tan ω/2

4. Which are the different filter approximations?


 Butterworth(maximally flat) approximation.
 Chebyshev approximation.
 Elliptic approximation.
5.What is frequency transformation?
Frequency transformation is required to convert filter from lowpass to
lowpass ,highpass,bandpass and so on.

RESULT:
Thus the digital butter worth IIR filters were designed and executed successfully
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX.NO.6 CALCULATION OF FFT OF A SIGNAL

OBJECTIVE:
To compute FFT using the MATLAB program for the sequences [1 1 1 1] and [1 1 1 1 0 0 0 0]

EQUIPMENTS AND ACCESSORIES REQUIRED:


MATLAB 7.8

ALGORITHM:

(i) To find the amplitude response and phase response of a sequence:

1. Get the input sequence


2. Find FFT of the sequence.
3. Find the amplitude response and phase response.
4. Plot the amplitude and phase responses.

PROGRAM:
clc;
x=input('Enter the input sequence');
n=length(x);
s=fft(x,n);
disp('The output sequence');s
a=real(s);
disp('Real part of the output sequence');a
b=imag(s);
disp('Imag. part of the output sequence');b
figure;
subplot(3,1,1);
stem(x);
grid on;
title('Input');
xlabel('n-->');
ylabel('Amplitude -->');
subplot(3,1,2);
stem(a);
grid on;
title('Real part');
xlabel('n-->');
ylabel('Amplitude -->');
subplot(3,1,3);
stem(b);
title('Imaginary part');
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

xlabel('n-->');
ylabel('Amplitude -->');
OBSERVATION:
Enter the input sequence [1 1 0 0]
The output sequence

s=

2.0000 1.0000 - 1.0000i 0 1.0000 + 1.0000i

Real part of the output sequence

a=

2 1 0 1

Imag. part of the output sequence

b=

0 -1 0 1
Input
1
Amplitude -->

0.5

0
1 1.5 2 2.5 3 3.5 4
n-->
Real part
2
Amplitude -->

0
1 1.5 2 2.5 3 3.5 4
n-->
Imaginary part
1
Amplitude -->

-1
1 1.5 2 2.5 3 3.5 4
n-->
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

VIVA:
1.What is FFT?
The fast fourier transform is an algorithm used to compute the DFT. It is based on the principle of
decomposing the computation of DFTof a sequence of length N into successively smaller DFTs.
2. What is the main advantage of FFT?
i.To reduce the computation time of DFT
ii.Provides speed-increase factors.
3.. What is meant by radix-2 FFT?
The FFT algorithm is most efficient in calculating N-point DFT. If the the number of output points
N can be expressed as a power of 2, that is N= , where M is an integer, then this algorithm is
known as radix-2 FFT algorithm.
4.The DFT of a sequence x(n) that has N=2m can be calculated using 2 algoritms.Algorithm A
computes the DFT by direct computation & take N2 seconds to run. Algorithm B implements DIT-
FFT & takes 5Nlog2N sesc to run.What is the shortest sequence N such that Algorithm B runs
faster than Algorithm A.

N Algorithm A(N2 secs) Algorithm B(5Nlog2N secs)


2 4 10
4 16 40
8 64 120
16 256 320
32 1024 800
Thus we see that a sequence with length N=32 is the shortest seq for which algorithm B runs faster
than algorithm A
5. Calculate the number of multiplications needed in the calculation of FFT and DFT with 64 pt
sequence.
The number of complex multiplications required using FFT is
N/2 log2N=64/2log264=192
The number of complex multiplications required using DFT is
N2=642=4096,Speed improvement factor=4096/192=21.33
RESULT:
Thus the above MATLAB program compute the Fast Fourier Transform of a given
sequence.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX.NO. 7 ADDITION OF TWO NUMBERS

(A) 16 BIT ADDITION USING INDIRECT ADDRESSING MODE

OBJECTIVE:
To add two 16-bit number using indirect addressing mode

EQUIPMENTS AND ACCESSORIES REQUIRED:


TMS320C50 Processor

ALGORITHM:

1. Load the data memory value of the operand


2. Clear the accumulator
3. Store the address of operands in the pointers
4. Perform addition
5. Store the accumulator lower order byte with left shift by one to the data memory
location
6. Halt the execution

Program:
(A) 16 BIT ADDITION USING INDIRECT ADDRESSING MODE
.MMREGS
.TEXT
LDP#100H
LAR AR0,# 8000H
LAR AR1,# 8001H
LAR AR2,#80002H
ZAP
MAR*,AR0
ADD*
MAR*,AR1
ADD*
MAR*,AR2
SACL*
HLT: B HLT

OUTPUT:
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

(B) 16 BIT ADDITION USING DIRECT ADDRESSING MODE

OBJECTIVE:
To add two 16-bit number using direct addressing mode

ALGORITHM:
1. Load the data directly to accumulator
2. Add the contents of accumulator to the next 16 bit data
3. Store the result in data memory location
4. Halt the execution
5.
Program:
.MMREGS
.TEXT
LDP #100H
LACC # 1234H
ADD #2345H
SACL 8000H
HLT: B HLT

OUTPUT:

(C) 32 BIT ADDITION USING INDIRECT ADDRESSING MODE

OBJECTIVE:
To add two 32-bit number

ALGORITHM:

1. Load the operand from 10th bit of accumulator


2. Add accumulator content and adds content with sign extension
3. Store the LSB of accumulator in memory location
4. Store the MSB of accumulator in memory location
5. Halt the execution
Program:
.MMREGS
.TEXT
LDP #100H
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

LACC 8001,10H
ADDS 8000H
ADDS 8002H,10H
ADDS 8003H
SACH 8005H
HLT: B HLT

OUTPUT:

RESULT:
Thus the addition of two 16 bit number and 32 bit number is performed using
TMS320C50
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

EX.NO. 8 SAMPLING OF INPUT SIGNAL AND DISPLAY

OBJECTIVE:
To Sample the input sinewave waveform using TMS320C6745 DSP KIT.

EQUIPMENTS AND ACCESSORIES REQUIRED:


TMS320C5416 and TMS320C6711 DSP Starter Kit, PC with Code Composer Studio,
CRO, Audio Source, Speakers and Signal Generator.

PROCEDURE:

1. Open Code Composer Studio v4 .

2. In WorkSpace Launcher.

 BROWSE → Select the project location and make one new folder, MAKE NEW
FOLDER → Type the Workspace name, OK → OK.

3. FILE ⇒ NEW ⇒ CCS PROJECT

 Project name: Type your project name.


 Tick use default location. → NEXT
 Project type C6000.
 Tick Debug And Release. → NEXT → NEXT.
 Output type: Executable.
 Device Variant : generic - TMS320C6745.
 Device Endianness : little
 Code Generation Tools: TI v6.1.12.
 Run time support library: automatic.
 Target content: none. →FINISH

4.FILE ⇒ NEW ⇒ SOURCE FILE


 Source file: Type your projectname.c( .c extension is must ).
 Type the program.
 FILE → SAVE.

5. Paste the following board library files in workspace location.

 Common folder (contains header files)


 Gel folder (contains gel file)
 Library folder(contains library files)

6. Paste the Linker file in the project location.(linker file is available in cd)
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

Note: Those folders and linker file are availble at cd.

7. PROJECT ⇒ PROPERTIES ⇒ C/C++ BUILD → BASIC OPTION

 Target processor version(--silicon version, -mv)    :   6400+ OK.


 IN C/C++ BUILD, → INCLUDE OPTIONS (Add dir to #include search path(--
include_path,-I)) select this add icon and add the following three path by indivdually
   -  "${Diag}../../common/header"
   -  "${XDAIS_CG_ROOT}/packages/ti/xdais"
   -  "${C6000_CSL_CG_ROOT}/include"

8. FILE ⇒ NEW ⇒ TARGET CONFIGURATION FILE

 file name: projectname. ccxml (.ccxml extension is must)


 Connection: Texas Instrument XDS100 v1 USB Emulator.
 Device: TMS320C6745. (Tick the TMS320C6745)→ SAVE → TARTGET
CONFIGURATION → C674X_0 → BROWSE, browse the workspace location, open
the gel folder and select the GEL file. → OPEN → SAVE.

9. In C/C++ Project window, Right click the project ⇒ REBUILD PROJECT.

10. Connections

 Connect the usb cable, PC to TMS320C6745 KIT.


 Connect the 5v adapter.
 Power on the kit.

11. TARGET ⇒ DEBUG ACTIVE PROJECT.

Note: Connect the Function generator probe positive terminal to Adc input pin and negative
terminal to ground. Set the frequency as 1Khz & Amplitude as 3V.

12. TARGET ⇒ RUN. (wait few seconds read samples)

13. TARGET ⇒ HALT.

14. TOOLS ⇒ GRAPH ⇒ SINGLE TIME

 Acquirstion buffer size : 500


 Index increment : 1
 Start address : adc_value.
 Display data size : 500 → Ok.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

PROGRAM:

#include "stdio.h"

#include "c6745.h"

#include "spiadc.h"

signed int adc_value[1000];

void main( void )

{    

        static Uint8 spiadcbuf[3];

        unsigned int j;

        short *out,i=0;

        C6745_init( );

        out = (short *)0xc0000000;

    spiadc_init();

        for(i=0;i<500;i++)

        {

                spiadcbuf[0] = 0x01; // setup command

        spiadcbuf[1] = 0xBF;

        spiadcbuf[2] = 0x00;

                        spiadc_cycle(spiadcbuf, 3);  // Execute spiadc read cycle

                        adc_value[i] = ((spiadcbuf[1]&0x0f) << 8)| spiadcbuf[2];

                        //for(j=0;j<100000;j++);

        }

        printf("ALL PROCESSED");


SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

        while(1);

RESULT:

Thus, the Sampling of input sine waveform was sampled and Displayed the sampled signal in
Graph.

EX.NO. 9 IMPLEMENTATION OF FIR FILTER


SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

OBJECTIVE:
To design and implement Digital Finite Impulse Response [FIR] Filter.

EQUIPMENTS AND ACCESSORIES REQUIRED:


TMS320C5416 and TMS320C6711 DSP Starter Kit, PC with Code Composer Studio,
CRO, Audio Source, Speakers and Signal Generator.

ALGORITHM:
1. Get sampling frequency, filter order and cut off frequency
2. Obtain filter coefficient for low pass FIR and high pass FIR filter using MATLAB.
3. Copy the above filter coefficients into the array “h” in the given fir_filter.c file.

PROCEDURE:
1. Connect CRO to the Socket Provided for SPKR OUT.
2. Connect a Signal Generator to the LINE IN Socket.
3. Switch on the Signal Generator with a sine wave of frequency 500 Hz.
4. Now Switch on the DSK and Bring Up Code Composer Studio on the PC.
5. Copy the given source code into the my projects folder of CCS installation folder.
6. From the Project Menu of CCS Select the Open Menu.
7. Select fir_filter.pjt and open it.
8. Build, Load and Run the program.
9. You can notice the input signal of 500 Hz. appearing on the CRO without any
attenuation.
10. Change the frequency of the input signal to 3000 Hz, you can observe that no signal
appears on the CRO, this is because any input signal with frequency more than 800 Hz (cutoff
frequency) will be attenuated and hence not passed through the filter.
11. Design a Highpass filter with the above given filter specifications and set the input
signal frequency to 4000 Hz, the signal appears on the CRO without any attenuation.
12. Change the frequency of the input signal to 1000 Hz, you can observe that no signal
appears on the CRO, this is because any input signal with frequency less than 3000 Hz (cutoff
frequency) will be attenuated and hence not passed through the filter.
13. You can also pass an audio input and hear the output signal through the speakers,
Where a Lowpass filter will result in BASS and Highpass filter will result in TREBLE part of the
audio input.

Program:
#include "fft_configcfg.h"
#include <dsk5416.h>
#include <dsk5416_pcm3002.h>
#define N 33
short filter(short*,short*);
short filter_l(short*,short*);
//High pass
// b=fir1(32,(2*3000)/48000,'high')
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

//short h[N]={-1,23,60,116,186,249,268,199,-1,-360,-881,-1534,-2257,-2964,-3560,-
3958,28679,-3958,-3560,-2964,-2257,-1534,-881,-360,-1,199,268,249,186,116,60,23,-1};
//low pass
//b=fir1(32,(2*800)/48000);
short
h[N]={96,115,158,230,330,459,612,786,975,1170,1363,1546,1710,1846,1949,2013,2035,
2013,1949,1846,1710,1546,1363,1170,975,786,612,459,330,230,158,115,96};
short l_inp_buffer[N],r_inp_buffer[N];
short left_output,right_output,left_input,right_input,i;
DSK5416_PCM3002_Config setup = {

0x1ff, // Set-Up Reg 0 - Left channel DAC attenuation


0x1ff, // Set-Up Reg 1 - Right channel DAC attenuation
0x0, // Set-Up Reg 2 - Various ctl e.g. power-down modes
0x0 // Set-Up Reg 3 - Codec data format control
};
void main ()
{
DSK5416_PCM3002_CodecHandle hCodec;
// Initialize the board support library
DSK5416_init();
// Start the codec
hCodec = DSK5416_PCM3002_openCodec(0, &setup);
// Set codec frequency
DSK5416_PCM3002_setFreq(hCodec, 48000);
// Endless loop IO audio codec
while(1){
// Read 16 bits of codec data, loop to retry if data port is busy
while(!DSK5416_PCM3002_read16(hCodec, &left_input));
while(!DSK5416_PCM3002_read16(hCodec, &right_input));
/*******processing********/
l_inp_buffer[0]=left_input;
r_inp_buffer[0]=right_input;

left_output=filter(l_inp_buffer,h);
right_output=filter(r_inp_buffer,h);
for(i=N-1;i>0;i--)
{
l_inp_buffer[i]=l_inp_buffer[i-1];
r_inp_buffer[i]=r_inp_buffer[i-1];
}
/******************************/

// Write 16 bits to the codec, loop to retry if data port is busy


while(!DSK5416_PCM3002_write16(hCodec, left_output));
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

while(!DSK5416_PCM3002_write16(hCodec, right_output));
}
}

short filter(short *x,short *h)


{
short j,val;
long int sum=0;
for(j=0;j<N;j++)
sum += ((x[j])*(h[j]));
sum=sum>>15;
return((short)sum);
}
Tabulation:
I/P voltage=

Low pass filter High Pass filter


Freque O/P V Gain= Frequen O/P V0/Vi Gain=
ncy(Kh voltage 0 / 20log(V o / cy(Khz) voltage 20log(Vo/
z) (V0) V Vin) db (V0) Vin) db
i

RESULT: Thus the finite impulse response (FIR) filter is successfully implemented
and verified
EX.NO. 10 CALCULATION OF FFT

OBJECTIVE:
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

To design and implement FFT.

EQUIPMENTS AND ACCESSORIES REQUIRED:


TMS320C5416 and TMS320C6711 DSP Starter Kit, PC with Code Composer Studio,
CRO, Audio Source, Speakers and Signal Generator.

ALGORITHM:

1. Generate a cosine signal.


2. Compute the FFT.
3. Plot FFT against the no. of samples.

PROCEDURE:
1. Connect CRO to the Socket Provided for SPKR OUT.
2. Connect a Signal Generator to the LINE IN Socket.
3. Switch on the Signal Generator with a sine wave of frequency 500 Hz.
4. Now Switch on the DSK and Bring Up Code Composer Studio on the PC.
5. Copy the given source code into the my projects folder of CCS installation folder.
6. From the Project Menu of CCS Select the Open Menu.
7. Select fir_filter.pjt and open it.
8. Build, Load and Run the program.
9. You can notice the input signal of 500 Hz. appearing on the CRO without any
attenuation.
10. Change the frequency of the input signal to 3000 Hz, you can observe that no signal
appears on the CRO, this is because any input signal with frequency more than 800 Hz (cutoff
frequency) will be attenuated and hence not passed through the filter.
11. Design a Highpass filter with the above given filter specifications and set the input
signal frequency to 4000 Hz, the signal appears on the CRO without any attenuation.
12. Change the frequency of the input signal to 1000 Hz, you can observe that no signal
appears on the CRO, this is because any input signal with frequency less than 3000 Hz (cutoff
frequency) will be attenuated and hence not passed through the filter.
13. You can also pass an audio input and hear the output signal through the speakers,
Where a Lowpass filter will result in BASS and Highpass filter will result in TREBLE part of the
audio input.

Program:

;Starting address: 0700h


;Input address: 1000h
;Output address: 1800h

.include "twi.asm"
.include "twr.asm"
.include "cos.asm"
.include "5416_iv.asm"
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

.def start
.data
R1 .word 0h ;Variables
I1 .word 0h
stages .word 7h
grp .word 64
grp1 .word 0h
but .word 1h
but1 .word 0h
R .word 0h
I .word 0h
A1 .word 0h
sizetw .word 40h
sizein .word 80h
bitr .word 40h
shi .word 7Fh
CNT .word 128
E .word 45h
.text

start LD #R1,DP
RSBX INTM
LD #022Bh,0,A
STLM A,PMST

;------------------------Serial Port Initializations-------------------------


;--------------------------McBSP0 Initializations----------------------------

SSBX INTM
STM SPCR1,McBSP0_SPSA ;SPCR1 reset
STM #0090h,McBSP0_SPSD

NOP
NOP

STM SPCR2,McBSP0_SPSA ;SPCR2 reset


STM #0020h,McBSP0_SPSD

STM PCR,McBSP0_SPSA ;PCR


STM #0A00h,McBSP0_SPSD

STM RCR1,McBSP0_SPSA ;RCR1


STM #00A0h,McBSP0_SPSD ;32 BITS WORDSIZE
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

STM RCR2,McBSP0_SPSA ;RCR2


STM #0001h,McBSP0_SPSD

STM XCR1,McBSP0_SPSA ;XCR1


STM #00A0h,McBSP0_SPSD ;32 BITS WORDSIZE

STM XCR2,McBSP0_SPSA ;XCR2


STM #0001h,McBSP0_SPSD

STM SRGR1,McBSP0_SPSA ;SRGR1


STM #0017h,McBSP0_SPSD ;--17

STM SRGR2,McBSP0_SPSA ;SRGR2


STM #303Fh,McBSP0_SPSD

STM MCR1,McBSP0_SPSA ;MCR1


STM #0001h,McBSP0_SPSD

STM MCR2,McBSP0_SPSA ;MCR2


STM #0000h,McBSP0_SPSD

STM RCERB,McBSP0_SPSA ;RCERB


STM #0001h,McBSP0_SPSD

STM RCERA,McBSP0_SPSA ;RCERA


STM #0001h,McBSP0_SPSD

STM XCERB,McBSP0_SPSA ;XCERB


STM #0001h,McBSP0_SPSD

STM XCERA,McBSP0_SPSA ;XCERA


STM #0001h,McBSP0_SPSD

STM SPCR1,McBSP0_SPSA
STM #0091h,McBSP0_SPSD ;Take 'em out of reset

NOP
NOP

STM SPCR2,McBSP0_SPSA
STM #00A1h,McBSP0_SPSD

;--------------------------McBSP2 Initializations------------------------------
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

STM SPCR1,McBSP2_SPSA ;SPCR1 reset


STM #0090h,McBSP2_SPSD

NOP
NOP

STM SPCR2,McBSP2_SPSA ;SPCR2 reset


STM #0020h,McBSP2_SPSD

STM PCR,McBSP2_SPSA ;PCR


STM #0A00h,McBSP2_SPSD

STM RCR1,McBSP2_SPSA ;RCR1


STM #00A0h,McBSP2_SPSD ;32 BITS WORDSIZE

STM RCR2,McBSP2_SPSA ;RCR2


STM #0000h,McBSP2_SPSD

STM XCR1,McBSP2_SPSA ;XCR1


STM #00A0h,McBSP2_SPSD ;32 BITS WORDSIZE

STM XCR2,McBSP2_SPSA ;XCR2


STM #0000h,McBSP2_SPSD

STM SRGR1,McBSP2_SPSA ;SRGR1


STM #0005h,McBSP2_SPSD ;--5

STM SRGR2,McBSP2_SPSA ;SRGR2


STM #303Bh,McBSP2_SPSD

STM MCR1,McBSP2_SPSA ;MCR1


STM #0001h,McBSP2_SPSD

STM MCR2,McBSP2_SPSA ;MCR2


STM #0000h,McBSP2_SPSD

STM RCERB,McBSP2_SPSA ;RCERB


STM #0001h,McBSP2_SPSD

STM RCERA,McBSP2_SPSA ;RCERA


STM #0001h,McBSP2_SPSD

STM XCERB,McBSP2_SPSA ;XCERB


STM #0001h,McBSP2_SPSD
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

STM XCERA,McBSP2_SPSA ;XCERA


STM #0001h,McBSP2_SPSD

STM SPCR1,McBSP2_SPSA
STM #0091h,McBSP2_SPSD ;Take 'em out of reset

NOP
NOP

STM SPCR2,McBSP2_SPSA
STM #00A1h,McBSP2_SPSD

;--------------------End of Serial Ports Initializations-----------------------

RSBX INTM

LD #017h,0,A
STLM A,IMR

STM #0h,McBSP0_DXR1
STM #0h,McBSP0_DXR2

STM #0007h,GPIOCR
STM #0003h,GPIOSR

STM #SPCR2,McBSP2_SPSA
STM #00E1h,McBSP2_SPSD ;Mclk

NOP
STM #0007h,GPIOSR

STM #SPCR2,McBSP0_SPSA
STM #00E1h,McBSP0_SPSD ;Sclk & Fs

;----------------------------------------------------------------------------
;-----------------------------Program Starts----------------------

STM #1000h,AR6 ;FFT I/p


STM #1800h,AR1 ;FFT O/p

SSBX SXM
RSBX OVM
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

LD #0h,0,A
RPT #127
STL A,*AR1+
STM #1800h,AR1

STM #3500h,AR7

WAIT NOP
NOP
LD CNT,B
BC FFT,BEQ
NOP
NOP
B WAIT

_RINT0_ISR
PSHM AL
PSHM AH
PSHM AG
PSHM BL
PSHM BH
PSHM BG

LD *AR6+,0,A
STLM A,McBSP0_DXR1 ;o/p for R Channel
STLM A,McBSP0_DXR2 ;o/p for L Channel

LD CNT,B
SUB #1h,0,B
STL B,0,CNT

POPM BG
POPM BH
POPM BL
POPM AG
POPM AH
POPM AL

RETE
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

FFT NOP
NOP
LD #0,A
STLM A,IMR

STM #1000h,AR6
STM #1800h,AR1

STM #2000h,AR4
STM #1000h,AR3

RPT #127
MVDD *AR4+,*AR3+

LD #R1,DP

NOP
LD #80h,A
STL A,CNT
NOP

PORTW E,0

;------------Bit Reversal-----------------------
;------------For 128 pt FFT The Index value is 128/2=64(40H)-------------------

STM #0040h,AR0 ;Index


STM #2400h,AR4 ;Bit reversed o/p
NOP
NOP

RPT #127
MVPD #2000h,*AR4+0B ;Bit Reversal

NOP
NOP

STM #2400h,AR5
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

LD #0h,0,A
STM #2800h,AR3
RPT #127
STL A,0,*AR3+

STM #3000h,AR3 ;TWIDDLE REAL


STM #3400h,AR4 ;TWIDDLE IMAG
STM #40h,BK

;--------------------------Butterfly Loop Begins------------------------------------

SU LD stages,0,A
LD grp,0,B
STL B,grp1

LD but,0,A
STM #2400h,AR5
STM #2800h,AR2

GU LD #40h,B
STLM B,BK

LD but,0,A
STL A,but1

LD #0h,0,B
SUB A,0,B
STL B,A1
STM #3000h,AR3
STM #3400h,AR4

BU LD #80h,B
STLM B,BK

LD *AR5,0,A
LD *AR2,0,B
STL A,0,R
STL B,0,I
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

LD but,0,A
STLM A,AR0
NOP
NOP
MAR *AR5+0%
MAR *AR2+0%

MPY *AR3,*AR5,A
MPY *AR4,*AR2,B
SUB B,0,A
STH A,R1

MPY *AR3,*AR2,A
MPY *AR4,*AR5,B
ADD A,0,B
STH B,I1

LD R,-1,A
LD R1,0,B
SUB B,0,A
STL A,*AR5

LD I,-1,A
LD I1,0,B
SUB B,0,A
STL A,*AR2
NOP
NOP
NOP
LD A1,0,B
STLM B,AR0
NOP
NOP

MAR *AR5+0%
MAR *AR2+0%

LD R,-1,A
LD R1,0,B
ADD B,0,A
STL A,*AR5+

LD I,-1,A
LD I1,0,B
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

ADD B,0,A
STL A,*AR2+ ;BUT

NOP
LD #40h,0,B
STLM B,BK

LD grp,0,A
STLM A,AR0
NOP
NOP
NOP
NOP
MAR *AR3+0%
MAR *AR4+0%

LD but1,0,B
SUB #1h,0,B
STL B,0,but1
BC BU,BNEQ ;;;;;Butterfly End

LD #80h,B
STLM B,BK
NOP
NOP
NOP
LD but,0,B
STLM B,AR0
NOP
NOP
MAR *AR5+0%
MAR *AR2+0%

LD grp1,0,B
SUB #1h,0,B
STL B,grp1
BC GU,BNEQ ;;;;;;;;Group End
NOP

LD but,0,B
SFTA B,1
STL B,but
STL B,but1

LD grp,0,B
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

SFTA B,-1
STL B,grp
STL B,grp1

LD stages,0,A
SUB #1h,0,A
STL A,stages
BC SU,ANEQ ;;;;;;;;;STAGES

LD #0h,0,A
LD #0h,0,B

;-------------------Initialization of Variables-----------------------

LD #7h,0,B
STL B,stages

LD #40h,0,A
STL A,grp

LD #1h,0,B
STL B,but

STM #2400h,AR3
STM #1800h,AR6
STM #7Fh,BRC
RPTB VE
LD *AR3+,A
ABS A
STL A,*AR6+
NOP
VE NOP
NOP
STM #1800h,AR6

LD #0017h,A
STLM A,IMR
NOP
NOP
B WAIT
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

RESULT:
Thus the finite impulse response (FIR) filter is successfully implemented and
verified.

ANNEXURE
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

TMS320C5416 DSP Multichannel Buffered Serial Port[McBSP] Configuration Using Chip


Support Library

Objective:
To configure the Multichannel Buffered Serial Port for a talk through program using the
chip support library.

Prerequisites
TMS320C5416 DSP Starter Kit, PC with Code Composer Studio, CRO, Audio Source,
Speakers and Signal Generator.

Procedure
• All the Real time implementations covered in the Implementations module follow
McBSP Configuration using chip support library.
• The Chip Support Library (CSL) is a collection of functions, macros, and symbols
used to configure and control on-chip peripherals.
• The goal is peripheral ease of use, shortened development time, portability,
hardware abstraction, and some level of standardization and compatibility among
TI devices.
• CSL is a fully scalable component of DSP/BIOS. It does not require the use of
other DSP/BIOS components to operate.

Steps:
1. Connect CRO to the Socket Provided for SPKR OUT.
2. Connect a Signal Generator to the LINE IN Socket.
3. Switch on the Signal Generator with a sine wave of frequency 500 Hz.
4. Now Switch on the DSK and Bring Up Code Composer Studio on the PC.
5. Create a new project with name McBSP_init.pjt.
6. From the File Menu new DSP/BIOS Configuration select “dsk5416.cdb”
and save it as “mcbsp_init.cdb” and add it to the current project.
7. Double click on the “mcbsp_init.cdb” from the project explorer and double click on
the “chip support library” explorer.
8. Double click on the “MCBSP” under the “chip support library” where you can see
“MCBSP Configuration Manager” and “MCBSP Resource Manager”.
9. Right click on the “MCBSP Configuration Manager” and select “Insert
mcbspCfg” where you can see “mcbspCfg0” appearing under “MCBSP
Configuration Manager”.
10. Right click on “mcbspCfg0” and select properties where “mcbspCfg0 properties”
window appears.
11. Under “General” property set “Breakpoint Emulation” to “Do Not Stop”.
12. Under “Transmit modes” property set “clock polarity” to “Falling Edge”.
13. Under “Transmit Lengths” property set “Word Length Phase1” to “32-bits” and
set “Words/Frame phase1” to “2”.
14. Under “Receive modes” property set “clock polarity” to “Rising Edge”.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

15. Under “Receive Multichannel” property set “Rx Channel Enable” to “All 128
Channels”.
16. Under “Transmit Multichannel” property set “Tx Channel Enable” to “All 128
Channels”.
17. Under the Receive Lengths property set “Word Length Phase1” to “32-bits” and set
“Words/Frame phase1” to “2”.
18. Under the “Sample-Rate Gen” property set “Generator Clock Source” to “BCLKR
pin”. Set “Frame Width” to “32” and “Frame period” to “64”.
19. Select “Apply” and click “O.K”.
20. Select “McBSP2” under the “MCBSP Resource Manager”.
21. Right click on “McBSP2” and select properties where a “McBSP2 Properties”
Window appears. Enable the “Open handle to McBSP” option and
Preinitialization” option. Select “msbspCfg0” under the “Pre-initialize” pop-up
menu and change the “Specify Handle Name” property to
“C54XX_DMA_MCBSP_hMcbsp”. Select “Apply” and click “O.K”.
22. Add the given “mcbsp_io.c” file to the current project which has the main function
and calls all the other necessary routines.
23. Add the generated “mcbsp_initcfg.cmd” file to the current project.
24. View the contents of the generated file “mcbsp_initcfg_c.c” and copy the include
header file at line 8 to the “mcbsp_io.c” file.
25. Add the library file “dsk5416f.lib” from the location
“C:\ti\C5400\dsk5416\lib\dsk5416f.lib” to the current project
26. Select projectbuild optionsCompilerAdvance and enable the “use Far
calls” option.
27. Build, Load and Run the program.
28. You can notice the input signal of 500 Hz. appearing on the CRO verifying the
McBSP configuration.
29. You can also pass an audio input and hear the output signal through the speakers.
30. You can also vary the sampling frequency using the DSK5416_PCM3002_setFreq
Function in the “mcbsp_io.c” file and repeat the above steps.

Conclusion:
The Multichannel Buffered Serial Port is successfully configured using the chip
support library and verified.

1.What are the advantages of DSP processor over Microprocessor?

i.Low Power requirement


ii.Cost
iii.Real time I/O capability
iv.Availability of High Speed On Chip memories

2.Define MAC.
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

Multipier Accumulator(MAC) which integrates multiplier and accumulator in single


hardware unit.This approach is used in Motorola DSP processors In Texas Instruments processor it
is to have the multiplier and accumulator separate. MAC operation can be completed in one clock
cycle.
3.Explain MACD.

Multiply Accumulate with Data Shift,multiplies the content of the program memory with
the content of the data memory with address dma and stores the result in the product register.The
content of the product register is added to the accumulator before the new product is
stored.Further,the content of dma is copied to the next location whose address is dma+1.

4.What is TMS320C5X?

It belongs to the Fifth Generation of the Texas Instruments TMS320 family of DSPs.It
consists of 16 bit fixed point and 32 bit floating point single chip DSPs.These DSPs posseses the
operational flexibility ofhigh speed controllers and the numerical capability of array processors.C
implies that CMOS technology is used.

5.What are the types of buses used inTMS320C5X architecture?

i.Program Bus
ii.ProgramAddress Bus
iii.Data Read Bus
iv.Data Read Address Bus

6.What Are the On chip Memory used in ‘C5X processor

i.Program Read Only Memory(ROM)


ii.Data/Program Dual Access RAM(DARAM)
iii.Data/Program Single Access RAM(SARAM)

7.Explian the elements in CALU.

Central arithmetic logic unit consists of 16 x 16 bit parallel multipier,artmetic logic


unit,accumulator(ACC),accumulator Buffer(ACCB),product register(PREG) each with 32 bits and
16 bits left barrel shifter and right barrel shifter.

8.What are the On Chip Peripherals used in ‘C5X?

i.Clock Generator
ii.Hardware Timer
iii.Software Programmable Wait State Generation
iv.Parallel I-O Ports
v.Host Port Interface
vi.Serial Port
SIT/ECE/2021-22/L5/ 15UEC727- SIGNAL PROCESSING LABORATORY

vii.Buffered Serial Port


viii.TDM Serial Port
ix.User Maskable Interrupts.

9.What are the Addressing Modes used in C5X?

i.Direct Addressing
ii.Memory mapped register addressing
iii.Indirect Addressing.
iv.Immediate Addressing
v.Dedicated register addressing
vi.Circular addressing

10..What are the operations performed in ‘C5X?

i.Fetching
ii.Decoding
iii.Reading
iv.Execution are the operations performed simultaneously using 4-phase clock.

11.What are the applications of PDSPs?


Digital Cell phones, automated inspection, voicemail, motor control, video conferencing,
noise cancellation, medical imaging, speech synthesis, satellite communication.

You might also like