ERODE SENGUNTHAR ENGINEERING COLLEGE
(Approved by AICTE - New Delhi, Permanently Affiliated to Anna University – Chennai,
Accredited by National Board of Accreditation (NBA), New Delhi and
National Assessment & Accreditation Council (NAAC), Bangalore with ‘A’ Grade)
Thudupathi (PO.), Perundurai, Erode – 638 057.
DEPARTMENT OF
ELECTRONICS AND COMMUNICATION
ENGINEERING
EC6511/8562
DSP LABORATORY
Prepared By
V.THAMIZHARASAN, AP/ECE
Name of the Subject with Code : EC6511-Digital Signal Processing Laboratory
Course Coordinator : V.Thamizharasan, AP / ECE
Academic Year : 2017-18 / Odd Semester
Year/ Semester : III / V Semester(B Section)
Branch : B.E. Electronics and Communication Engineering.
Course Objectives:
 To design and simulate/ implement Linear and Circular Convolution
 To design and simulate/ implement FIR , IIR and Multirate filters
 To generate and simulate / implement the different types of waveform
 To study the architecture of DSP processor
 To demonstrate Finite word length effect
Course outcomes:
 Carry out simulation of DSP systems
 Demonstrate their abilities towards DSP processor based implementation of DSP systems
 Analyze Finite word length effect on DSP systems
 Demonstrate the applications of FFT to DSP
 Implement adaptive filters for various applications of DSP
List of Experiments:
Cycle-I
Simulation using MATLAB software
1. a. Generation of signals
b. Correlation
2. Linear and Circular Convolutions
3. a. Sampling and effect of aliasing(Content Beyond syllabus)
b. FFT using DIT algorithm(Content Beyond syllabus)
4. Spectrum analysis using DFT
5. a. Design of Butterworth digital IIR filters
b. Design of chebychev digital IIR filters
6. Design of FIR filters using window
7. Design of Multirate filter
8. Design of Equalizer
Cycle-II
Implementation using TMS320C6713
9. Mac operation using addressing modes
10. Waveform generation
11. Convolution
12. Fast Fourier transform
13. FIR low pass filter
14. IIR low pass filter
15. Finite word length effect
Study of signal processing architecture
EX.NO:1a
DATE:
GENERATION OF SIGNALS
AIM:
To generate the signals like sine wave, cosine wave, ramp signal, unit step, impulse,
exponential wave using MAT Lab.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM:
 Start the program.
 Clear the command window and clear all the existing variables and functions.
 Close all the existing files in M-file.
 Get the choice to generate the signal.
 If the choice is to generate ramp signal, then get the length of the ramp and plot the signal
using stem.
 If the choice is to generate sine wave, assign the initial value of‘t’ to 0 and ending value
of ‘t’ to pi.
 Generate and plot the sine wave using sine function.
 If the choice is to generate cosine wave, assign the initial value of‘t’ to 0 and ending
value of ‘t’ to pi.
 Generate and plot the cosine wave using cosine function.
 If the choice is to generate unit step signal, assign the initial and final value of ‘t’ and
generate the unit step signal and then plot it.
 If the choice is to generate unit impulse signal, set the initial and final value of ‘t’.
 Generate the unit impulse signal using [zeros(1,10),ones(1,1),zeros(1,10)] and then plot
it.
 If the choice is to generate exponential signal, assign the initial and final value of ‘t’.
 Generate the exponential signal using function exp(t) and plot the signal.
 Stop the program.
Theory:
1. Sin signal:
An geometric waveform that
oscillates (moves up, down or side-to-
side) periodically, and is defined by the
function y = sin 2*π*f*t. In other
words, it is an s-shaped, smooth wave
that oscillates above and below zero.
2. Cos signal:
A cosine wave is a signal
waveform with a shape identical to that
of a sine wave , except each point on
the cosine wave occurs exactly 1/4
cycle earlier than the corresponding
point on the sine wave. A cosine wave
and its corresponding sine wave have
the same frequency, but the cosine
wave leads the sine wave by 90 degrees
of phase .
3. Unit step signal:
Unit step signal means the signal has
unit amplitude for positive axis and has
zero amplitude for negative axis.
u(n)= 1 for n ≥ 0
u(n)= 0 for n < 0
u(t)= 1 for t ≥ 0
u(t) = 0 for t < 0
4. Unit impulse signal:
A discrete time unit impulse function is
denoted by δ(n). Its amplitude is 1 at n=0
and for all other values of n; its amplitude
is zero.
δ(n)= 1 for n=0 otherwise zero
δ(t)= 1 for t=0 otherwise zero
5. Ramp signal:
A discrete time unit ramp signal is
denoted by r(n). its value increases
linearly with sample number n.
mathematically it is defined as,
r(n)= n for n ≥ 0
r(n) = 0 for n < 0
r(t) = 1 for t ≥ 0
r(t) = 0 for t < 0
6. Exponential signal:
The “exponential” signal literally
represents an exponentially increasing
or falling series:
x(t)=eαt
.Note that negative α values
result in a shrinking signal, whereas
positive values result in a growing
signal. The exponential signal models
the behavior of many phenomena, such
as the decay of electrical signals across
a capacitor or inductor. Positive α
values show processes with
compounding values, e.g. the growth of
money with a compounded interest
rate.
PROGRAM:
%GENERATION OF SIGNALS
clc;
clear all;
close all;
disp('Generation of signals');
disp('1)RAMP 2)SINE 3)COS 4)UNIT
STEP 5)IMPULSE
6)EXPONENTIAL');
choice=input('Enter the choice');
switch(choice)
case(1)
n=input('enter the ramp sequence');
t=0:n;
figure(1);
stem(t,t);
title('ramp signal');
xlabel('(a)-->');
ylabel('amp-->');
grid;
case(2)
t=0:.01:pi;
y=sin(2*pi*t);
figure(2);
plot(t,y);
title('sine wave');
xlabel('(b)-->');
ylabel('amp-->');
grid;
case(3)
t=0:.01:pi;
y=cos(2*pi*t);
figure(3);
plot(t,y);
title('cos wave');
xlabel('(c)-->');
ylabel('amp-->');
grid;
case(4)
t=0:0.011:10;
y=ones(1,10);
figure(4);
stem(y);
title('unit step');
xlabel('(d)-->');
ylabel('amp-->');
grid;
case(5)
n=-10:1:10;
y=[zeros(1,10),ones(1,1),zeros(1,10)];
figure(5);
stem(n,y);
title('impulse wave');
xlabel('(e)-->');
ylabel('amp-->');
grid;
case(6)
t=0:.01:5;
x=exp(t);
figure(6);
plot(t,x);
title('exponential wave');
xlabel('(f)-->');
ylabel('amp-->');
grid;
end;
Output:
Generation of signals
1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL
Enter the choice1
enter the ramp sequence15
.
Generation of signals
1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL
Enter the choice2
Generation of signals
1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL
Enter the choice3
Generation of signals
1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL
Enter the choice4
Generation of signals
1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL
Enter the choice5
Generation of signals
1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL
Enter the choice6
RESULT: The signals like sine wave, cosine wave, ramp signal, unit step, impulse and
exponential wave were generated using MAT lab and the output was verified.
EX.NO:1b.
DATE:
CORRELATION
AIM:
To write and simulate an cross & Auto Correlation for the given sequence using MATLAB.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM:
Step 1: Start
Step 2: Read the input sequence
Step 3: Perform auto correlation using the xcorr () function
Step 4: Plot the sequences
Step 5: Display the input & output sequences
Step 6: Stop
Theory:
Correlation is a statistical tool that helps to measure and analyze the degree of
relationship between two variables.
Auto correlation is correlation between the elements of a series and others from the same
series separated from them by a given interval.
Cross-correlation is a measure of similarity of two series as a function of the lag of one
relative to the other. This is also known as a sliding dot product or sliding inner-product.
Program:
clc;
close all;
clear all;
x=input('Enter the sequence 1: ');
h=input('Enter the sequence 2: ');
y=xcorr(x,x);
z=xcorr(x,h);
figure;
subplot(2,2,[1,3]);
stem(x);
ylabel('Amplitude');
xlabel('n');
title('Input sequence');
subplot(2,2,2);
stem(y);
ylabel('amplitude');
xlabel('n ');
title('Output for Auto correlation');
disp('The result of Auto correlation is ');
disp(y)
subplot(2,2,4);
stem(z);
ylabel('amplitude');
xlabel('n ');
title('Output for cross correlation');
disp('The result of cross correlation is ');
disp(z)
Crosscorrelation r
T
y t x t dtxy
T
  ( ) ( ) ( ) 
1
0
 
Autocorrelation r
T
x t x t dt
r i
N
x k x k i
xx
T
xx
  
 


( ) ( ) ( )
( ) ( )
 
1
1
0
k=1
N
Output:
Enter the sequence 1: [1 2 3 4]
Enter the sequence 2: [1 4 7 8]
The result of Auto correlation is
4.0000 11.0000 20.0000 30.0000 20.0000 11.0000 4.0000
The result of cross correlation is
8.0000 23.0000 42.0000 62.0000 42.0000 19.0000 4.0000
RESULT:
Thus the program for auto and cross correlation of a given sequence was calculated and the
output was displayed.
1 2 3 4
0
0.5
1
1.5
2
2.5
3
3.5
4
Amplitude?
n-->
Input sequence
0 2 4 6 8
0
5
10
15
20
25
30
amplitude
n-->
Output for Auto correlation
0 2 4 6 8
0
20
40
60
80
amplitude
n-->
Output for cross correlation
EX.NO:2
DATE:
LINEAR CONVOLUTION AND CIRCULAR CONVOLUTION
AIM:
To write and simulate a program for linear and circular convolution using MATLAB.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM FOR LINEAR CONVOLUTION:
 Start the program.
 Get the first sequence in “a” and second sequence in “b”.
 Convolute the two sequence a and b by conv(a,b).
 Store the convoluted result in c and also display the convoluted result.
 Plot the values of the two input sequences and the values of the convoluted output by
using appropriate instructions.
 Stop the program.
ALGORITHM FOR CIRCULAR CONVOLUTION:
 Start the program.
 Get the first sequence in a and second sequence in b.
 Find FFT of each sequence a and b by using fft(a) and fft(b) and store in C and d.
 Multiply c and d and find inverse FFT of this product and store in f.
 Store the convoluted result in c and also display the convoluted result.
 Plot the values of the two input sequences and the values of the convoluted output by
using appropriate instructions.
 Stop the program.
Theory:
Linear Convolution Circular convolution
1 If x(n) is a sequence of L No.of samples
and h(n) with M number of samples,
after convolution y(n) will contain
N=L+M-1
Ifx(n) is a sequence of L No.of samples
and h(n) with M samples after
convolution y(n) will contain
N=Max(L,M) samples
2. Linear convolution can be used to find
the response of a linear filter
Circular convolution cannot be used to
find the response of a filter.
3. Zero padding is not necessary to find the
response of a linear filter
Zero padding is necessary to find the
response of a filter
PROGRAM:
% LINEAR COVOLUTION
clc;
close all;
clear all;
a=input('Enter the first sequence=');
b=input('Enter the second sequence=');
c=conv(a,b);
disp('The convoluted output is');
disp(c);
L1=0:length(a)-1;
L2=0:length(b)-1;
L3=0:length(c)-1;
subplot(1,3,1);
stem(L1,a);
xlabel('TIME');
ylabel('AMPLITUDE');
title('FIRST INPUT SEQUENCE');
subplot(1,3,2);
stem(L2,b);
xlabel('TIME');
ylabel('AMPLITUDE');
title('SECOND INPUT SEQUENCE');
subplot(1,3,3);
stem(L3,c);
xlabel('TIME');
ylabel('AMPLITUDE');
title('CONVOLUTED OUTPUT');
% CIRCULAR COVOLUTION
clc;
close all;
clear all;
a=input('Enter the first sequence=');
b=input('Enter the second sequence=');
c=fft(a);
d=fft(b);
e=c.*d;
f=ifft(e);
disp('The convoluted output is');
disp(f);
L1=0:length(a)-1;
L2=0:length(b)-1;
L3=0:length(f)-1;
subplot(1,3,1);
stem(L1,a);
xlabel('TIME');
ylabel('AMPLITUDE');
title('FIRST INPUT SEQUENCE');
subplot(1,3,2);
stem(L2,b);
xlabel('TIME');
ylabel('AMPLITUDE');
title('SECOND INPUT SEQUENCE');
subplot(1,3,3);
stem(L3,f);
xlabel('TIME');
ylabel('AMPLITUDE');
title('CONVOLUTED OUTPUT');
OUTPUT FOR LINEAR CONVOLUTION:
Enter the first sequence=[1 2 3 4]
Enter the second sequence=[1 2 3 4]
The covoluted output is
1 4 10 20 25 24 16
OUTPUT FOR CIRCULAR CONVOLUTION:
Enter the first sequence=[4 5 6 3]
Enter the second sequence= [ 1 3 5 6]
The convoluted output is
73 68 59 70
RESULT: Thus the program for linear and circular convolution was executed successfully
using MATLAB
0 1 2 3
0
1
2
3
4
TIME
AMPLITUDE
FIRST INPUT SEQUENCE
0 1 2 3
0
1
2
3
4
TIME
AMPLITUDE
SECOND INPUT SEQUENCE
0 2 4 6
0
10
20
30
TIME
AMPLITUDE
CONVOLUTED OUTPUT
0 2 4
0
1
2
3
4
5
6
TIME
AMPLITUDE
FIRST INPUT SEQUENCE
0 2 4
0
1
2
3
4
5
6
TIME
AMPLITUDE
SECOND INPUT SEQUENCE
0 2 4
0
10
20
30
40
50
60
70
80
TIME
AMPLITUDE
CONVOLUTED OUTPUT
Ex.no:3a
Date:
SAMPLING AND EFFECT OF ALIASING
AIM:
 To perform sampling of a signal using mat lab.
 To analyse the effect of aliasing using mat lab.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM:
 Start the program.
 Clear the command window and clear all the existing variables and functions.
 Close all the existing files in M-file.
 Assign t=0 to 1 and f=5.
 Calculate s=sin(2*pi*f*t) and plot the sine wave.
 Calculate i=[1,ones(1,100)] and plot the impulse response.
 Calculate ss=s.*i and plot the sampling response.
 Stop the program.
PROGRAM:
a. SAMPLING
clc;
close all;
clear all;
t=0:0.01:1;
f=5;
s=sin(2*pi*f*t);
subplot(2,2,1);
plot(t,s,'r');
grid;
title('SINE WAVE');
xlabel('t--->');
ylabel('x(t)--->');
i=[1,ones(1,100)];
subplot(2,2,2);
stem(t,i);
grid;
title('IMPULSE RESPONSE');
xlabel('n--->');
ylabel('x(n)--->');
ss=s.*i;
subplot(2,2,3);
stem(t,ss,'g');
xlabel('n--->');
ylabel('x(n)--->');
title('SAMPLING RESPONSE');
grid;
ALGORITHM:
 Start the program.
 Clear the command window and clear all the existing variables and functions.
 Close all the existing files in M-file.
 Assign t=-10 to 10 ,T=3,fm=1/T ,fs1=1.6fm,fs2=2fm & fs3=8fm.
 Calculate x=cos(2*pi*f*t) and plot the cos wave.
 Plot the signal fs<fm using xn1=cos(2*pi*n1* fm/fs1).
 Plot the signal fs=fm using xn2=cos(2*pi*n2* fm/fs2).
 Plot the signal fs>fm using xn3=cos(2*pi*n3* fm/fs3).
 Stop the program.
Program:
EFFECT OF ALIASING
clc;
clear all;
close all;
t=-10:.01:10;
T=3;
fm=1/T;
x=cos(2*pi*fm*t);
fs1=1.6*fm;
fs2=2*fm;
fs3=10*fm;
n1=-10:1:10
xn1=cos(2*pi*n1*fm/fs1);
subplot(2,2,1);
plot(t,x);
xlabel('time in sec');
ylabel('x(t)');
title('continuous-time signal');
subplot(2,2,2);
stem(n1,xn1);
hold on
subplot(2,2,2);
plot(n1,xn1);
xlabel('n');
ylabel('x(n)');
title('discreate-time signal with fs<fm ');
n2=-10:1:10;
xn2=cos(2*pi*n2*fm/fs2);
subplot(2,2,3);
stem(n2,xn2);
hold on
subplot(2,2,3);
plot(n2,xn2);
xlabel('n');
ylabel('x(n)');
title('discreate -time signal with fs=fm');
n3=-10:1:10
xn3=cos(2*pi*n3*fm/fs3);
subplot(2,2,4);
stem(n3,xn3);
hold on
subplot(2,2,4);
plot(n3,xn3);
xlabel('n');
ylabel('x(n)')
title('discreate time signal with fs>fm');
THEORY:
Sampling theorem:
A band limited continuous time signal with maximum frequency Fm hertz can be fully recovered
from its samples provided that the sampling frequency Fs is greater than or equal to two times
the maximum frequency Fm.(Fm≥2*Fm).
Aliasing:
When the high frequency interferes with low frequency and appears as low frequency.
Different ways to avoid aliasing:
 Sampling rate fs≥2W
 Strictly Band limit the Signal to W
Nyquist rate: when the sampling rate becomes exactly equal to 2W samples/sec. for a given
bandwidth of W hertz.
Nyquist interval: It is the time interval between any two adjacent samples when sampling rate
is Nyquist rate.
OUTPUT FOR SAMPLING
OUTPUT FOR EFFECT OF ALIASING
RESULT:
The sampling of a signal and the effect of aliasing were performed using MAT LAB.
0 0.05 0.1 0.15 0.2
-1
-0.5
0
0.5
1
SINE WAVE
t--->
x(t)--->
0 0.05 0.1 0.15 0.2
0
0.2
0.4
0.6
0.8
1
IMPULSE RESPONSE
n--->
x(n)--->
0 0.05 0.1 0.15 0.2
-1
-0.5
0
0.5
1
n--->
x(n)--->
SAMPLING RESPONSE
Ex.no:3b
Date:
FFT USING DIT ALGORITHM
AIM:
To calculate the FFT and IFFT of the sequence using decimation in time algorithm.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM:
 Start the program.
 Clear the command window and clear all the existing variables and functions.
 Close all the existing files in M-file.
 Get the input sequence in bit reversal order.
 Calculate number of stages m=log2(n), where n is the N-point DFT.
 Calculate the twiddle factor.
 Find the FFT / IFFT of the sequence.
 Stop the program.
Theory:
The Fast Fourier transform (FFT) is an algorithm used to compute the DFT. It makes use
of the symmetry and periodicity properties of twiddle factor WN
k
to effectively reduce the
DFT computation time. It is based on the fundamental principle of decomposing the
computation of DFT of a sequence of length N into successively smaller discrete Fourier
transforms. The FFT algorithm provides speed –increase factors, when compared with direct
computation of the DFT, of approximately 64 and 205 for 256-point and 1024-point
transforms respectively. If the number of output points N can be expressed as a power of 2,
that is N=2M
, where M is an integer, then this algorithm is known as radix-2 FFT algorithm.
Decimation in time algorithm is used to calculate the DFT of an N-point sequence. The
idea is to break the N-point sequence into two sequences, the DFTs of which can be
combined to give the DFT of the original N-point sequence. Initially the N-point sequence is
divided into two-N/2 point sequence xe(n) and xo(n) ,which have even and odd members of
x(n) respectively.
The N/2 point DFTs of these two sequences are evaluated and combined to give the N-
point DFT. Similarly the N/2 point DFTs can be expressed as a combination of N/4 point
DFTs. This process is continued until we left with 2-point DFT. This process is continued
until we left with 2-point DFT. This algorithm is called Decimation in time because the
sequence x(n) is often splitted into smaller sequences.
Decimation in frequency algorithm the output sequence X(k) is divided into smaller and
smaller sub sequences, that is why the name decimation in frequency .Initially the input
sequence x(n) is divided into two sequences x1(n) and x2(n) consisting of the first N/2
samples of x(n) and the last N/2 samples of x(n) respectively
PROGRAM:
%FFT USING DIT
clc;
clear all;
close all;
disp('decimation in time');
disp('input in bit reversal order');
n=input('enter N point');
for i1=1:n;
x0(i1)=input('enter a number');
x1(i1)=0;
x2(i1)=0;
end;
m=log2(n);
for i=1:m;
p=n/(2^i);
q=n/p;
for j1=1:q:n;
r=j1;
for k=1:q/2;
a=x0(r);
b=x0(r+q/2);
w=cos(2*pi*(k-1)/q)-j*sin(2*pi*(k-1)/q);
c=a+b*w;
d=a-b*w;
x1(r)=c;
x1(r+q/2)=d;
r=r+1;
end;
end;
x0=x1;
x2=x1;
x1=0;
end;
disp('output');
disp('N point dft');
x2
OUTPUT:
Decimation in time
input in bit reversal order
enter N point 8
enter a number 0
enter a number 4
enter a number 2
enter a number 6
enter a number 1
enter a number 5
enter a number 3
enter a number 7
output
N point dft
x2 =
Columns 1 through 4
28.0000 -4.0000 + 9.6569i -4.0000 + 4.0000i -4.0000 + 1.6569i
Columns 5 through 8
-4.0000 -4.0000 - 1.6569i -4.0000 - 4.0000i -4.0000 - 9.6569i
RESULT:
The FFT of the sequence was calculated and the output was verified using MAT LAB.
Ex.no:4
Date:
SPECTRUM ANALYSIS USING DFT
AIM:
To plot and analysis the Magnitude and Phase spectrum of DFT using MAT LAB.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM:
 Start the program.
 Clear the command window and clear all the existing variables and functions.
 Close all the existing files in M-file.
 Get the N values of DFT and input sequence of DFT
 Calculate the twiddle factor.
 Calculate the value of DFT
 Plot the magnitude spectrum using abs command
 Plot the phase spectrum using angle command
 Stop the program.
THEORY:
The DFT is used to convert a finite discrete time sequence x(n) to an N point
frequency domain sequence(k).The N-point DFT of a finite sequence x(n) of length
L,(L<N) is defined as
N-1
x(k)= ∑ x(n)e-j2πnk/N
K=0,1,2,3,…N-1
n=0
Program:
clc;
clear all;
close all;
N=input('enter the value of N point dft');
x=input('enter the input value');
L=length(x);
if(L>N)
disp('N must be greather than or equal to L');
disp('Enter another set of value');
else
x1=[x zeros(1,N-L)];
for k=0:1:N-1;
for n=0:1:N-1;
p=exp(-i*2*pi*n*k/N);
x2(k+1,n+1)=p;
end
end
X=x1*x2;
X
figure;
k=0:1:N-1;
subplot(2,1,1);
stem(k,abs(X));
hold on
plot(k,abs(X));
xlabel('k');
ylabel('|x|');
title('Magnitude Response');
subplot(2,1,2)
stem(k,angle(X));
hold on
plot(k,angle(X));
xlabel('k');
ylabel('angle of x');
title('Phase Response');
end
Output:
enter the value of N point dft8
enter the input value[1 2 5 4]
X =
12.0000 -0.4142 - 9.2426i -4.0000 + 2.0000i 2.4142 + 0.7574i 0 - 0.0000i 2.4142
- 0.7574i -4.0000 - 2.0000i -0.4142 + 9.2426i
RESULT:
The magnitude and phase spectrum of DFT were obtained and the output was verified
using MAT LAB.
0 1 2 3 4 5 6 7
0
2
4
6
8
10
12
k
|x|
Magnitude Response
0 1 2 3 4 5 6 7
-3
-2
-1
0
1
2
3
k
angleofx
Phase Response
Ex.no:5a
Date:
DESIGN OF BUTTERWORTH DIGITAL IIR FILTERS
AIM:
To design Butterworth digital filters (LPF, HPF, BPF and BSF) using MATLAB.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM
1. Get the passband and stopband ripple
2. Get the passband and stopband edge frequencies
3. Get the sampling frequency
4. Calculate the order of the filter
5. Find the filter coefficients
6. Draw the magnitude and phase responses.
THEORY:
 The filter designed by considering all the infinite samples of impulse response are called
IIR filter. The IIR filters are of recursive type, where by present output sample depends
on the present input, past input and output samples.
 The magnitude response of Butterworth filter decreases monotonically as the frequency
Ω increases from 0 to ∞.
 The transition band is more in Butterworth filter.
 The poles of the Butterworth filter lies on a circle.
The magnitude function of the Butterworth filter is given by
H(jΩ) = 1/(1+( Ω/ Ωc) 2N
N=1,2,3……
where N is the order of the filter and Ωc is the cutoff frequency. The magnitude response of
the Butterworth filter closely approximates the ideal response as the order N increases. The
phase response becomes more non- linear as N increases.
Ex.no:5b
Date:
DESIGN OF CHEBYSHEV DIGITAL FILTERS
AIM:
To design Chebyshev digital filters (LPF, HPF, BPF and BSF) using MATLAB.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM
1. Get the passband and stopband ripple
2. Get the passband and stopband edge frequencies
3. Get the sampling frequency
4. Calculate the order of the filter
5. Find the filter coefficients
6. Draw the magnitude and phase responses.
THEORY:
 The filter designed by considering all the infinite samples of impulse response are called
IIR filter. The IIR filters are of recursive type, where by present output sample depends
on the present input, past input and output samples.
 There are two types of Chebychev filter.they are type-I & type-II filter.
 The magnitude response of the Chebychev filter exhibits ripple either in pass band or in
stop band according to type.
 The poles of the Chebychev filter lies on an ellipse.
 The frequency response curve starts from unity for odd values of N, and starts from
1/√ 1+є2
for even values of n.
 Magnitude of Chebychev filter decays at the rate of 20N dB/decade.
 For | Ω | ≤ 1, 2 varies between 1 and
 At cutoff frequency | Ω | = 1,

 Order of Chebyshev filter is
𝑁 ≥ cosh−1 √
100.1𝛼𝑠 − 1
100.1𝛼𝑝 − 1
/cosh−1
(
Ω𝑠
Ω𝑝
)
αs-stop band attenuation. αp-pass band attenuation
Ωs-stop band frequency, Ωp-pass band frequency.
RESULT:
Thus Butterworth and chebyshev digital filters (LPF, HPF, BPF and BSF) have been
designed and verified using MATLAB.
Ex.no:6
Date:
DESIGN OF FIR FILTERS USING WINDOW
AIM:
To design FIR filters using Hanning, Hanning and Kaiser window.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM:
1. Get the passband and stopband ripple
2. Get the passband and stopband edge frequencies
3. Get the sampling frequency
4. Calculate the order of the filter
5. Find the window coefficients
6. Draw the magnitude and phase responses.
THEORY:
Filter is a frequency selective device, which amplifies particular range of frequencies and
attenuate particular range of frequencies
The filter designed by selecting finite number of samples of impulse response (h (n)
obtained from inverse Fourier transform of desired frequency response H (w)) are called FIR
filters
 FIR filter is always stable.
 A realizable filter can always be obtained.
 FIR filter has a linear phase response.
 The necessary and sufficient condition for linear phase characteristics in FIR filter is the
impulse response h(n) of the system should have the symmetry property,
i.e., h(n) = h(N-1-n) Where N is the duration of the sequence.
 One possible ways of obtaining FIR filter is to truncate the infinite Fourier series at n=
±((N-1) /2) where N is the length of the desired sequence. But abrupt truncation of the
Fourier series results in oscillation in the pass band and stop band. These oscillations are
due to slow convergence of the Fourier series. To reduce these oscillations the Fourier
coefficient of the filter are modified by multiplying the infinite impulse response with a
finite weighing sequence w(n)
 The desirable characteristics of the window are
The central lobe of the frequency response of the window should contain most of the
energy and should be narrow.
The highest side lobe level of the frequency response should be small. The side lobes of
the frequency response should decrease in energy rapidly as ω tends to π.
RESULT:
Thus FIR filters using Hanning / Hamming / Kaiser Window has been designed and
verified using MATLAB.
Ex.no:7
Date:
DESIGN OF MULTIRATE FILTER
AIM:
To design Multirate filters using up sampling& down sampling.
TOOLS REQUIRED:
MAT LAB software
THEORY:
 Multirate signal processing is required in digital systems where more than one sampling
rate is required. In digital audio, the different sampling rates used are 32 kHz for
broadcasting, 44.1 kHz for compact disc and 48 kHz for audio tape. Different sampling
rates can be obtained using an up sampler and down sampler.
 The theory of processing signals at different sampling rates is called multirate signal
processing.
 The discrete time system that employs sampling rate conversion while processing the
discrete time signal is called multirate DSP system.
Down sampling:
Down sampling a sequence x (n) by a factor M is the process of picking every M th
sample and discarding the rest.
Up sampling:
Up sampling by a factor L is the process of inserting L-1 zeros between two consecutive
samples.
anti-aliasing filter
The low pass filter used at the input of decimator is called anti-aliasing filter. It is used to
limit the bandwidth of an input to π/D in order to prevent the aliasing of output spectrum
of decimator for decimation by D.
anti-imaging filter
The low pass filter used at the output of an interpolator is called anti-imaging filter. It is
used to eliminate the multiple images in the output spectrum of the interpolator.
Need for anti-aliasing filter prior to down sampling
The spectra obtained after down sampling a signal by a factor M is the sum of all the
uniformly shifted and stretched version of original spectrum scaled by a factor 1/M. if the
original spectrum is not band limited to π/M, then down sampling will cause aliasing. In
order to avoid aliasing the signal x(n) is to be band limited to ±π/M. this can be done by
filtering the signal x(n).with a low pass filter with a cutoff frequency of π/M. this filter is
known as anti-aliasing filter.
Need for anti-imaging filter after upsampling a signal
The frequency spectrum of upsampled signal with na factor L, contains (L-1) additional
images of the input spectrum .since we are not interested in images spectra, a low filter
with a cutoff frequency ωc=π/L can be used after upsampler. This filter is known as anti –
imaging filter.
UPSAMPLING/DOWNSAMPLING
clc;
clear all;
close all;
N=input('enter the value of N:');
n=0:1:N-1;
x=input('enter the value:');
L=input('enter the value of up sampling
factor');
M=input('enter the value of down sampling
factor');
x1=[zeros(1,L*N)];
n1=1:1:L*N;
j=1:L:L*N;
x1(j)=x;
subplot(2,2,1);
stem(n,x);
xlabel('n-->');
ylabel('x->');
title('input sequence');
subplot(2,2,2);
stem(n1,x1);
xlabel('n1--->');
ylabel('x1');
title('upsampled sequence');
x2=x(1:M:N);
n2=1:1:N/M;
subplot(2,2,[3:4]);
stem(n2-1,x2);
xlabel('n2--->');
ylabel('x2');
title('dwonsampled sequence');
OUTPUT FOR UP/DOWN SAMPLING
0 2 4 6 8
0
2
4
6
8
10
n-->
x->
input sequence
0 10 20 30
0
2
4
6
8
10
n1--->
x1
upsampled sequence
0 0.5 1 1.5 2 2.5 3
0
2
4
6
8
10
n2--->
x2
dwonsampled sequence
ANTI IMAGING FILTER
clc;
close all;
clear all;
n=0:1:1023;
x=1/4*sinc(1/4*(n-512)).^2;
i=1:1024;
y=[zeros(1,2048)];
y(2*i)=x;
f=-2:1/512:2;
h1=freqz(x,1,2*pi*f);
h2=freqz(y,1,2*pi*f);
subplot(3,1,1);
plot(f,abs(h1));
xlabel('frequency');
ylabel('magnitude');
title('frequency response of input sequence');
subplot(3,1,2);
plot(f,abs(h2));
xlabel('frequency');
ylabel('magnitude');
title('frequency response of upsampled input
sequence');
p=fir1(127,.3);
xf=filter(p,1,y);
h4=freqz(xf,1,2*pi*f);
subplot(3,1,3);
plot(f,abs(h4));
title('frequency response of output of anti
imaging filter');
xlabel('frequency');
ylabel('magnitude');
OUTPUT FOR ANTI IMAGING FILTER
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.5
1
frequency
magnitude
frequency response of input sequence
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.5
1
frequency
magnitude
frequency response of upsampled input sequence
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.5
1
frequency response of output of anti imaging filter
frequency
magnitude
ANTI ALIASING FILTER
clc;
clear all;
close all;
F=input('enter the highest normalised frequency component');
D=input('enter the decimation factor');
n=0:1:1024;
%input sequence
xd=F/2*sinc(F/2*(n-512)).^2;
f=-2:1/512:2;
h1=freqz(xd,1,pi*f);%frequency response
subplot(3,1,1),plot(f,abs(h1))
xlabel('frequency'),ylabel('magnitude')
title('frequency response of input sequence');
%checking for aliasing
if(F*D<=1)
xd1=F/2*sinc(F/2*(n-512)*D).^2;
h2=freqz(xd1,1,pi*f*D);
subplot(3,1,2),plot(f,abs(h2))
axis([-2 2 0 1])
h2=freqz(xd1,1,pi*f*D);
subplot(3,1,3),plot(f*D,abs(h2))
axis([-2*D 2*D 0 1])
else
%design an antialising filter
p=fir1(127,1/D);%filter
xf=filter(p,1,xd);
h4=freqz(xf,1,pi*f);%output of filter
subplot(3,1,2),plot(f,abs(h4))
title('frequency response of output of antialising filter')
xlabel('frequency'),ylabel('magnitude')
i=1:1:1024/D;
xr=xf(i*D);%output of down sampler
h5=freqz(xr,1,pi*f*D);%frequency response at the output of down sampler
subplot(3,1,3),plot(f*D,abs(h5))
title('frequency response at the output of down sampler')
xlabel('frequency'),ylabel('magnitude')
end
OUTPUT FOR ANTI ALIASING FILTER
enter the highest normalised frequency component0.25
enter the decimation factor5
Result:
Thus the Multirate filter (anti aliasing & anti imaging) were designed using MATLAB
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.5
1
frequency
magnitude
frequency response of input sequence
-2 -1.5 -1 -0.5 0 0.5 1 1.5 2
0
0.5
1
frequency response of output of antialising filter
frequency
magnitude
-10 -8 -6 -4 -2 0 2 4 6 8 10
0
0.05
0.1
0.15
0.2
frequency response at the output of down sampler
frequency
magnitude
Ex.no:8
Date:
DESIGN OF EQUALIZER
AIM:
To design equalizer using MATLAB.
TOOLS REQUIRED:
MAT LAB software
ALGORITHM:
1. Get the simulation and channel length.
2. Calculate the cascade impulse response and transmitting signal
3. Calculate channel output and input of the channel equalizer.
4. Apply the NMLS algorithm for channel equalization.
5. Draw the responses of channel equalizer.
THEORY:
The equalizer is a device that attempts to reverse the distortion incurred by a signal
transmitted through a channel. In digital communication its purpose is to reduce inter symbol
interference to allow recovery of the transmit symbols. It can be a simple linear filter or a
complex algorithm.
The types of commonly used equalizers in digital communications are:
 Linear Equalizer: It processes the incoming signal with a linear filter.
 MSME equalizer: It designs the filter to minimize E[|e|2], where e is the error signal that
is the filter output minus the transmitted signal.
 Zero forcing Equalizer: It approximates the inverse of the channel with a linear filter.
 Decision feedback equalizer: It augments a linear equalizer by adding a filtered version
of previous symbol estimates to the original filter output filter.
Blind Equalizer: It estimates that the transmitted signal without knowledge of the channel
statistics and uses only knowledge of the transmitted signal’s statistics.
 Adaptive Equalizer: It is typically a linear equalizer or a DFE, which updates the
equalizer parameters (such as the filter coefficients) as it is processes the data. It uses the
MSE cost function and it assumes that it makes the correct symbol decisions and uses its
estimate of the symbols to compute e which is defined above.
 Viterbi Equalizer: It Finds the optimal solution to the equalization problem. It is having
a goal to minimize the probability of making an error over the entire sequence.
 BCJR Equalizer: It uses the BCJR algorithm whose goal is to minimize the probability
that a given bit was incorrectly estimated.
 Turbo Equalizer: It applies turbo decoding while treating the channel as a convolutional
code.
Program:
CHANNEL EQUALIZER
clear all
close all
clc
%simulation length
N = 1000;
%channel length
M = 5;
%number of independent trials
T = 100;
cascade_impulse_response =
zeros(1,2*M-1);
for j = 1 : T
%training signal
u = randn(1,N)
%channel to be equalized
c = randn(M,1);
c = c / norm(c);
%channel output
z = filter(c,1,u);
%additive noise to the channel output
SNR = 30;
var_v = var(z) * 10^(-SNR/10);
v = var_v^0.5 * randn(1,N);
%input to the equalizer
x = z + v;
%NLMS channel equalization
w = zeros(M,1);
x_regressor = zeros(1,M);
step = 0.1;
epsilon = 10^(-6);
for k = 4 : N
x_regressor = [x(k) x_regressor(1:M-1)];
e = u(k-3) - x_regressor * w;
w = w + step * x_regressor' * e /
(x_regressor * x_regressor' + epsilon);
end
cascade_impulse_response =
cascade_impulse_response + conv(w,c)';
display(j);
end
figure;
stem(cascade_impulse_response/T);
title('cascade channel-equalizer impulse
response');
xlabel('taps');
OUTPUT FOR CHANNEL EQUALIZER
Result:
Thus the channel equalizer were designed using MATLAB
1 2 3 4 5 6 7 8 9
-0.1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
cascade channel-equalizer impulse response
taps
WORKING PROCEDURE FOR TMS320C6713
 Open the vi universal debugger window.
 Click projectnew project and give the name to the new project.
 Then click file newasm file.
 Type the program.
 Save the program. Note file type should be asm file.
 Projectadd file to project by browsing add our asm file and add the command file to
our project by selecting projectadd file to project, command file on type and click
micro6713 and open.
 Select projectbuild (Wait for compilation of the program).
 If program contains no error, click ok. Then click serialport setting and click auto
detect to detect any hardware connected pc.
 Click serialload program by browsing select our file which is to be downloaded to the
kit.
 To run the program select serial communication window.
 To execute type GO 00006000.
 Verify the output by using the SP command.(For Example. SP 80009000).
EX.NO:9
DATE:
MAC OPERATION USING ADDRESSING MODES
AIM:
To study about direct, indirect and immediate addressing modes in TMS320C6713
debugger.
APPARATUS REQUIRED:
 System with TMS 320C6713 debugger software
 TMS 320C6713 Kit.
Program:
Addition:
.text
start:
mvkl .s1 2222h,a5
mvkh .s1 0000h,a5
mvkl .s1 1111h,a10
mvkh .s1 0000h,a10
add a5,a10,a5
mvkl 0x80009000,b4
mvkh 0x80009000,b4
stw a5,*b4
nop 4
.end
Input:
Reg.a5= 0000 2222
Reg.a10= 0000 1111
Output:
80009000h=0000 3333
Subtraction:
.text
start:
mvkl .s1 3333h,a5
mvkh .s1 0000h,a5
mvkl .s1 1111h,a10
mvkh .s1 0000h,a10
sub a5,a10,a5
mvkl 0x80009000,b4
mvkh 0x80009000,b4
stw a5,*b4
nop
nop 4
.end
Input:
Reg.a5= 0000 2222
Reg.a10= 0000 1111
Output:
80009000h=0000 1111
Multiplication:
.text
start:
mvkl .s1 3333h,a5
mvkh .s1 0000h,a5
mvkl .s1 1111h,a10
mvkh .s1 0000h,a10
mpy a5,a10,a5
mvkl 0x80009000,b4
mvkh 0x80009000,b4
stw a5,*b4
nop
nop 4
hlt: b hlt
nop
nop
nop
nop 6
.end
Input:
Reg.a5= 0000 2222
Reg.a10= 0000 1111
Output:
80009000h=0246 8642
Result:
Thus the programs for addition, subtraction and multiplication operations were
performed using different addressing modes in TMS320C6713 processor.
EX.NO:10
DATE:
WAVEFORM GENERATION USING
TMS320C6713
AIM:
To generate a signals like saw tooth, sin, square & triangular waveform using
TMS320C6713.
Tools required:
1. PC
2. C6713 KIT
3. CRO
PROGRAM:
SQUARE WAVE:
.SECT "06000h"
.text
DAC1 .set 90040008h
start:
mvkl .s1 DAC1,a0
mvkh .s1 DAC1,a0
nop
mvkl 00000000h,a5
mvkh 00000000h,a5
nop
nop
mvkl 150h,b2
nop
positive:
nop
stw .d1 a5,*a0
nop
nop
sub b2,1,b2
nop
NOP
[b2] b positive
nop
nop
mvkl .s1 DAC1,a0
mvkh .s1 DAC1,a0
nop
mvkl 00000fffh,a5
mvkh 00000fffh,a5
nop
nop
mvkl 150h,b2
nop
negative:
nop
stw .d1 a5,*a0
nop
nop
sub b2,1,b2
nop
NOP
[b2] b negative
nop
nop
nop
nop
nop
nop
b start
.end
SAWTOOTH WAVE:
.
sect "06000h"
.text
dac1 .set 90040008h
start:
mvkl .s1 dac1,a0
mvkh .s1 dac1,a0
nop
mvkl 00000fffh,a5
mvkh 00000fffh,a5
nop
nop
mvkl 333h,b2
next:
nop
stw .d1 a5,*a0
nop 5
sub b2,1,b2
nop
sub a5,5,a5
nop
[b2] b next
nop
nop
nop
nop
nop
nop
nop
b start
.end
************************************************************************
TRIANGULAR WAVE:
.sect"06000h"
.text
dac1 .set 90040008h
start:
mvkl .s1 dac1,a0
mvkh .s1 dac1,a0
nop
mvkl 00000000h,a5
mvkh 00000000h,a5
nop
nop
mvkl 85h,b2
nop
positive:
nop
stw .d1 a5,*a0
nop
nop
sub b2,1,b2
nop
add a5,5,a5
nop
[b2]b positive
nop
nop
mvkl .s1 dac1,a0
mvkh .s1 dac1,a0
nop
mvkl 85h,b2
nop
negative:
nop
stw .d1 a5,*a0
nop
nop
sub b2,1,b2
nop
nop
sub a5,5,a5
nop
[b2]b negative
nop
nop
nop
nop
nop
nop
b start
.end
SIN WAVE:
.
sect "06000h"
.text
dac1 .set 90040008h
start:
nop
mvkl table,a0
mvkh table,a0
nop
mvkl dac1,a1
mvkh dac1,a1
nop
mvkl 0174h,b1
nop
loop1:
ldw .d1 *a0++[1],a2
nop 5
stw .d1 a2,*a1
nop 5
sub b1,1,b1
nop
[b1] b loop1
nop
nop 6
b start
nop
nop 6
hlt:
b hlt
nop
nop 6
table:
.word 07ffh
.word 0815h
.word 082ch
.word 0842h
.word 0859h
.word 0870h
.word 0886h
.word 089dh
.word 08b3h
.word 08cah
.word 08e0h
.word 08f6h
.word 090dh
.word 0923h
.word 0939h
.word 094fh
.word 0965h
.word 097bh
.word 0990h
.word 09a6h
.word 09bbh
.word 09d1h
.word 09e6h
.word 09fbh
.word 0a10h
.word 0a25h
.word 0a3ah
.word 0a4eh
.word 0a25h
.word 0a62h
.word 0a77h
.word 0a8bh
.word 0a9eh
.word 0ab2h
.word 0ac5h
.word 0ad9h
.word 0aech
.word 0afeh
.word 0b11h
.word 0b23h
.word 0b36h
.word 0b47h
.word 0b59h
.word 0b6bh
.word 0b7ch
.word 0b8dh
.word 0b9eh
.word 0baeh
.word 0bbeh
.word 0bceh
.word 0bdeh
.word 0bedh
.word 0bfch
.word 0c0bh
.word 0c1ah
.word 0c28h
.word 0c36h
.word 0c43h
.word 0c51h
.word 0c5eh
.word 0c6ah
.word 0c77h
.word 0c83h
.word 0c8fh
.word 0c9ah
.word 0ca5h
.word 0cb0h
.word 0cbbh
.word 0cc5h
.word 0cceh
.word 0cd8h
.word 0ce1h
.word 0ceah
.word 0cf2h
.word 0cfah
.word 0d02h
.word 0d09h
.word 0d10h
.word 0d17h
.word 0d1dh
.word 0d23h
.word 0d28h
.word 0d2dh
.word 0d32h
.word 0d37h
.word 0d3bh
.word 0d3eh
.word 0d42h
.word 0d45h
.word 0d47h
.word 0d49h
.word 0d4bh
.word 0d4dh
.word 0d4eh
.word 0d4eh
.word 0d4eh
.word 0d4eh
.word 0d4eh
.word 0d4dh
.word 0d4ch
.word 0d4ah
.word 0d48h
.word 0d46h
.word 0d43h
.word 0d40h
.word 0d3dh
.word 0d39h
.word 0d34h
.word 0d30h
.word 0d2bh
.word 0d26h
.word 0d20h
.word 0d1ah
.word 0d13h
.word 0d0dh
.word 0d05h
.word 0cfeh
.word 0cf6h
.word 0ceeh
.word 0ce5h
.word 0cdch
.word 0cd3h
.word 0ccah
.word 0cc0h
.word 0cb5h
.word 0cabh
.word 0ca0h
.word 0c94h
.word 0c89h
.word 0c7dh
.word 0c71h
.word 0c64h
.word 0c57h
.word 0c4ah
.word 0c3dh
.word 0c2fh
.word 0c21h
.word 0c12h
.word 0c04h
.word 0bf5h
.word 0be5h
.word 0bd6h
.word 0bc6h
.word 0bb6h
.word 0ba6h
.word 0b95h
.word 0b84h
.word 0b73h
.word 0b62h
.word 0b50h
.word 0b3eh
.word 0b2ch
.word 0b1ah
.word 0b08h
.word 0af5h
.word 0ae2h
.word 0acfh
.word 0abch
.word 0aa8h
.word 0a94h
.word 0a80h
.word 0a6ch
.word 0a58h
.word 0a44h
.word 0a2fh
.word 0a1ah
.word 0a06h
.word 09f1h
.word 09dbh
.word 09c6h
.word 09b1h
.word 099bh
.word 0985h
.word 0970h
.word 095ah
.word 0944h
.word 092eh
.word 0918h
.word 0901h
.word 08ebh
.word 08d5h
.word 08beh
.word 08a8h
.word 0891h
.word 087bh
.word 0864h
.word 084eh
.word 0837h
.word 0820h
.word 080ah
.word 07f4h
.word 07ddh
.word 07c7h
.word 07b0h
.word 0799h
.word 0783h
.word 076ch
.word 0756h
.word 073fh
.word 0729h
.word 0713h
.word 06fch
.word 06e6h
.word 06d0h
.word 06bah
.word 06a4h
.word 068eh
.word 0678h
.word 0663h
.word 064dh
.word 0638h
.word 0622h
.word 060dh
.word 05f8h
.word 05e3h
.word 05cfh
.word 05bah
.word 05a6h
.word 0591h
.word 057dh
.word 0569h
.word 0556h
.word 0542h
.word 052fh
.word 051ch
.word 0509h
.word 04f6h
.word 04e4h
.word 04d1h
.word 04bfh
.word 04aeh
.word 049ch
.word 048bh
.word 047ah
.word 0469h
.word 0458h
.word 0448h
.word 0438h
.word 0428h
.word 0418h
.word 0409h
.word 03fah
.word 03ech
.word 03ddh
.word 03cfh
.word 03c1h
.word 03b4h
.word 03a7h
.word 039ah
.word 038dh
.word 0381h
.word 0375h
.word 0369h
.word 035eh
.word 0353h
.word 0349h
.word 033eh
.word 0334h
.word 032bh
.word 0322h
.word 0319h
.word 0310h
.word 0308h
.word 0300h
.word 02f8h
.word 02f1h
.word 02ebh
.word 02e4h
.word 02deh
.word 02d8h
.word 02d3h
.word 02ceh
.word 02c9h
.word 02c5h
.word 02c1h
.word 02beh
.word 02bbh
.word 02b8h
.word 02b6h
.word 02b4h
.word 02b2h
.word 02b1h
.word 02b0h
.word 02b0h
.word 02b0h
.word 02b0h
.word 02b0h
.word 02b2h
.word 02b3h
.word 02b5h
.word 02b7h
.word 02b9h
.word 02bch
.word 02c0h
.word 02c3h
.word 02c7h
.word 02cch
.word 02d1h
.word 02d6h
.word 02dbh
.word 02e1h
.word 02e7h
.word 02eeh
.word 02f5h
.word 02fch
.word 0304h
.word 030ch
.word 0314h
.word 031dh
.word 0326h
.word 0330h
.word 0339h
.word 0344h
.word 034eh
.word 0359h
.word 0364h
.word 036fh
.word 037bh
.word 0387h
.word 0394h
.word 03a0h
.word 03adh
.word 03bbh
.word 03c8h
.word 03d6h
.word 03e5h
.word 03f3h
.word 0402h
.word 0411h
.word 0430h
.word 0440h
.word 0450h
.word 0461h
.word 0471h
.word 0482h
.word 0494h
.word 04a5h
.word 04b7h
.word 04c9h
.word 04dbh
.word 04edh
.word 0500h
.word 0513h
.word 0526h
.word 0539h
.word 054ch
.word 0560h
.word 0574h
.word 0588h
.word 059ch
.word 05b0h
.word 05c5h
.word 05d9h
.word 05eeh
.word 0603h
.word 0618h
.word 062dh
.word 0643h
.word 0658h
.word 066eh
.word 0683h
.word 0699h
.word 06afh
.word 06c5h
.word 06dbh
.word 06f2h
.word 0708h
.word 071eh
.word 0734h
.word 074bh
.word 0761h
.word 0778h
.word 078eh
.end
Output signal Amplitude Time period
Square
Triangular
Saw tooth
Sin
RESULT:
The signals like sine, square, triangular & saw tooth wave forms were generated using
TMS320C6713 and the output was verified.
Ex.no:11
Date:
CONVOLUTION
AIM:
To calculate linear and circular convolution using TMS320C6713.
Tools required:
1. PC
2. C6713 KIT
PROGRAM:
a. Linear convolution:
input .set 80001000h ; 00009000h ;
coeff .set 80001100h ; 00009050h ;
output .set 80001200h ; 00009100h ;
buff .set 80001300h ; 00009200h ;
.sect "00006000h"
.text
mvkl input,a4
mvkh input,a4
mvkl coeff,a5
mvkh coeff,a5
add a4,10h,a4
nop 2
add a5,10h,a5
nop 2
mvkl buff,a3
mvkh buff,a3
mvkl output,a6
mvkh output,a6
mvkl 8,b2
mvkh 8,b2
zer:
mvkl 00000000h,a2
mvkh 00000000h,a2
stw a2,*a3++
nop 7
stw a2,*a4++
nop 7
stw a2,*a5++
nop 7
stw a2,*a6++
nop 7
sub b2,1h,b2
nop 2
[b2] b zer
nop 6
mvkl input,a4
mvkh input,a4
mvkl 7h,b1
mvkh 7h,b1
mvkl output,a9
mvkh output,a9
start1:
mvkl coeff,a1
mvkh coeff,a1
mvkl buff,a3
mvkh buff,a3
ldw *a4++[1],a8
nop 6
stw a8,*a3
nop 6
mvkl 4,b0
mvkh 4,b0
nop 3
mvkl 00000000H,a7
mvkh 00000000H,a7
loop1:
ldw *a1++,a5
nop 6
ldw *a3++,a6
nop 6
mpy a5,a6,a6
nop 4
add a7,a6,a7
nop 2
sub b0,1,b0
nop 2
[b0] b loop1
nop 7
stw a7,*a9++[1]
nop 6
mvkl 4,b0
mvkh 4,b0
mvkl buff,b3
mvkh buff,b3
ldw *b3,b4
nop 6
loop2: ; loop to copy x(n) to x(n-1)
ldw *+b3(4),b5
nop 6
stw b4,*++b3
nop 6
mv b5,b4
nop 2
sub b0,1,b0
nop 2
[b0]b loop2
nop 6
sub b1,1,b1
nop 2
[b1]b start1
nop 7
halt:
b halt
nop 7
INPUT/OUTPUT:
S.NO INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
INPUT1:X(N)
80001000 00000001 80001200 00000001
80001004 00000002 80001204 00000004
80001008 00000003 80001208 0000000A
8000100C 00000004 8000120C 00000014
INPUT2:H(N) 80001210 00000019
80001100 00000001 80001214 00000018
80001104 00000002 80001218 00000010
80001108 00000003
8000110C 00000003
b. Circular convolution:
.sect "00006000h"
.text
value1 .SET 80001000H ; input value1
value2 .SET 80001100H ; input value2
OMEM .SET 80001200H ; output values
IMEM .SET 80001500H ; intermediate
start:
mvkl value1,a12
mvkh value1,a12
mvkl value2,a13
mvkh value2,a13
add a12,10h,a12
add a13,10h,a12
nop 2
mvkl 8h,b0
mvkh 8h,b0
zero a5
filzer:
stw a5,*a12++[1]
nop 5
stw a5,*a12++[1]
nop 5
sub b0,1,b0
nop 2
[b0]b filzer
nop 7
mvkl IMEM,a12
mvkh IMEM,a12
nop
mvkl value2,a13
mvkh value2,a13
nop
mvkl 4,b0
mvkh 4,b0
nop
another:
ldw *a13++[1],a4
nop 6
stw a4,*a12++[1]
nop 5
sub b0,1,b0
nop
[b0] b another
nop
nop 5
mvkl IMEM,a14
mvkh IMEM,a14
nop
ldw *++a14[1],a4
nop 5
ldw *++a14[2],a5
nop 5
stw a4,*a14--[2]
nop
nop 5
stw a5,*a14
nop
nop 5
mvkl OMEM,a10
mvkh OMEM,a10
nop
mvkl 4,b2
mvkh 4,b2
nop
nextdata:
mvkl IMEM,a11
mvkh IMEM,a11
nop
mvkl value1,a12
mvkh value1,a12
nop
mvkl 4,b0
mvkh 4,b0
nop
mvkl 0,a9
mvkh 0,a9
nop
next:
ldw *a11++[1],a4
nop 6
ldw *a12++[1],a5
nop 6
mpy a4,a5,a6
nop 3
add a6,a9,a9
nop 3
sub b0,1,b0
nop 3
[b0] b next
nop
nop 5
stw a9,*a10++[1]
nop
nop 5
mvkl back,b11
mvkh back,b11
nop
b shift
nop
nop 5
back:
sub b2,1,b2
nop 3
[b2] b nextdata
nop
nop 5
halt:
b halt
nop
nop 5
shift:
mvkl IMEM,a5
mvkh IMEM,a5
nop
mvkl 3,b1
mvkh 3,b1
nop
ldw *++a5[3],a4
nop 6
mvkl IMEM,a5
mvkh IMEM,a5
nop
add a5,8H,a5
nop 2
shloop:
ldw *a5++[1],a6
nop 6
stw a6,*a5--[2]
nop 6
sub b1,1,b1
nop
[b1] b shloop
nop
nop 6
mvkl IMEM,a5
mvkh IMEM,a5
nop
stw a4,*a5
nop 6
b b11
nop
nop 6
INPUT/OUTPUT:
S.NO INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
INPUT1:x1(N)
80001000 00000004 80001200 00000018
80001004 00000003 80001204 00000016
80001008 00000002 80001208 00000018
8000100C 00000001 8000120C 0000001e
INPUT2:x2(N)
80001100 00000001
80001104 00000002
80001108 00000003
8000110C 00000004
RESULT: Thus the Linear and circular convolution was designed using TMS320C6713 and
the output was verified.
Ex.no:12
Date:
FAST FOURIER TRANSFORM
AIM:
To calculate N point FFT of signal using TMS320C6713.
Tools required:
1. PC
2. C6713 KIT
PROGRAM:
.sect "00006000h"
.text
NVAL .SET 80001000H
MEMORY .SET 80001100H ; Data input
MEMREAL .SET 80001500H ; Real output
MEMIMAG .SET 80002500H ; Imaginary output
MEMORY1 .SET 80003000H
MEMWRI .SET 80003500H
BFY .SET 80004200H
GRP .SET 80004210H
DNS .SET 80004220H
STG .SET 80004230H
STGC .SET 80004240H
B0VAL .SET 80004600H
tabcos .set 80005100h
tabsin .set 80005200h
main:
mvkl NVAL,a10
nop
mvkh NVAL,a10
nop
ldw *a10,b9
nop 6
cmpeq b9,2,b0
nop
[b0] b neqtwo
nop
nop 6
cmpeq b9,4,b0
nop
[b0] b neqfour
nop
nop 6
cmpeq b9,8,b0
nop
[b0] b neqeight
nop
nop 6
mvkl 16,b6
nop
mvkh 16,b6
nop
cmpeq b9,b6,b0
nop
[b0] b neqsix
nop
nop 6
mvkl 32,b6
nop
mvkh 32,b6
nop
cmpeq b9,b6,b0
nop
[b0] b neqthirty
nop
nop 6
mvkl 64,b6
nop
mvkh 64,b6
nop
cmpeq b9,b6,b0
nop
[b0] b neqsixty
nop
nop 6
b ncomplete
nop
nop 6
neqtwo:
mvkl tabcos2,a2
nop
mvkh tabcos2,a2
nop
mvkl tabcos,a3
nop
mvkh tabcos,a3
nop
stw a2,*a3
nop 6
mvkl tabsin2,a2
nop
mvkh tabsin2,a2
nop
mvkl tabsin,a3
nop
mvkh tabsin,a3
nop
stw a2,*a3
nop 6
mvkl B0VAL,a2
nop
mvkh B0VAL,a2
nop
mvkl 1,a3
nop
mvkh 1,a3
nop
stw a3,*a2
nop 6
b ncomplete
nop
nop 6
neqfour:
mvkl tabcos4,a2
nop
mvkh tabcos4,a2
nop
mvkl tabcos,a3
nop
mvkh tabcos,a3
nop
stw a2,*a3
nop 6
mvkl tabsin4,a2
nop
mvkh tabsin4,a2
nop
mvkl tabsin,a3
nop
mvkh tabsin,a3
nop
stw a2,*a3
nop 6
mvkl B0VAL,a2
nop
mvkh B0VAL,a2
nop
mvkl 2,a3
nop
mvkh 2,a3
nop
stw a3,*a2
nop 6
b ncomplete
nop
nop 6
neqeight:
mvkl tabcos8,a2
nop
mvkh tabcos8,a2
nop
mvkl tabcos,a3
nop
mvkh tabcos,a3
nop
stw a2,*a3
nop 6
mvkl tabsin8,a2
nop
mvkh tabsin8,a2
nop
mvkl tabsin,a3
nop
mvkh tabsin,a3
nop
stw a2,*a3
nop 6
mvkl B0VAL,a2
nop
mvkh B0VAL,a2
nop
mvkl 3,a3
nop
mvkh 3,a3
nop
stw a3,*a2
nop 6
b ncomplete
nop
nop 6
neqsix:
mvkl tabcos16,a2
nop
mvkh tabcos16,a2
nop
mvkl tabcos,a3
nop
mvkh tabcos,a3
nop
stw a2,*a3
nop 6
mvkl tabsin16,a2
nop
mvkh tabsin16,a2
nop
mvkl tabsin,a3
nop
mvkh tabsin,a3
nop
stw a2,*a3
nop 6
mvkl B0VAL,a2
nop
mvkh B0VAL,a2
nop
mvkl 4,a3
nop
mvkh 4,a3
nop
stw a3,*a2
nop 6
b ncomplete
nop
nop 6
neqthirty:
mvkl tabcos32,a2
nop
mvkh tabcos32,a2
nop
mvkl tabcos,a3
nop
mvkh tabcos,a3
nop
stw a2,*a3
nop 6
mvkl tabsin32,a2
nop
mvkh tabsin32,a2
nop
mvkl tabsin,a3
nop
mvkh tabsin,a3
nop
stw a2,*a3
nop 6
mvkl B0VAL,a2
nop
mvkh B0VAL,a2
nop
mvkl 5,a3
nop
mvkh 5,a3
nop
stw a3,*a2
nop 6
b ncomplete
nop
nop 6
neqsixty:
mvkl tabcos64,a2
nop
mvkh tabcos64,a2
nop
mvkl tabcos,a3
nop
mvkh tabcos,a3
nop
stw a2,*a3
nop 6
mvkl tabsin64,a2
nop
mvkh tabsin64,a2
nop
mvkl tabsin,a3
nop
mvkh tabsin,a3
nop
stw a2,*a3
nop 6
mvkl B0VAL,a2
nop
mvkh B0VAL,a2
nop
mvkl 6,a3
nop
mvkh 6,a3
nop
stw a3,*a2
nop 6
ncomplete:
mvkl MEMORY,a10
nop
mvkh MEMORY,a10
nop
;shr b9,1,a1
mv b9,a1
nop 3
;mvkl 8,a1
;nop
; mvkh 8,a1
; nop
mvkl MEMORY1,a11
nop
mvkh MEMORY1,a11
nop
copymem:
ldw *a10++[1],a12
nop 6
stw a12,*a11++[1]
nop 6
sub a1,1,a1
nop
[a1] b copymem
nop
nop 6
b bitrev
nop
nop 6
mainret1:
b inczer
nop
nop 6
mainret2:
mvkl 1,a4 ; BFY
same for all
nop
mvkh 1,a4
nop
shr b9,1,a5; GRP
(N/2)
nop 3
mvkl 2,a6 ; DNS
same
nop
mvkh 2,a6
nop
; mvkl 3,a7 ; STG N
= 2^x
; nop
; mvkh 3,a7
; nop
; mvkl 2,a8 ; STGC
(x-1)
; nop
; mvkh 2,a8
; nop
mvkl B0VAL,b15 ;
stage loop x
nop
mvkh B0VAL,b15
nop
ldw *b15,b0
nop 6
stgloop:
zero b3 ;
(((b3))) -> k
mv a6,b6
nop 3
mv a5,a9
shr b9,1,a15
nop 5
cmpeq a5,a15,a1
; (N/2)
nop
[!a1] b nochg
nop
nop 6
zero a9 ;
a9 -> INCTF
nop
nochg:
mv a9,a9 ;
INCTF
nop
mv a5,b1
nop
mvkl MEMWRI,b10
nop
mvkh MEMWRI,b10
nop
grploop:
zero b3 ; k
mv a4,b2 ;
ar4
nop
bfyloop:
ldw *b10++[b6],b7
nop 6
mvkl mulbk,b12
nop
mvkh mulbk,b12
nop
b mul
nop
nop 6
mulbk:
mv a6,b6
nop 3
ldw *b10--[b6],b7
nop 6
mvkl adsmbk,b13
nop
mvkh adsmbk,b13
nop
b adsm
nop
nop 6
adsmbk:
add b3,a9,b3
nop
sub b2,1,b2
nop
[b2] b bfyloop
nop
nop 6
mv a6,b6
nop 3
ldw *b10++[b6],b7
nop 6
sub b1,1,b1
nop
[b1] b grploop
nop
nop 6
mpy a4,2,a4
nop
mpy a6,2,a6
nop 3
mv a6,b6
nop 3
shr a5,1,a5
nop
sub b0,1,b0
nop
[b0] b stgloop
nop
nop 6
mvkl MEMWRI,a9
nop
mvkh MEMWRI,a9
nop
mv b9,b0 ; N
nop 3
mvkl MEMREAL,a10
nop
mvkh MEMREAL,a10
nop
mvkl MEMIMAG,a11
nop
mvkh MEMIMAG,a11
nop
separate:
ldw *a9++[1],a5
nop 6
stw a5,*a10++[1]
nop 6
ldw *a9++[1],a5
nop 6
stw a5,*a11++[1]
nop 6
sub b0,1,b0
nop
[b0] bseparate
nop
nop 6
halt:
b halt
nop
nop 5
inczer:
mvkl MEMORY1,a4
nop
mvkh MEMORY1,a4
nop
mvkl MEMWRI,a5
nop
mvkh MEMWRI,a5
nop
;mvkl 8,b0 ;N
;nop
; mvkh 8,b0
; nop
mv b9,b0
nop 5
inszer:
ldw *a4++[1],a6
nop 5
stw a6,*a5++[1]
nop 5
zero a6
stw a6,*a5++[1]
nop 5
sub b0,1,b0
nop
[b0] b inszer
nop
nop 6
b mainret2
nop
nop 6
bitrev:
mvkl MEMORY1,b1
nop
mvkh MEMORY1,b1
nop
mvkl 1,b3
nop
mvkh 1,b3
nop
mvkl 1,b2
nop
mvkh 1,b2
nop
mainloop:
cmpgt b3,b2,b0
nop
[!b0] b noswap
nop
nop 6
sub b3,1,b4
nop
ldw *b1++[b4],a5
nop 6
ldw *b1--[b4],a5
nop 6
sub b2,1,b5
nop
ldw *b1++[b5],a6
nop 6
ldw *b1,a6
nop 6
stw a5,*b1--[b5]
nop 6
stw a6,*++b1[b4]
nop 6
ldw *b1--[b4],a10
nop 6
noswap:
mv b9,b7
nop 6
;mvkl 8,b7 ; N
; 8,16,32
;nop
;mvkh 8,b7
; 8,16,32
;nop
shr b7,1,b7
nop
shloop:
cmpgt b3,b7,b0
nop
[!b0] b gtnsat
nop
nop 6
mvkl 1,b8
nop
mvkh 1,b8
nop
cmpgt b7,b8,b0
nop
[!b0] b gtnsat
nop
nop 6
sub b3,b7,b3
nop
shr b7,1,b7
nop
b shloop
nop
nop 6
gtnsat:
add b3,b7,b3
nop
add b9,1,a8
nop 5
;mvkl 9,a8
; 9,17,33
;nop
;mvkh 9,a8
; 9,17,33
;nop
add b2,1,b2
nop
cmplt b2,a8,a2
nop
[a2] b mainloop
nop
nop 6
b mainret1
nop
nop 6
mul:
mvkl tabcos,b11
nop
mvkh tabcos,b11
nop
ldw *b11,b14
nop 6
mv b3,b6
nop 3
ldw *b14++[b6],a10
nop 6
ldw *b14,a10
; c
nop 6
mvkl tabsin,b11
nop
mvkh tabsin,b11
nop
ldw
*b11,b14
nop 6
mv b3,b6
nop 3
ldw *b14++[b6],a11
nop 6
ldw *b14,a11
; d
nop 6
ldw *b10++[1],a12
; a
nop 6
ldw *b10--[1],a13
; b
nop 6
zero a14
nop
mpyi a12,a10,a14
; ac
nop 9
zero a15
nop
mpyi a11,a13,a15
; bd
nop 9
sub a14,a15,a14
; ac-bd
nop 2
shr a14,8,a14
nop 2
stw a14,*b10++[1]
nop 6
mpyi a12,a11,a14
; ad
nop 9
mpyi a10,a13,a15
; bc
nop 9
add a14,a15,a14
; ad+bc
nop 2
shr a14,8,a14
nop 2
stw a14,*b10--[1]
nop 6
mv a6,b6
nop 3
b b12
nop
nop 6
adsm:
ldw *b10++[b6],b7
nop 6
mv b7,a10
nop 3
ldw *b10--[b6],b8
nop 6
mv b8,a11
nop 3
add b7,b8,b7
nop
stw b7,*b10
nop 6
sub a10,a11,a12
nop
ldw *b10++[b6],a10
nop 6
stw a12,*b10--[b6]
nop 6
ldw *b10++[1],b7
nop 6
ldw *b10++[b6],b7
nop 6
mv b7,a10
nop
ldw *b10--[b6],b8
nop 6
mv b8,a11
nop
add b7,b8,b7
nop
stw b7,*b10
nop 6
sub a10,a11,a12
nop
ldw *b10++[b6],a10
nop 6
stw a12,*b10--[b6]
nop 6
ldw *b10--[1],a10
nop 6
ldw *b10++[2],a10
nop 6
b b13
nop
nop 6
tabcos2:
.word 000000100H
tabsin2:
.word 000000000H
tabcos4:
.word 000000100H
.word 000000000H
tabsin4:
.word 000000000H
.word 0FFFFFF00H
tabcos8:
.word 000000100H
.word 0000000B5H
.word 000000000H
.word 0FFFFFF4BH
tabsin8:
.word 000000000H
.word 0FFFFFF4BH
.word 0FFFFFF00H
.word 0FFFFFF4BH
tabcos16:
.word 00000100h
.word 000000edh
.word 000000b5h
.word 00000061h
.word 00000000h
.word 0ffffff9fh
.word 0ffffff4bh
.word 0ffffff14h
tabsin16:
.word 000000000h
.word 0ffffff9fh
.word 0ffffff4bh
.word 0ffffff14h
.word 0ffffff00h
.word 0ffffff14h
.word 0ffffff4bh
.word 0ffffff9fh
tabcos32:
.word 00000100h
.word 000000fbh ; fb fa
.word 000000ech ; ec ed
.word 000000d4h
.word 000000b5h
.word 0000008eh ; 8e 8d
.word 00000061h
.word 00000031h
.word 00000000h
.word 0ffffffcfh
.word 0ffffff9fh
.word 0ffffff72h ; 72 73
.word 0ffffff4bh
.word 0ffffff2ch
.word 0ffffff14h
.word 0ffffff05h ;05 06
tabsin32:
.word 00000000h
.word 0ffffffcfh
.word 0ffffff9fh
.word 0ffffff72h ;72 73
.word 0ffffff4bh
.word 0ffffff2ch
.word 0ffffff14h
.word 0ffffff05h ;05 06
.word 0ffffff00h
.word 0ffffff05h ;05 06
.word 0ffffff14h
.word 0ffffff2ch
.word 0ffffff4bh
.word 0ffffff72h ;72 73
.word 0ffffff9fh
.word 0ffffffcfh
tabcos64:
.word 000000100H
.word 0000000feH
.word 0000000fbH
.word 0000000f4H
.word 0000000ecH
.word 0000000e1H
.word 0000000d4H
.word 0000000c5H
.word 0000000b5H
.word 0000000a2H
.word 00000008eH
.word 000000078H
.word 000000061H
.word 00000004aH
.word 000000031H
.word 000000019H
.word 000000000H
.word 0ffffffe7H
.word 0ffffffcfH
.word 0ffffffb6H
.word 0ffffff9fH
.word 0ffffff88H
.word 0ffffff72H
.word 0ffffff5eH
.word 0ffffff4bH
.word 0ffffff3bH
.word 0ffffff2cH
.word 0ffffff1fH
.word 0ffffff14H
.word 0ffffff0cH
.word 0ffffff05H
.word 0ffffff02H
tabsin64:
.word 000000000H
.word 0ffffffe7H
.word 0ffffffcfH
.word 0ffffffb6H
.word 0ffffff9fH
.word 0ffffff88H
.word 0ffffff72H
.word 0ffffff5eH
.word 0ffffff4bH
.word 0ffffff3bH
.word 0ffffff2cH
.word 0ffffff1fH
.word 0ffffff14H
.word 0ffffff0cH
.word 0ffffff05H
.word 0ffffff02H
.word 0ffffff00H
.word 0ffffff02H
.word 0ffffff05H
.word 0ffffff0cH
.word 0ffffff14H
.word 0ffffff1fH
.word 0ffffff2cH
.word 0ffffff3bH
.word 0ffffff4bH
.word 0ffffff5eH
.word 0ffffff72H
.word 0ffffff88H
.word 0ffffff9fH
.word 0ffffffb6H
.word 0ffffffcfH
.word 0ffffffe7H
S.NO INPUT OUTPUT(REAL PART) OUTPUT(IMAGINARY PART)
ADDRESS DATA ADDRESS DATA ADDRESS DATA
1 80001000h 00000000h 80001300h 00001C00h 80001400h 00000000h
2 80001004h 00000100h 80001304h FFFFFC00h 80001404h 000009A8h
3 80001008h 00000200h 80001308h FFFFFC00h 80001408h 00000400h
4 8000100Ch 00000300h 8000130ch FFFFFC00h 8000140ch 000001A8h
5 80001010h 00000400h 80001310h FFFFFC00h 80001410h 00000000h
6 80001014h 00000500h 80001314h FFFFFC00h 80001414h FFFFFE58h
7 80001018h 00000600h 80001318h FFFFFC00h 80001418h FFFFFC00h
8 8000101Ch 00000700h 8000131ch FFFFFC00h 8000141ch FFFFF658h
RESULT:
The N point FFT was designed using TMS320C6713 and the output was verified.
Ex.no:13
Date:
DESIGN OF FIR LOW PASS FILTER USING
TMS320C6713
AIM:
To design window based FIR low pass filter for the following specifications
Filter type : FIR-LPF
Window type : Rectangular window
Sampling frequency : 41khz
Cut-off frequency : 4khz
No. of taps : 52
Tools required:
1. PC
2. C6713 KIT
3. CRO
4. Function Generator
PROGRAM:
.sect"00006000h"
.text
adcsoc1 .set 9004000ch
adcsoc2 .set 9004000eh
adcdata .set 90040008h
adc2 .set 90040008h
dac1 .set 90040008h
dac2 .set 9004000ah
mvkl 0x01800004,a0
mvkh 0x01800004,a0
mvkl 01e0c712h,a1
mvkh 01e0c712h,a1
sth a1,*a0
nop 6
b start
nop 7
coeff:
.word 01fh
.word 010eh
.word 01abh
.word 01b4h
.word 0117h
.word 0h
.word 0fecdh
.word 0fdeeh
.word 0fdc2h
.word 0fe6eh
.word 0ffcdh
.word 016fh
.word 02c0h
.word 0333h
.word 0274h
.word 097h
.word 0fe19h
.word 0fbcbh
.word 0fa9bh
.word 0fb53h
.word 0fe50h
.word 0362h
.word 09c5h
.word 01048h
.word 01599h
.word 01895h
.word 01895h
.word 01599h
.word 01048h
.word 09c5h
.word 0362h
.word 0fe50h
.word 0fb53h
.word 0fa9bh
.word 0fbcbh
.word 0fe19h
.word 097h
.word 0274h
.word 0333h
.word 02c0h
.word 016fh
.word 0ffcdh
.word 0fe6eh
.word 0fdc2h
.word 0fdeeh
.word 0fecdh
.word 0h
.word 0117h
.word 01b4h
.word 01abh
.word 010eh
.word 01fh
start:
mvkl coeff,a1
mvkh coeff,a1
mvkl 80031200h,a3
mvkh 80031200h,a3
mvkl adcsoc1,a10
mvkh adcsoc1,a10
mvkl adcdata,a0
mvkh adcdata,a0
mvkl 0x00000fff,a12
mvkh 0x00000fff,a12
mvkl 0x0800,a13
mvkh 0x0800,a13
mvkl dac1,a15
mvkh dac1,a15
mvkl 52,b2
mvkl 52,b2
zer:
mvkl 00000000h,a2
mvkh 00000000h,a2
stw a2,*a3++
nop 7
sub b2,1h,b2
nop 2
[b2]b zer
nop 6
mvkl 80031200h,a3
mvkh 80031200h,a3
start1:
ldh *a10,a2
nop 6
ldh *a0,a2
nop 6
and a12,a2,a14
xor a14,a13,a2
sub a2,a13,a2
sth a2,*a3
nop 6
mvkl 52,b0
mvkh 52,b0
nop 3
mvkl 00000000h,a7
mvkh 00000000h,a7
loop1:
ldw *a1++,a5
nop 6
ldh *a3++,a6
nop 6
mpy a5,a6,a6
nop 4
shru a6,10h,a6
nop 3
add a7,a6,a7
nop 2
sub b0,1,b0
nop 2
[b0]b loop1
nop 7
mvkl 0x0800,a13
mvkh 0x0800,a13
add a7,a13,a7
nop 4
sth a7,*a15
nop 6
mvkl 52,b1
mvkl 80031200h,b3
mvkh 80031200h,b3
ldh *b3,b4
nop 6
loop2:
ldh *+b3(2),b5
nop 6
sth b4,*++b3
nop 6
mv b5,b4
nop 2
sub b1,1h,b1
nop 2
[b1]b loop2
nop 6
mvkl coeff,a1
mvkh coeff,a1
mvkl 80031200h,a3
mvkh 80031200h,a3
b start1
nop 7
.end
Output:
Input voltage:___________________ V
S.No Frequency in KHz Output voltage in volts Gain in db
1
2
3
4
5
6
RESULT:
The FIR low pass filter was designed using TMS320C6713 and the output was verified.
Ex.no:14
Date:
DESIGN OF IIR LOW PASS FILTER USING
TMS320C6713
AIM:
To design window based IIR low pass filter for the following specifications
Filter type : IIR-LPF
Sampling frequency : 41khz
Cut-off frequency : 3800hz
No. of taps : 52
Tools required:
1. PC
2. C6713 KIT
3. CRO
4. Function Generator
PROGRAM:
ca10 .set 0100h
ca11 .set 0ffa2h
ca12 .set 0032h
cb10 .set 0100h
cb11 .set 0200h
cb12 .set 0100h
gain .set 0034h
xn .set 00009500h
xnm1 .set 00009504h
xnm2 .set 00009508h
yn .set 0000950ch
ynm1 .set 00009510h
ynm2 .set 00009514h
ynout .set 00009518h
adcsoc1 .set 9004000ch
adcdat1 .set 90040008h
dac1 .set 90040008h
.sect "00006000h"
.text
mvkl xn,a4
mvkh xn,a4
mvkl 0h,a5
mvkh 0h,a5
mvkl 6,b0
mvkh 6,b0
filz:
stw a5,*a4++[1]
nop 5
sub b0,1,b0
nop
[b0] b filz
nop
nop 6
start:
nop
mvkl adcsoc1,a3
mvkh adcsoc1,a3
nop
nop
ldw *a3,b3
nop 6
mvkl adcdat1,a4
mvkh adcdat1,a4
nop
nop
ldw *a4,b3
nop 6
mvkl
00000fffh,b4
mvkh
00000fffh,b4
and b3,b4,b3
nop
mvkl
00000800h,b4
mvkh
00000800h,b4
xor b4,b3,b3
mvkl
00000800h,b4
mvkh
00000800h,b4
sub b3,b4,b3
nop
mvkl xn,b4
mvkh xn,b4
stw b3,*b4
nop 6
mvkl 0h,a4
mvkh 0h,a4
mvkl xn,b4
mvkh xn,b4
mvkl cb10,b5
mvkh cb10,b5
ldw *b4,b6
nop 6
mpy b5,b6,b7
nop 2
shru b7,8,b7
add a4,b7,a4
nop 2
mvkl xnm1,b4
mvkh xnm1,b4
mvkl cb11,b5
mvkh cb11,b5
ldw *b4,b6
nop 6
mpy b5,b6,b7
nop 2
shru b7,8,b7
add a4,b7,a4
nop 2
mvkl xnm2,b4
mvkh xnm2,b4
mvkl cb12,b5
mvkh cb12,b5
ldw *b4,b6
nop 6
mpy b5,b6,b7
nop 2
shru b7,8,b7
add a4,b7,a4
nop 2
mvkl ynm1,b4
mvkh ynm1,b4
mvkl ca11,b5
mvkh ca11,b5
ldw *b4,b6
nop 6
mpy b5,b6,b7
nop 2
shru b7,8,b7
sub a4,b7,a4
nop 2
mvkl ynm2,b4
mvkh ynm2,b4
mvkl ca12,b5
mvkh ca12,b5
ldw *b4,b6
nop 6
mpy b5,b6,b7
nop 2
shru b7,8,b7
sub a4,b7,a4
nop 2
mvkl yn,b4
mvkh yn,b4
stw a4,*b4
nop 5
mvkl gain,b4
mvkh gain,b4
mvkl yn,b5
mvkh yn,b5
mvkl ynout,b3
mvkh ynout,b3
ldw *b5,b6
nop 6
mpy b4,b6,b7
nop 2
shru b7,8,b7
sub a4,b7,a4
nop 2
stw a4,*b3
nop 6
mvkl ynm1,b4
mvkh ynm1,b4
mvkl ynm2,b5
mvkh ynm2,b5
ldw *b4,b6
nop 6
stw b6,*b5
nop 5
mvkl yn,b4
mvkh yn,b4
mvkl ynm1,b5
mvkh ynm1,b5
ldw *b4,b6
nop 6
stw b6,*b5
nop 5
mvkl xnm1,b4
mvkh xnm1,b4
mvkl xnm2,b5
mvkh xnm2,b5
ldw *b4,b6
nop 6
stw b6,*b5
nop 5
mvkl xn,b4
mvkh xn,b4
mvkl xnm1,b5
mvkh xnm1,b5
ldw *b4,b6
nop 6
stw b6,*b5
nop 5
mvkl ynout,b3
mvkh ynout,b3
ldw *b3,b4
nop 6
mvkl
00000800h,b6
mvkh
00000800h,b6
add b4,b6,b4
nop
; sth b4,*a1++[1]
; nop 6
mvkl dac1,a3
mvkh dac1,a3
nop
sth b4,*a3
nop 6
b start
nop
nop 6
halt:
b halt
nop
nop 5
Output:
Input voltage: __________V
S.No Frequency in KHz
Output voltage in
(mv)volts
Gain in db
1
2
3
4
5
6
7
8
9
RESULT:
The FIR low pass filter was designed using TMS320C6713 and the output was verified.
Ex.no:15
Date:
STUDY OF SIGNAL PROCESSING ARCHITECTURE TMS320C6713
Aim:
To study the TMS320C 6713 DSP processor architecture
Theory:
The TMS320C6x are the first processors to use velociTI architecture, having
implemented the VLIW architecture. The TMS320C62x is a 16-bit fixed point processor and the
‘67x is a floating point processor, with 32-bit integer support. The discussion in this chapter is
focused on the TMS320C67x processor. The architecture and peripherals associated with this
processor are also discussed. The C6713 DSK is a low-cost standalone development platform
that enables users to evaluate and develop applications for the TI C67xx DSP family. The DSK
also serves as a hardware reference design for the TMS320C6713 DSP. Schematics, logic
equations and application notes are available to ease hardware development and reduce time to
market.
FEATURES
 A Texas Instruments TMS320C6713 DSP operating at 225 MHz.
 An AIC23 stereo codec
 16 Mbytes of synchronous DRAM
 512 Kbytes of non-volatile Flash memory (256 Kbytes usable in default configuration)
 4 user accessible LEDs and DIP switches
 Software board configuration through registers implemented in CPLD
 Configurable boot options
 Standard expansion connectors for daughter card use
 JTAG emulation through on-board JTAG emulator with USB host
 Interface or external emulator
 Single voltage power supply (+5V)
 VelociTI Very Long Instruction Word(VLIW) CPU Core Fetches eight 32-bit
instructions at once
 Eight Independent functional units
 Four ALUs (fixed and floating-point)
 Two ALUs (fixed-point)
 Two multipliers (fixed and floating-point)
 32*32 bit integer multiply with 32 or 64-bit result
 Instruction Set Features
 Hardware support for IEEE single and double precision floating-point operations 8, 16,
and 32-bit addressable 8-bit over overflow protection and saturation Bit-field extract, set,
clear; bit-counting; normalization
Addressing Modes
 Linear Addressing -with all registers
 Circular Addressing -with registers A4-A7 and B4-B7
TMS320C6713 DSK
The DSP on the 6713 DSK interfaces to on-board peripherals through a 32-bit wide
EMIF (External Memory InterFace). The SDRAM, Flash and CPLD are all connected to
the bus. EMIF signals are also connected daughter card expansion connectors which are
used for third party add-in boards.
The DSP interfaces to analog audio signals through an on-board AIC23 codec and
four 3.5 mm audio jacks (microphone input, line input, line output, and headphone
output). The codec can select the microphone or the line input as the active input. The
analog output is driven to both the line out (fixed gain) and headphone (adjustable gain)
connectors. McBSP0 is used to send commands to the codec control interface while
McBSP1 is used for digital audio data. McBSP0 and McBSP1 can be re-routed to the
expansion connectors in software. A programmable logic device called a CPLD is used to
implement glue logic that ties the board components together.
The CPLD has a register based user interface that lets the user configure the board
by reading and writing to its registers. The DSK includes 4 LEDs and a 4 position DIP
switch as a simple way to provide the user with interactive feedback. Both are accessed
by reading and writing to the CPLD registers. An included 5V external power supply is
used to power the board. On-board switching voltage regulators provide the +1.26V DSP
core voltage and +3.3V I/O supplies. The board is held in reset until these supplies are
within operating specifications.
Code Composer communicates with the DSK through an embedded JTAG
emulator with a USB host interface. The DSK can also be used with an external emulator
through the external JTAG connector. The processor consists of three main parts: CPU,
peripherals and memory.
Result:
Thus the TMS320C6713 Architecture were Studied.
DESIGN OF BUTTERWORTH DIGITAL IIR FILTERS
LOW PASS HIGH PASS BAND PASS BAND STOP
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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);
[b,a]=butter(n,wn);
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency----->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians------->’);
xlabel(‘Normalised frequency----->’);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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);
[b,a]=butter(n,wn,’high’);
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency---->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians------->’);
xlabel(‘Normalised frequency---->’);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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);
wn=[w1,w2];
[b,a]=butter(n,wn,’bandpass’);
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency----->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians------->’);
xlabel(‘Normalised frequency----->’);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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);
wn=[w1,w2];
[b,a]=butter(n,wn,’ stop’);
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency----->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians------->’);
xlabel(‘Normalised frequency----->’);
DESIGN OF CHEBYSHEV DIGITAL IIR FILTERS
LOW PASS HIGH PASS BAND PASS BAND STOP
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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]= cheblord(w1,w2,rp,rs);
[b,a]=chebyl(n,rp,wn);
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency----->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians----->’);
xlabel(‘Normalised frequency----->’);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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]= cheblord(w1,w2,rp,rs);
[b,a]=chebyl(n,rp,wn, highpass );
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency----->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians----->’);
xlabel(‘Normalised frequency----->’);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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]= cheblord(w1,w2,rp,rs);
wn=[w1,w2];
[b,a]=chebyl(n,rp,wn,’bandpass’);
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency----->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians----->’);
xlabel(‘Normalised frequency----->’);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
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]= cheblord(w1,w2,rp,rs);
wn=[w1,w2];
[b,a]=chebyl(n,rp,wn,’stop’);
w=0:.01:pi;
[h,om]=freqz(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency----->’);
subplot(2,1,2);
plot(om/pi,an);
ylabel(‘Phase in radians----->’);
xlabel(‘Normalised frequency----->’);
OUTPUT FOR IIR FILTER
LOW PASS HIGH PASS BAND PASS BAND STOP
enter the passband ripple20
enter the stopband ripple40
enter the passband freq500
enter the stopband freq1000
enter the sampling freq5000
enter the passband ripple20
enter the stopband ripple40
enter the passband freq500
enter the stopband freq1000
enter the sampling freq5000
enter the passband ripple20
enter the stopband ripple40
enter the passband freq500
enter the stopband freq1000
enter the sampling freq5000
enter the passband ripple20
enter the stopband ripple40
enter the passband freq500
enter the stopband freq1000
enter the sampling freq5000
BUTTERWORTH IIR FILTERS
CHEBYSHEV DIGITAL FILTERS
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-250
-200
-150
-100
-50
0
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-4
-2
0
2
4
Phaseinradians------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-100
-80
-60
-40
-20
0
20
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-4
-2
0
2
4
Phaseinradians------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-250
-200
-150
-100
-50
0
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-4
-2
0
2
4
Phaseinradians------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-120
-100
-80
-60
-40
-20
0
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-4
-2
0
2
4
Phaseinradians------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-250
-200
-150
-100
-50
0
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-4
-2
0
2
4
Phaseinradians------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-150
-100
-50
0
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-3
-2
-1
0
1
2
3
Phaseinradians------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-250
-200
-150
-100
-50
0
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-3
-2
-1
0
1
2
3
Phaseinradians------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-150
-100
-50
0
50
GainindB------->
Normalised frequency----->
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-3
-2
-1
0
1
2
3
Phaseinradians------->
Normalised frequency----->
DESIGN OF FIR FILTERS USING WINDOWS
HANNING HAMMING KAISER
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
fp=input(‘enter the passband freq’);
fs=input(‘enter the stopband freq’);
f=input(‘enter the sampling freq’);
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)~=0)
n1=n;
n=n-1;
end
y=hanning(n1);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
fp=input(‘enter the passband freq’);
fs=input(‘enter the stopband freq’);
f=input(‘enter the sampling freq’);
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)~=0)
n1=n;
n=n-1;
end
y=hamming(n1);
clc;
clear all;
close all;
format long
rp=input(‘enter the passband ripple’);
rs=input(‘enter the stopband ripple’);
fp=input(‘enter the passband freq’);
fs=input(‘enter the stopband freq’);
f=input(‘enter the sampling freq’);
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)~=0)
n1=n;
n=n-1; end
beta=5.8;
y=kaiser(n1,beta);
LOW PASS HIGH PASS BAND PASS BAND STOP
%lowpass 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);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency-->’);
%highpass 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);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency--->’);
%bandpass 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);
ylabel(‘Gain in dB---->’);
xlabel(‘Normalised frequency-->’);
%bandstop 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);
ylabel(‘Gain in dB------->’);
xlabel(‘Normalised frequency-->’);
OUTPUT FOR FIR FILTER USING WINDOWS
HANNING HAMMING KAISER
enter the passband ripple0.03
enter the stopband ripple0.01
enter the passband freq1400
enter the stopband freq2000
enter the sampling freq8000
enter the passband ripple0.02
enter the stopband ripple0.01
enter the passband freq1200
enter the stopband freq1700
enter the sampling freq9000
enter the passband ripple0.02
enter the stopband ripple0.01
enter the passband freq1000
enter the stopband freq1500
enter the sampling freq10000
0 0.2 0.4 0.6 0.8 1
-150
-100
-50
0
50
GainindB------->
Normalised frequency------->
low pass filter
0 0.2 0.4 0.6 0.8 1
-80
-60
-40
-20
0
20
GainindB------->
Normalised frequency------->
hgh pass filter
0 0.2 0.4 0.6 0.8 1
-120
-100
-80
-60
-40
-20
0
GainindB------->
Normalised frequency------->
band pass filter
0 0.2 0.4 0.6 0.8 1
-15
-10
-5
0
5
GainindB------->
Normalised frequency------->
band stop filter
0 0.2 0.4 0.6 0.8 1
-150
-100
-50
0
50
GainindB------->
Normalised frequency------->
low pass filter
0 0.2 0.4 0.6 0.8 1
-100
-80
-60
-40
-20
0
20
GainindB------->
Normalised frequency------->
hgh pass filter
0 0.2 0.4 0.6 0.8 1
-120
-100
-80
-60
-40
-20
0
GainindB------->
Normalised frequency------->
band pass filter
0 0.2 0.4 0.6 0.8 1
-15
-10
-5
0
5
GainindB------->
Normalised frequency------->
band stop filter
0 0.2 0.4 0.6 0.8 1
-150
-100
-50
0
50
GainindB------->
Normalisedfrequency------->
lowpass filter
0 0.2 0.4 0.6 0.8 1
-150
-100
-50
0
50
GainindB------->
Normalisedfrequency------->
hghpass filter
0 0.2 0.4 0.6 0.8 1
-150
-100
-50
0
50
GainindB------->
Normalisedfrequency------->
bandpass filter
0 0.2 0.4 0.6 0.8 1
-15
-10
-5
0
5
GainindB------->
Normalisedfrequency------->
bandstopfilter
Erode Sengunthar Engineering College
(Approved by AICTE, New Delhi, Affiliated to Anna University – Chennai
& Accredited by National Board of Accreditation (NBA), New Delhi.)
Erode 638 057
DEPARTMENT OF ELECTRONICS AND COMMUNICATION
ENGINEERING
DSP LAB VIVA QUESTION
1. What is MATLAB?
2. What are the applications of MATLAB?
3. Define discrete time and digital signal.
4. Explain briefly, the various methods of representing discrete time signal
5. Express the discrete time signal x(n) as a summation of impulses.
6. How will you classify the discrete time signals?
7. When a discrete time signal is called periodic?
8. What is the relationship between unit step/unit impulse signals?
9. What are the elements of DSP?
10. What is discrete time system?
11. What is meant by impulse response?
12. What is energy signal? How to calculate energy of a signal?
13. What is power signal? How to calculate power of a signal?
14. Differentiate between even and odd signals.
15. Explain time invariance property of a system with an example.
16. What is memory less system?
17. When a system is said to have memory?
18. What is meant by causality?
19. Explain scaling and superposition properties of a system.
20. What is meant by linearity of a system and how it is related to scaling and superposition?
21. What is impulse function?
22. Why MATLAB is called as matrix laboratory?
23. How to create a figure window in MATLAB?
24. What is the function of subplot command in MATLAB?
25. What the use is of stem and plot command in MATLAB?
26. What is use of clc, clear all & close all command in MATLAB?
27. What is the command used to find the correlation/convolution in MATLAB?
28. What is command for generating the exponentional function in MATLAB?
29. What is use of title, xlabel & ylabel command in MATLAB?
30. What is use of ceil & floor command in MATLAB?
31. State sampling theorem.
32. What is meant by Nyquist rate and Nyquist criteria?
33. Define aliasing.
34. Explain linear convolution and circular convolution
35. Write the properties of linear convolution.
36. What is sectioned convolution? Why is it performed?
37. What are the two methods of sectioned convolution?
38. What are the properties of correlation?
39. What are the advantages of using autocorrelation and cross correlation properties in
signal processing fields?
40. How auto-correlation can be used to detect the presence of noise?
41. What is the length of linear and circular convolutions if the two sequences are having the
length n1 and n2?
42. What are Fourier series and Fourier transform?
43. What are the advantages and special applications of Fourier transform, Fourier series, Z
transform and Laplace transform?
44. Differentiate between DTFT and DFT. Why it is advantageous to use DFT in computers
rather than DTFT?
45. What is FFT, What it's importance?
46. What is the drawback in Fourier transform and how is it overcome?
47. What are the various algorithms to calculate FFT?
48. What is phase factor or twiddle factor?
49. What are the phase factors involved in all stages of computation in the 8-point DIT radix-
2 FFT?
50. What is magnitude and phase spectrum?
51. Differentiate between IIR filters and FIR filters.
52. What is the procedure to design a digital Butterworth filter?
53. What is the difference between Butterworth, Chebyshev I and Chebyshev II filters?
54. What are difference equations and differential equations?
55. What is non real time processing?
56. What is meant by real time processing?
57. What is mean by filter?
58. What is mean by pass /stop band?
59. Write the characteristics features of Hanning window
60. Define pre-warping effect? Why it is employed?
61. Give any two properties of Butterworth filter.
62. When a FIR filter is said to be a linear phase FIR filter
63. Write the characteristics features of rectangular window.
64. What is mean by Gibbs phenomenon?
65. Write the expression for Kaiser window function..
66. What are the advantages and disadvantages of FIR filters?
67. Write the characteristics features of Hamming window
68. Why mapping is needed in the design of digital filters?
69. What are the effects of finite word length in digital filters?
70. List the errors which arise due to quantization process.
71. Discuss the truncation error in quantization process.
72. Write expression for variance of round-off quantization noise.
73. Define limit cycle Oscillations, and list out the types.
74. When zero limit cycle oscillation and Over flow limit cycle oscillation has occur?
75. Why? Scaling is important in Finite word length effect.
76. What are the differences between Fixed and Binary floating point number representation?
77. .What is the error range for Truncation and round-off process
78. What is mean by multi rate?
79. What is mean by decimation?
80. What is mean by interpolation?
81. What is anti aliasing filter?
82. What is anti imaging filter?
83. What is mean by adaptive filter?
84. What is a Digital Signal Processor (DSP)?
85. Differentiate between RISC and CISC architectures.
86. Differentiate between General purpose MPU(Micro Processor Unit) and DSP Processor
87. What is pipelining?
88. What is parallel processing?
89. What is MAC?
90. What is barrel shifter? Why it is advantageous to use it in DSP processor?
91. Differentiate between floating point DSP and fixed point DSP.
92. What is code composer studio?
93. Explain Von-Neumann and Harvard architectures
94. What are Line-in, Line-out, Mic-in, Mic-out?
95. What are the factors that influence the selection of DSPs.
96. What are the advantages and disadvantages of VLIW architecture? What is pipelining?
and What are the stages of pipelining?
97. What are the different buses of TMS 320C5x processor and list their functions
98. List the various registers used with ARAU.
99. What are the shift instructions in TMS 320 C5x.
100. List the on-chip peripherals of C5x processor.
101. Give the applications of multirate DSP system.
102. What are the two different algorithm used in adaptive signal processing
103. What are the various areas in which multirate signal processing is used.
104. What are the different applications in adaptive signal processing?
105. List out the various audio effects that can be implemented digitally
106. What are the advantages of Digital signal processing?

More Related Content

PDF
Ece formula sheet
PDF
Dsp lab pdf
PPT
Digital Communication: Information Theory
PDF
Digital signal Processing all matlab code with Lab report
DOC
Chap 3
PPTX
floating point multiplier
PDF
Signal & system
PPTX
Linear block coding
Ece formula sheet
Dsp lab pdf
Digital Communication: Information Theory
Digital signal Processing all matlab code with Lab report
Chap 3
floating point multiplier
Signal & system
Linear block coding

What's hot (20)

PPTX
PULSE WIDTH MODULATION &DEMODULATION
PDF
Digital Signal Processing[ECEG-3171]-Ch1_L02
PDF
Introduction to Digital Signal Processing
PPTX
Eye diagram in Communication
PPT
PULSE CODE MODULATION (PCM)
PPT
DOCX
Microprocessor Interfacing and 8155 Features
PDF
Digital Data, Digital Signal | Scrambling Techniques
PDF
Chapter4
PPT
Antenna arrays
PDF
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
PPTX
Lecture Notes: EEEC6440315 Communication Systems - Inter Symbol Interference...
PDF
Sigma-Delta Analog to Digital Converters
PDF
Digital Modulation Unit 3
PPTX
Digital modulation techniques
PPT
Correlative level coding
PDF
Information theory
PPTX
IMPLEMENTATION OF UPSAMPLING & DOWNSAMPLING
PPTX
Verilog operators.pptx
PPTX
Asynchronous Sequential Circuit-Unit 4 ppt
PULSE WIDTH MODULATION &DEMODULATION
Digital Signal Processing[ECEG-3171]-Ch1_L02
Introduction to Digital Signal Processing
Eye diagram in Communication
PULSE CODE MODULATION (PCM)
Microprocessor Interfacing and 8155 Features
Digital Data, Digital Signal | Scrambling Techniques
Chapter4
Antenna arrays
Convolution codes - Coding/Decoding Tree codes and Trellis codes for multiple...
Lecture Notes: EEEC6440315 Communication Systems - Inter Symbol Interference...
Sigma-Delta Analog to Digital Converters
Digital Modulation Unit 3
Digital modulation techniques
Correlative level coding
Information theory
IMPLEMENTATION OF UPSAMPLING & DOWNSAMPLING
Verilog operators.pptx
Asynchronous Sequential Circuit-Unit 4 ppt
Ad

Similar to DSP lab manual (20)

PDF
Dsp file
DOCX
Basic simulation lab manual1
DOC
Digital Signal Processing Lab Manual ECE students
DOC
Dsp 1recordprophess-140720055832-phpapp01
PDF
digital signal-processing-lab-manual
PDF
BS LAB Manual (1).pdf
PDF
dsp.pdf
PPTX
Dsp lab task1 ganesh
PDF
DSP_note_for_lab especially ofr Lab finals
PDF
Matlab programs
PDF
Signal Prosessing Lab Mannual
PDF
Dsp Lab Record
DOCX
DSP_Lab_MAnual_-_Final_Edition[1].docx
PDF
DSP_Lab_MAnual_-_Final_Edition.pdf
PDF
Digital Signal Processing Laboratory Manual
PDF
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
PDF
DOC
Digital Signal Processing Lab Manual
PPTX
Real Time Filtering on Embedded ARM
Dsp file
Basic simulation lab manual1
Digital Signal Processing Lab Manual ECE students
Dsp 1recordprophess-140720055832-phpapp01
digital signal-processing-lab-manual
BS LAB Manual (1).pdf
dsp.pdf
Dsp lab task1 ganesh
DSP_note_for_lab especially ofr Lab finals
Matlab programs
Signal Prosessing Lab Mannual
Dsp Lab Record
DSP_Lab_MAnual_-_Final_Edition[1].docx
DSP_Lab_MAnual_-_Final_Edition.pdf
Digital Signal Processing Laboratory Manual
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
Digital Signal Processing Lab Manual
Real Time Filtering on Embedded ARM
Ad

More from tamil arasan (20)

PPTX
IO INTERFACING in unit 2 8086 Microprocessor
PPTX
UNIT-I MICROPROCESSOR PROGRAMMING AND STACK.pptx
PPTX
Serial communication in 8051 microcontroller .pptx
PPTX
89C51 PROGRAMMING in Unit-4 of Microprocessor
PPTX
8051 Architecture in unit 3 for MPMC .pptx
PPTX
MOSFET Transistor Operation/ Characteristics Unit-2 VLSI.pptx
PPTX
Design of Arithmetic Building Block Unit-5 VLSI.pptx
PPTX
Dynamic CMOS DESIGN in VLSI Design-unit-3
PPTX
Sequential Logic Circuit Design Unit-4 VLSI.pptx
PPTX
Unit 3- OPTICAL SOURCES AND DETECTORS
PPTX
Unit II- TRANSMISSION CHARACTERISTIC OF OPTICAL FIBER
PPTX
Properties of dft
DOCX
Steps for design of butterworth and chebyshev filter
DOCX
EC6612 VLSI Design Lab Manual
PPTX
VLSI Design Sequential circuit design
PPTX
Unit i
PPTX
Unit 2
PPTX
Unit 3
PPT
Filter- IIR - Digital signal processing(DSP)
PPT
Finite word lenth effects
IO INTERFACING in unit 2 8086 Microprocessor
UNIT-I MICROPROCESSOR PROGRAMMING AND STACK.pptx
Serial communication in 8051 microcontroller .pptx
89C51 PROGRAMMING in Unit-4 of Microprocessor
8051 Architecture in unit 3 for MPMC .pptx
MOSFET Transistor Operation/ Characteristics Unit-2 VLSI.pptx
Design of Arithmetic Building Block Unit-5 VLSI.pptx
Dynamic CMOS DESIGN in VLSI Design-unit-3
Sequential Logic Circuit Design Unit-4 VLSI.pptx
Unit 3- OPTICAL SOURCES AND DETECTORS
Unit II- TRANSMISSION CHARACTERISTIC OF OPTICAL FIBER
Properties of dft
Steps for design of butterworth and chebyshev filter
EC6612 VLSI Design Lab Manual
VLSI Design Sequential circuit design
Unit i
Unit 2
Unit 3
Filter- IIR - Digital signal processing(DSP)
Finite word lenth effects

Recently uploaded (20)

PPTX
Management Information system : MIS-e-Business Systems.pptx
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PDF
Design Guidelines and solutions for Plastics parts
PDF
Abrasive, erosive and cavitation wear.pdf
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PDF
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
Software Engineering and software moduleing
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
CyberSecurity Mobile and Wireless Devices
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
Soil Improvement Techniques Note - Rabbi
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Management Information system : MIS-e-Business Systems.pptx
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Design Guidelines and solutions for Plastics parts
Abrasive, erosive and cavitation wear.pdf
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
Categorization of Factors Affecting Classification Algorithms Selection
Software Engineering and software moduleing
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Amdahl’s law is explained in the above power point presentations
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
CyberSecurity Mobile and Wireless Devices
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Soil Improvement Techniques Note - Rabbi
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION

DSP lab manual

  • 1. ERODE SENGUNTHAR ENGINEERING COLLEGE (Approved by AICTE - New Delhi, Permanently Affiliated to Anna University – Chennai, Accredited by National Board of Accreditation (NBA), New Delhi and National Assessment & Accreditation Council (NAAC), Bangalore with ‘A’ Grade) Thudupathi (PO.), Perundurai, Erode – 638 057. DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING EC6511/8562 DSP LABORATORY Prepared By V.THAMIZHARASAN, AP/ECE
  • 2. Name of the Subject with Code : EC6511-Digital Signal Processing Laboratory Course Coordinator : V.Thamizharasan, AP / ECE Academic Year : 2017-18 / Odd Semester Year/ Semester : III / V Semester(B Section) Branch : B.E. Electronics and Communication Engineering. Course Objectives:  To design and simulate/ implement Linear and Circular Convolution  To design and simulate/ implement FIR , IIR and Multirate filters  To generate and simulate / implement the different types of waveform  To study the architecture of DSP processor  To demonstrate Finite word length effect Course outcomes:  Carry out simulation of DSP systems  Demonstrate their abilities towards DSP processor based implementation of DSP systems  Analyze Finite word length effect on DSP systems  Demonstrate the applications of FFT to DSP  Implement adaptive filters for various applications of DSP List of Experiments: Cycle-I Simulation using MATLAB software 1. a. Generation of signals b. Correlation 2. Linear and Circular Convolutions 3. a. Sampling and effect of aliasing(Content Beyond syllabus) b. FFT using DIT algorithm(Content Beyond syllabus) 4. Spectrum analysis using DFT 5. a. Design of Butterworth digital IIR filters b. Design of chebychev digital IIR filters 6. Design of FIR filters using window 7. Design of Multirate filter 8. Design of Equalizer Cycle-II Implementation using TMS320C6713 9. Mac operation using addressing modes 10. Waveform generation 11. Convolution 12. Fast Fourier transform 13. FIR low pass filter 14. IIR low pass filter 15. Finite word length effect Study of signal processing architecture
  • 3. EX.NO:1a DATE: GENERATION OF SIGNALS AIM: To generate the signals like sine wave, cosine wave, ramp signal, unit step, impulse, exponential wave using MAT Lab. TOOLS REQUIRED: MAT LAB software ALGORITHM:  Start the program.  Clear the command window and clear all the existing variables and functions.  Close all the existing files in M-file.  Get the choice to generate the signal.  If the choice is to generate ramp signal, then get the length of the ramp and plot the signal using stem.  If the choice is to generate sine wave, assign the initial value of‘t’ to 0 and ending value of ‘t’ to pi.  Generate and plot the sine wave using sine function.  If the choice is to generate cosine wave, assign the initial value of‘t’ to 0 and ending value of ‘t’ to pi.  Generate and plot the cosine wave using cosine function.  If the choice is to generate unit step signal, assign the initial and final value of ‘t’ and generate the unit step signal and then plot it.  If the choice is to generate unit impulse signal, set the initial and final value of ‘t’.  Generate the unit impulse signal using [zeros(1,10),ones(1,1),zeros(1,10)] and then plot it.  If the choice is to generate exponential signal, assign the initial and final value of ‘t’.  Generate the exponential signal using function exp(t) and plot the signal.  Stop the program.
  • 4. Theory: 1. Sin signal: An geometric waveform that oscillates (moves up, down or side-to- side) periodically, and is defined by the function y = sin 2*π*f*t. In other words, it is an s-shaped, smooth wave that oscillates above and below zero. 2. Cos signal: A cosine wave is a signal waveform with a shape identical to that of a sine wave , except each point on the cosine wave occurs exactly 1/4 cycle earlier than the corresponding point on the sine wave. A cosine wave and its corresponding sine wave have the same frequency, but the cosine wave leads the sine wave by 90 degrees of phase . 3. Unit step signal: Unit step signal means the signal has unit amplitude for positive axis and has zero amplitude for negative axis. u(n)= 1 for n ≥ 0 u(n)= 0 for n < 0 u(t)= 1 for t ≥ 0 u(t) = 0 for t < 0 4. Unit impulse signal: A discrete time unit impulse function is denoted by δ(n). Its amplitude is 1 at n=0 and for all other values of n; its amplitude is zero. δ(n)= 1 for n=0 otherwise zero δ(t)= 1 for t=0 otherwise zero
  • 5. 5. Ramp signal: A discrete time unit ramp signal is denoted by r(n). its value increases linearly with sample number n. mathematically it is defined as, r(n)= n for n ≥ 0 r(n) = 0 for n < 0 r(t) = 1 for t ≥ 0 r(t) = 0 for t < 0 6. Exponential signal: The “exponential” signal literally represents an exponentially increasing or falling series: x(t)=eαt .Note that negative α values result in a shrinking signal, whereas positive values result in a growing signal. The exponential signal models the behavior of many phenomena, such as the decay of electrical signals across a capacitor or inductor. Positive α values show processes with compounding values, e.g. the growth of money with a compounded interest rate.
  • 6. PROGRAM: %GENERATION OF SIGNALS clc; clear all; close all; disp('Generation of signals'); disp('1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL'); choice=input('Enter the choice'); switch(choice) case(1) n=input('enter the ramp sequence'); t=0:n; figure(1); stem(t,t); title('ramp signal'); xlabel('(a)-->'); ylabel('amp-->'); grid; case(2) t=0:.01:pi; y=sin(2*pi*t); figure(2); plot(t,y); title('sine wave'); xlabel('(b)-->'); ylabel('amp-->'); grid; case(3) t=0:.01:pi; y=cos(2*pi*t); figure(3); plot(t,y); title('cos wave'); xlabel('(c)-->'); ylabel('amp-->'); grid; case(4) t=0:0.011:10; y=ones(1,10); figure(4); stem(y); title('unit step'); xlabel('(d)-->'); ylabel('amp-->'); grid; case(5) n=-10:1:10; y=[zeros(1,10),ones(1,1),zeros(1,10)]; figure(5); stem(n,y); title('impulse wave'); xlabel('(e)-->'); ylabel('amp-->'); grid; case(6) t=0:.01:5; x=exp(t); figure(6); plot(t,x); title('exponential wave'); xlabel('(f)-->'); ylabel('amp-->'); grid; end;
  • 7. Output: Generation of signals 1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL Enter the choice1 enter the ramp sequence15 . Generation of signals 1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL Enter the choice2 Generation of signals 1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL Enter the choice3
  • 8. Generation of signals 1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL Enter the choice4 Generation of signals 1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL Enter the choice5 Generation of signals 1)RAMP 2)SINE 3)COS 4)UNIT STEP 5)IMPULSE 6)EXPONENTIAL Enter the choice6 RESULT: The signals like sine wave, cosine wave, ramp signal, unit step, impulse and exponential wave were generated using MAT lab and the output was verified.
  • 9. EX.NO:1b. DATE: CORRELATION AIM: To write and simulate an cross & Auto Correlation for the given sequence using MATLAB. TOOLS REQUIRED: MAT LAB software ALGORITHM: Step 1: Start Step 2: Read the input sequence Step 3: Perform auto correlation using the xcorr () function Step 4: Plot the sequences Step 5: Display the input & output sequences Step 6: Stop Theory: Correlation is a statistical tool that helps to measure and analyze the degree of relationship between two variables. Auto correlation is correlation between the elements of a series and others from the same series separated from them by a given interval. Cross-correlation is a measure of similarity of two series as a function of the lag of one relative to the other. This is also known as a sliding dot product or sliding inner-product. Program: clc; close all; clear all; x=input('Enter the sequence 1: '); h=input('Enter the sequence 2: '); y=xcorr(x,x); z=xcorr(x,h); figure; subplot(2,2,[1,3]); stem(x); ylabel('Amplitude'); xlabel('n'); title('Input sequence'); subplot(2,2,2); stem(y); ylabel('amplitude'); xlabel('n '); title('Output for Auto correlation'); disp('The result of Auto correlation is '); disp(y) subplot(2,2,4); stem(z); ylabel('amplitude'); xlabel('n '); title('Output for cross correlation'); disp('The result of cross correlation is '); disp(z) Crosscorrelation r T y t x t dtxy T   ( ) ( ) ( )  1 0   Autocorrelation r T x t x t dt r i N x k x k i xx T xx        ( ) ( ) ( ) ( ) ( )   1 1 0 k=1 N
  • 10. Output: Enter the sequence 1: [1 2 3 4] Enter the sequence 2: [1 4 7 8] The result of Auto correlation is 4.0000 11.0000 20.0000 30.0000 20.0000 11.0000 4.0000 The result of cross correlation is 8.0000 23.0000 42.0000 62.0000 42.0000 19.0000 4.0000 RESULT: Thus the program for auto and cross correlation of a given sequence was calculated and the output was displayed. 1 2 3 4 0 0.5 1 1.5 2 2.5 3 3.5 4 Amplitude? n--> Input sequence 0 2 4 6 8 0 5 10 15 20 25 30 amplitude n--> Output for Auto correlation 0 2 4 6 8 0 20 40 60 80 amplitude n--> Output for cross correlation
  • 11. EX.NO:2 DATE: LINEAR CONVOLUTION AND CIRCULAR CONVOLUTION AIM: To write and simulate a program for linear and circular convolution using MATLAB. TOOLS REQUIRED: MAT LAB software ALGORITHM FOR LINEAR CONVOLUTION:  Start the program.  Get the first sequence in “a” and second sequence in “b”.  Convolute the two sequence a and b by conv(a,b).  Store the convoluted result in c and also display the convoluted result.  Plot the values of the two input sequences and the values of the convoluted output by using appropriate instructions.  Stop the program. ALGORITHM FOR CIRCULAR CONVOLUTION:  Start the program.  Get the first sequence in a and second sequence in b.  Find FFT of each sequence a and b by using fft(a) and fft(b) and store in C and d.  Multiply c and d and find inverse FFT of this product and store in f.  Store the convoluted result in c and also display the convoluted result.  Plot the values of the two input sequences and the values of the convoluted output by using appropriate instructions.  Stop the program. Theory: Linear Convolution Circular convolution 1 If x(n) is a sequence of L No.of samples and h(n) with M number of samples, after convolution y(n) will contain N=L+M-1 Ifx(n) is a sequence of L No.of samples and h(n) with M samples after convolution y(n) will contain N=Max(L,M) samples 2. Linear convolution can be used to find the response of a linear filter Circular convolution cannot be used to find the response of a filter. 3. Zero padding is not necessary to find the response of a linear filter Zero padding is necessary to find the response of a filter
  • 12. PROGRAM: % LINEAR COVOLUTION clc; close all; clear all; a=input('Enter the first sequence='); b=input('Enter the second sequence='); c=conv(a,b); disp('The convoluted output is'); disp(c); L1=0:length(a)-1; L2=0:length(b)-1; L3=0:length(c)-1; subplot(1,3,1); stem(L1,a); xlabel('TIME'); ylabel('AMPLITUDE'); title('FIRST INPUT SEQUENCE'); subplot(1,3,2); stem(L2,b); xlabel('TIME'); ylabel('AMPLITUDE'); title('SECOND INPUT SEQUENCE'); subplot(1,3,3); stem(L3,c); xlabel('TIME'); ylabel('AMPLITUDE'); title('CONVOLUTED OUTPUT'); % CIRCULAR COVOLUTION clc; close all; clear all; a=input('Enter the first sequence='); b=input('Enter the second sequence='); c=fft(a); d=fft(b); e=c.*d; f=ifft(e); disp('The convoluted output is'); disp(f); L1=0:length(a)-1; L2=0:length(b)-1; L3=0:length(f)-1; subplot(1,3,1); stem(L1,a); xlabel('TIME'); ylabel('AMPLITUDE'); title('FIRST INPUT SEQUENCE'); subplot(1,3,2); stem(L2,b); xlabel('TIME'); ylabel('AMPLITUDE'); title('SECOND INPUT SEQUENCE'); subplot(1,3,3); stem(L3,f); xlabel('TIME'); ylabel('AMPLITUDE'); title('CONVOLUTED OUTPUT');
  • 13. OUTPUT FOR LINEAR CONVOLUTION: Enter the first sequence=[1 2 3 4] Enter the second sequence=[1 2 3 4] The covoluted output is 1 4 10 20 25 24 16 OUTPUT FOR CIRCULAR CONVOLUTION: Enter the first sequence=[4 5 6 3] Enter the second sequence= [ 1 3 5 6] The convoluted output is 73 68 59 70 RESULT: Thus the program for linear and circular convolution was executed successfully using MATLAB 0 1 2 3 0 1 2 3 4 TIME AMPLITUDE FIRST INPUT SEQUENCE 0 1 2 3 0 1 2 3 4 TIME AMPLITUDE SECOND INPUT SEQUENCE 0 2 4 6 0 10 20 30 TIME AMPLITUDE CONVOLUTED OUTPUT 0 2 4 0 1 2 3 4 5 6 TIME AMPLITUDE FIRST INPUT SEQUENCE 0 2 4 0 1 2 3 4 5 6 TIME AMPLITUDE SECOND INPUT SEQUENCE 0 2 4 0 10 20 30 40 50 60 70 80 TIME AMPLITUDE CONVOLUTED OUTPUT
  • 14. Ex.no:3a Date: SAMPLING AND EFFECT OF ALIASING AIM:  To perform sampling of a signal using mat lab.  To analyse the effect of aliasing using mat lab. TOOLS REQUIRED: MAT LAB software ALGORITHM:  Start the program.  Clear the command window and clear all the existing variables and functions.  Close all the existing files in M-file.  Assign t=0 to 1 and f=5.  Calculate s=sin(2*pi*f*t) and plot the sine wave.  Calculate i=[1,ones(1,100)] and plot the impulse response.  Calculate ss=s.*i and plot the sampling response.  Stop the program. PROGRAM: a. SAMPLING clc; close all; clear all; t=0:0.01:1; f=5; s=sin(2*pi*f*t); subplot(2,2,1); plot(t,s,'r'); grid; title('SINE WAVE'); xlabel('t--->'); ylabel('x(t)--->'); i=[1,ones(1,100)]; subplot(2,2,2); stem(t,i); grid; title('IMPULSE RESPONSE'); xlabel('n--->'); ylabel('x(n)--->'); ss=s.*i; subplot(2,2,3); stem(t,ss,'g'); xlabel('n--->'); ylabel('x(n)--->'); title('SAMPLING RESPONSE'); grid;
  • 15. ALGORITHM:  Start the program.  Clear the command window and clear all the existing variables and functions.  Close all the existing files in M-file.  Assign t=-10 to 10 ,T=3,fm=1/T ,fs1=1.6fm,fs2=2fm & fs3=8fm.  Calculate x=cos(2*pi*f*t) and plot the cos wave.  Plot the signal fs<fm using xn1=cos(2*pi*n1* fm/fs1).  Plot the signal fs=fm using xn2=cos(2*pi*n2* fm/fs2).  Plot the signal fs>fm using xn3=cos(2*pi*n3* fm/fs3).  Stop the program. Program: EFFECT OF ALIASING clc; clear all; close all; t=-10:.01:10; T=3; fm=1/T; x=cos(2*pi*fm*t); fs1=1.6*fm; fs2=2*fm; fs3=10*fm; n1=-10:1:10 xn1=cos(2*pi*n1*fm/fs1); subplot(2,2,1); plot(t,x); xlabel('time in sec'); ylabel('x(t)'); title('continuous-time signal'); subplot(2,2,2); stem(n1,xn1); hold on subplot(2,2,2); plot(n1,xn1); xlabel('n'); ylabel('x(n)'); title('discreate-time signal with fs<fm '); n2=-10:1:10; xn2=cos(2*pi*n2*fm/fs2); subplot(2,2,3); stem(n2,xn2); hold on subplot(2,2,3); plot(n2,xn2); xlabel('n'); ylabel('x(n)'); title('discreate -time signal with fs=fm'); n3=-10:1:10 xn3=cos(2*pi*n3*fm/fs3); subplot(2,2,4); stem(n3,xn3); hold on subplot(2,2,4); plot(n3,xn3); xlabel('n'); ylabel('x(n)') title('discreate time signal with fs>fm');
  • 16. THEORY: Sampling theorem: A band limited continuous time signal with maximum frequency Fm hertz can be fully recovered from its samples provided that the sampling frequency Fs is greater than or equal to two times the maximum frequency Fm.(Fm≥2*Fm). Aliasing: When the high frequency interferes with low frequency and appears as low frequency. Different ways to avoid aliasing:  Sampling rate fs≥2W  Strictly Band limit the Signal to W Nyquist rate: when the sampling rate becomes exactly equal to 2W samples/sec. for a given bandwidth of W hertz. Nyquist interval: It is the time interval between any two adjacent samples when sampling rate is Nyquist rate.
  • 17. OUTPUT FOR SAMPLING OUTPUT FOR EFFECT OF ALIASING RESULT: The sampling of a signal and the effect of aliasing were performed using MAT LAB. 0 0.05 0.1 0.15 0.2 -1 -0.5 0 0.5 1 SINE WAVE t---> x(t)---> 0 0.05 0.1 0.15 0.2 0 0.2 0.4 0.6 0.8 1 IMPULSE RESPONSE n---> x(n)---> 0 0.05 0.1 0.15 0.2 -1 -0.5 0 0.5 1 n---> x(n)---> SAMPLING RESPONSE
  • 18. Ex.no:3b Date: FFT USING DIT ALGORITHM AIM: To calculate the FFT and IFFT of the sequence using decimation in time algorithm. TOOLS REQUIRED: MAT LAB software ALGORITHM:  Start the program.  Clear the command window and clear all the existing variables and functions.  Close all the existing files in M-file.  Get the input sequence in bit reversal order.  Calculate number of stages m=log2(n), where n is the N-point DFT.  Calculate the twiddle factor.  Find the FFT / IFFT of the sequence.  Stop the program. Theory: The Fast Fourier transform (FFT) is an algorithm used to compute the DFT. It makes use of the symmetry and periodicity properties of twiddle factor WN k to effectively reduce the DFT computation time. It is based on the fundamental principle of decomposing the computation of DFT of a sequence of length N into successively smaller discrete Fourier transforms. The FFT algorithm provides speed –increase factors, when compared with direct computation of the DFT, of approximately 64 and 205 for 256-point and 1024-point transforms respectively. If the number of output points N can be expressed as a power of 2, that is N=2M , where M is an integer, then this algorithm is known as radix-2 FFT algorithm. Decimation in time algorithm is used to calculate the DFT of an N-point sequence. The idea is to break the N-point sequence into two sequences, the DFTs of which can be combined to give the DFT of the original N-point sequence. Initially the N-point sequence is divided into two-N/2 point sequence xe(n) and xo(n) ,which have even and odd members of x(n) respectively. The N/2 point DFTs of these two sequences are evaluated and combined to give the N- point DFT. Similarly the N/2 point DFTs can be expressed as a combination of N/4 point DFTs. This process is continued until we left with 2-point DFT. This process is continued until we left with 2-point DFT. This algorithm is called Decimation in time because the sequence x(n) is often splitted into smaller sequences. Decimation in frequency algorithm the output sequence X(k) is divided into smaller and smaller sub sequences, that is why the name decimation in frequency .Initially the input sequence x(n) is divided into two sequences x1(n) and x2(n) consisting of the first N/2 samples of x(n) and the last N/2 samples of x(n) respectively
  • 19. PROGRAM: %FFT USING DIT clc; clear all; close all; disp('decimation in time'); disp('input in bit reversal order'); n=input('enter N point'); for i1=1:n; x0(i1)=input('enter a number'); x1(i1)=0; x2(i1)=0; end; m=log2(n); for i=1:m; p=n/(2^i); q=n/p; for j1=1:q:n; r=j1; for k=1:q/2; a=x0(r); b=x0(r+q/2); w=cos(2*pi*(k-1)/q)-j*sin(2*pi*(k-1)/q); c=a+b*w; d=a-b*w; x1(r)=c; x1(r+q/2)=d; r=r+1; end; end; x0=x1; x2=x1; x1=0; end; disp('output'); disp('N point dft'); x2
  • 20. OUTPUT: Decimation in time input in bit reversal order enter N point 8 enter a number 0 enter a number 4 enter a number 2 enter a number 6 enter a number 1 enter a number 5 enter a number 3 enter a number 7 output N point dft x2 = Columns 1 through 4 28.0000 -4.0000 + 9.6569i -4.0000 + 4.0000i -4.0000 + 1.6569i Columns 5 through 8 -4.0000 -4.0000 - 1.6569i -4.0000 - 4.0000i -4.0000 - 9.6569i RESULT: The FFT of the sequence was calculated and the output was verified using MAT LAB.
  • 21. Ex.no:4 Date: SPECTRUM ANALYSIS USING DFT AIM: To plot and analysis the Magnitude and Phase spectrum of DFT using MAT LAB. TOOLS REQUIRED: MAT LAB software ALGORITHM:  Start the program.  Clear the command window and clear all the existing variables and functions.  Close all the existing files in M-file.  Get the N values of DFT and input sequence of DFT  Calculate the twiddle factor.  Calculate the value of DFT  Plot the magnitude spectrum using abs command  Plot the phase spectrum using angle command  Stop the program. THEORY: The DFT is used to convert a finite discrete time sequence x(n) to an N point frequency domain sequence(k).The N-point DFT of a finite sequence x(n) of length L,(L<N) is defined as N-1 x(k)= ∑ x(n)e-j2πnk/N K=0,1,2,3,…N-1 n=0
  • 22. Program: clc; clear all; close all; N=input('enter the value of N point dft'); x=input('enter the input value'); L=length(x); if(L>N) disp('N must be greather than or equal to L'); disp('Enter another set of value'); else x1=[x zeros(1,N-L)]; for k=0:1:N-1; for n=0:1:N-1; p=exp(-i*2*pi*n*k/N); x2(k+1,n+1)=p; end end X=x1*x2; X figure; k=0:1:N-1; subplot(2,1,1); stem(k,abs(X)); hold on plot(k,abs(X)); xlabel('k'); ylabel('|x|'); title('Magnitude Response'); subplot(2,1,2) stem(k,angle(X)); hold on plot(k,angle(X)); xlabel('k'); ylabel('angle of x'); title('Phase Response'); end
  • 23. Output: enter the value of N point dft8 enter the input value[1 2 5 4] X = 12.0000 -0.4142 - 9.2426i -4.0000 + 2.0000i 2.4142 + 0.7574i 0 - 0.0000i 2.4142 - 0.7574i -4.0000 - 2.0000i -0.4142 + 9.2426i RESULT: The magnitude and phase spectrum of DFT were obtained and the output was verified using MAT LAB. 0 1 2 3 4 5 6 7 0 2 4 6 8 10 12 k |x| Magnitude Response 0 1 2 3 4 5 6 7 -3 -2 -1 0 1 2 3 k angleofx Phase Response
  • 24. Ex.no:5a Date: DESIGN OF BUTTERWORTH DIGITAL IIR FILTERS AIM: To design Butterworth digital filters (LPF, HPF, BPF and BSF) using MATLAB. TOOLS REQUIRED: MAT LAB software ALGORITHM 1. Get the passband and stopband ripple 2. Get the passband and stopband edge frequencies 3. Get the sampling frequency 4. Calculate the order of the filter 5. Find the filter coefficients 6. Draw the magnitude and phase responses. THEORY:  The filter designed by considering all the infinite samples of impulse response are called IIR filter. The IIR filters are of recursive type, where by present output sample depends on the present input, past input and output samples.  The magnitude response of Butterworth filter decreases monotonically as the frequency Ω increases from 0 to ∞.  The transition band is more in Butterworth filter.  The poles of the Butterworth filter lies on a circle. The magnitude function of the Butterworth filter is given by H(jΩ) = 1/(1+( Ω/ Ωc) 2N N=1,2,3…… where N is the order of the filter and Ωc is the cutoff frequency. The magnitude response of the Butterworth filter closely approximates the ideal response as the order N increases. The phase response becomes more non- linear as N increases.
  • 25. Ex.no:5b Date: DESIGN OF CHEBYSHEV DIGITAL FILTERS AIM: To design Chebyshev digital filters (LPF, HPF, BPF and BSF) using MATLAB. TOOLS REQUIRED: MAT LAB software ALGORITHM 1. Get the passband and stopband ripple 2. Get the passband and stopband edge frequencies 3. Get the sampling frequency 4. Calculate the order of the filter 5. Find the filter coefficients 6. Draw the magnitude and phase responses. THEORY:  The filter designed by considering all the infinite samples of impulse response are called IIR filter. The IIR filters are of recursive type, where by present output sample depends on the present input, past input and output samples.  There are two types of Chebychev filter.they are type-I & type-II filter.  The magnitude response of the Chebychev filter exhibits ripple either in pass band or in stop band according to type.  The poles of the Chebychev filter lies on an ellipse.  The frequency response curve starts from unity for odd values of N, and starts from 1/√ 1+є2 for even values of n.  Magnitude of Chebychev filter decays at the rate of 20N dB/decade.  For | Ω | ≤ 1, 2 varies between 1 and  At cutoff frequency | Ω | = 1,   Order of Chebyshev filter is 𝑁 ≥ cosh−1 √ 100.1𝛼𝑠 − 1 100.1𝛼𝑝 − 1 /cosh−1 ( Ω𝑠 Ω𝑝 ) αs-stop band attenuation. αp-pass band attenuation Ωs-stop band frequency, Ωp-pass band frequency.
  • 26. RESULT: Thus Butterworth and chebyshev digital filters (LPF, HPF, BPF and BSF) have been designed and verified using MATLAB.
  • 27. Ex.no:6 Date: DESIGN OF FIR FILTERS USING WINDOW AIM: To design FIR filters using Hanning, Hanning and Kaiser window. TOOLS REQUIRED: MAT LAB software ALGORITHM: 1. Get the passband and stopband ripple 2. Get the passband and stopband edge frequencies 3. Get the sampling frequency 4. Calculate the order of the filter 5. Find the window coefficients 6. Draw the magnitude and phase responses. THEORY: Filter is a frequency selective device, which amplifies particular range of frequencies and attenuate particular range of frequencies The filter designed by selecting finite number of samples of impulse response (h (n) obtained from inverse Fourier transform of desired frequency response H (w)) are called FIR filters  FIR filter is always stable.  A realizable filter can always be obtained.  FIR filter has a linear phase response.  The necessary and sufficient condition for linear phase characteristics in FIR filter is the impulse response h(n) of the system should have the symmetry property, i.e., h(n) = h(N-1-n) Where N is the duration of the sequence.  One possible ways of obtaining FIR filter is to truncate the infinite Fourier series at n= ±((N-1) /2) where N is the length of the desired sequence. But abrupt truncation of the Fourier series results in oscillation in the pass band and stop band. These oscillations are due to slow convergence of the Fourier series. To reduce these oscillations the Fourier coefficient of the filter are modified by multiplying the infinite impulse response with a finite weighing sequence w(n)  The desirable characteristics of the window are The central lobe of the frequency response of the window should contain most of the energy and should be narrow. The highest side lobe level of the frequency response should be small. The side lobes of the frequency response should decrease in energy rapidly as ω tends to π.
  • 28. RESULT: Thus FIR filters using Hanning / Hamming / Kaiser Window has been designed and verified using MATLAB.
  • 29. Ex.no:7 Date: DESIGN OF MULTIRATE FILTER AIM: To design Multirate filters using up sampling& down sampling. TOOLS REQUIRED: MAT LAB software THEORY:  Multirate signal processing is required in digital systems where more than one sampling rate is required. In digital audio, the different sampling rates used are 32 kHz for broadcasting, 44.1 kHz for compact disc and 48 kHz for audio tape. Different sampling rates can be obtained using an up sampler and down sampler.  The theory of processing signals at different sampling rates is called multirate signal processing.  The discrete time system that employs sampling rate conversion while processing the discrete time signal is called multirate DSP system. Down sampling: Down sampling a sequence x (n) by a factor M is the process of picking every M th sample and discarding the rest. Up sampling: Up sampling by a factor L is the process of inserting L-1 zeros between two consecutive samples. anti-aliasing filter The low pass filter used at the input of decimator is called anti-aliasing filter. It is used to limit the bandwidth of an input to π/D in order to prevent the aliasing of output spectrum of decimator for decimation by D. anti-imaging filter The low pass filter used at the output of an interpolator is called anti-imaging filter. It is used to eliminate the multiple images in the output spectrum of the interpolator. Need for anti-aliasing filter prior to down sampling The spectra obtained after down sampling a signal by a factor M is the sum of all the uniformly shifted and stretched version of original spectrum scaled by a factor 1/M. if the original spectrum is not band limited to π/M, then down sampling will cause aliasing. In order to avoid aliasing the signal x(n) is to be band limited to ±π/M. this can be done by filtering the signal x(n).with a low pass filter with a cutoff frequency of π/M. this filter is known as anti-aliasing filter. Need for anti-imaging filter after upsampling a signal The frequency spectrum of upsampled signal with na factor L, contains (L-1) additional images of the input spectrum .since we are not interested in images spectra, a low filter with a cutoff frequency ωc=π/L can be used after upsampler. This filter is known as anti – imaging filter.
  • 30. UPSAMPLING/DOWNSAMPLING clc; clear all; close all; N=input('enter the value of N:'); n=0:1:N-1; x=input('enter the value:'); L=input('enter the value of up sampling factor'); M=input('enter the value of down sampling factor'); x1=[zeros(1,L*N)]; n1=1:1:L*N; j=1:L:L*N; x1(j)=x; subplot(2,2,1); stem(n,x); xlabel('n-->'); ylabel('x->'); title('input sequence'); subplot(2,2,2); stem(n1,x1); xlabel('n1--->'); ylabel('x1'); title('upsampled sequence'); x2=x(1:M:N); n2=1:1:N/M; subplot(2,2,[3:4]); stem(n2-1,x2); xlabel('n2--->'); ylabel('x2'); title('dwonsampled sequence'); OUTPUT FOR UP/DOWN SAMPLING 0 2 4 6 8 0 2 4 6 8 10 n--> x-> input sequence 0 10 20 30 0 2 4 6 8 10 n1---> x1 upsampled sequence 0 0.5 1 1.5 2 2.5 3 0 2 4 6 8 10 n2---> x2 dwonsampled sequence
  • 31. ANTI IMAGING FILTER clc; close all; clear all; n=0:1:1023; x=1/4*sinc(1/4*(n-512)).^2; i=1:1024; y=[zeros(1,2048)]; y(2*i)=x; f=-2:1/512:2; h1=freqz(x,1,2*pi*f); h2=freqz(y,1,2*pi*f); subplot(3,1,1); plot(f,abs(h1)); xlabel('frequency'); ylabel('magnitude'); title('frequency response of input sequence'); subplot(3,1,2); plot(f,abs(h2)); xlabel('frequency'); ylabel('magnitude'); title('frequency response of upsampled input sequence'); p=fir1(127,.3); xf=filter(p,1,y); h4=freqz(xf,1,2*pi*f); subplot(3,1,3); plot(f,abs(h4)); title('frequency response of output of anti imaging filter'); xlabel('frequency'); ylabel('magnitude'); OUTPUT FOR ANTI IMAGING FILTER -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 0 0.5 1 frequency magnitude frequency response of input sequence -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 0 0.5 1 frequency magnitude frequency response of upsampled input sequence -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 0 0.5 1 frequency response of output of anti imaging filter frequency magnitude
  • 32. ANTI ALIASING FILTER clc; clear all; close all; F=input('enter the highest normalised frequency component'); D=input('enter the decimation factor'); n=0:1:1024; %input sequence xd=F/2*sinc(F/2*(n-512)).^2; f=-2:1/512:2; h1=freqz(xd,1,pi*f);%frequency response subplot(3,1,1),plot(f,abs(h1)) xlabel('frequency'),ylabel('magnitude') title('frequency response of input sequence'); %checking for aliasing if(F*D<=1) xd1=F/2*sinc(F/2*(n-512)*D).^2; h2=freqz(xd1,1,pi*f*D); subplot(3,1,2),plot(f,abs(h2)) axis([-2 2 0 1]) h2=freqz(xd1,1,pi*f*D); subplot(3,1,3),plot(f*D,abs(h2)) axis([-2*D 2*D 0 1]) else %design an antialising filter p=fir1(127,1/D);%filter xf=filter(p,1,xd); h4=freqz(xf,1,pi*f);%output of filter subplot(3,1,2),plot(f,abs(h4)) title('frequency response of output of antialising filter') xlabel('frequency'),ylabel('magnitude') i=1:1:1024/D; xr=xf(i*D);%output of down sampler h5=freqz(xr,1,pi*f*D);%frequency response at the output of down sampler subplot(3,1,3),plot(f*D,abs(h5)) title('frequency response at the output of down sampler') xlabel('frequency'),ylabel('magnitude') end
  • 33. OUTPUT FOR ANTI ALIASING FILTER enter the highest normalised frequency component0.25 enter the decimation factor5 Result: Thus the Multirate filter (anti aliasing & anti imaging) were designed using MATLAB -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 0 0.5 1 frequency magnitude frequency response of input sequence -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 0 0.5 1 frequency response of output of antialising filter frequency magnitude -10 -8 -6 -4 -2 0 2 4 6 8 10 0 0.05 0.1 0.15 0.2 frequency response at the output of down sampler frequency magnitude
  • 34. Ex.no:8 Date: DESIGN OF EQUALIZER AIM: To design equalizer using MATLAB. TOOLS REQUIRED: MAT LAB software ALGORITHM: 1. Get the simulation and channel length. 2. Calculate the cascade impulse response and transmitting signal 3. Calculate channel output and input of the channel equalizer. 4. Apply the NMLS algorithm for channel equalization. 5. Draw the responses of channel equalizer. THEORY: The equalizer is a device that attempts to reverse the distortion incurred by a signal transmitted through a channel. In digital communication its purpose is to reduce inter symbol interference to allow recovery of the transmit symbols. It can be a simple linear filter or a complex algorithm. The types of commonly used equalizers in digital communications are:  Linear Equalizer: It processes the incoming signal with a linear filter.  MSME equalizer: It designs the filter to minimize E[|e|2], where e is the error signal that is the filter output minus the transmitted signal.  Zero forcing Equalizer: It approximates the inverse of the channel with a linear filter.
  • 35.  Decision feedback equalizer: It augments a linear equalizer by adding a filtered version of previous symbol estimates to the original filter output filter. Blind Equalizer: It estimates that the transmitted signal without knowledge of the channel statistics and uses only knowledge of the transmitted signal’s statistics.  Adaptive Equalizer: It is typically a linear equalizer or a DFE, which updates the equalizer parameters (such as the filter coefficients) as it is processes the data. It uses the MSE cost function and it assumes that it makes the correct symbol decisions and uses its estimate of the symbols to compute e which is defined above.  Viterbi Equalizer: It Finds the optimal solution to the equalization problem. It is having a goal to minimize the probability of making an error over the entire sequence.  BCJR Equalizer: It uses the BCJR algorithm whose goal is to minimize the probability that a given bit was incorrectly estimated.  Turbo Equalizer: It applies turbo decoding while treating the channel as a convolutional code. Program: CHANNEL EQUALIZER clear all close all clc %simulation length N = 1000; %channel length M = 5; %number of independent trials T = 100; cascade_impulse_response = zeros(1,2*M-1); for j = 1 : T %training signal u = randn(1,N) %channel to be equalized c = randn(M,1); c = c / norm(c); %channel output z = filter(c,1,u); %additive noise to the channel output SNR = 30; var_v = var(z) * 10^(-SNR/10); v = var_v^0.5 * randn(1,N); %input to the equalizer x = z + v; %NLMS channel equalization w = zeros(M,1); x_regressor = zeros(1,M); step = 0.1; epsilon = 10^(-6); for k = 4 : N x_regressor = [x(k) x_regressor(1:M-1)]; e = u(k-3) - x_regressor * w; w = w + step * x_regressor' * e / (x_regressor * x_regressor' + epsilon); end cascade_impulse_response = cascade_impulse_response + conv(w,c)'; display(j); end figure; stem(cascade_impulse_response/T); title('cascade channel-equalizer impulse response'); xlabel('taps');
  • 36. OUTPUT FOR CHANNEL EQUALIZER Result: Thus the channel equalizer were designed using MATLAB 1 2 3 4 5 6 7 8 9 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 cascade channel-equalizer impulse response taps
  • 37. WORKING PROCEDURE FOR TMS320C6713  Open the vi universal debugger window.  Click projectnew project and give the name to the new project.  Then click file newasm file.  Type the program.  Save the program. Note file type should be asm file.  Projectadd file to project by browsing add our asm file and add the command file to our project by selecting projectadd file to project, command file on type and click micro6713 and open.  Select projectbuild (Wait for compilation of the program).  If program contains no error, click ok. Then click serialport setting and click auto detect to detect any hardware connected pc.  Click serialload program by browsing select our file which is to be downloaded to the kit.  To run the program select serial communication window.  To execute type GO 00006000.  Verify the output by using the SP command.(For Example. SP 80009000).
  • 38. EX.NO:9 DATE: MAC OPERATION USING ADDRESSING MODES AIM: To study about direct, indirect and immediate addressing modes in TMS320C6713 debugger. APPARATUS REQUIRED:  System with TMS 320C6713 debugger software  TMS 320C6713 Kit. Program: Addition: .text start: mvkl .s1 2222h,a5 mvkh .s1 0000h,a5 mvkl .s1 1111h,a10 mvkh .s1 0000h,a10 add a5,a10,a5 mvkl 0x80009000,b4 mvkh 0x80009000,b4 stw a5,*b4 nop 4 .end Input: Reg.a5= 0000 2222 Reg.a10= 0000 1111 Output: 80009000h=0000 3333 Subtraction: .text start: mvkl .s1 3333h,a5 mvkh .s1 0000h,a5 mvkl .s1 1111h,a10 mvkh .s1 0000h,a10 sub a5,a10,a5 mvkl 0x80009000,b4 mvkh 0x80009000,b4 stw a5,*b4 nop nop 4 .end Input: Reg.a5= 0000 2222 Reg.a10= 0000 1111 Output: 80009000h=0000 1111
  • 39. Multiplication: .text start: mvkl .s1 3333h,a5 mvkh .s1 0000h,a5 mvkl .s1 1111h,a10 mvkh .s1 0000h,a10 mpy a5,a10,a5 mvkl 0x80009000,b4 mvkh 0x80009000,b4 stw a5,*b4 nop nop 4 hlt: b hlt nop nop nop nop 6 .end Input: Reg.a5= 0000 2222 Reg.a10= 0000 1111 Output: 80009000h=0246 8642 Result: Thus the programs for addition, subtraction and multiplication operations were performed using different addressing modes in TMS320C6713 processor.
  • 40. EX.NO:10 DATE: WAVEFORM GENERATION USING TMS320C6713 AIM: To generate a signals like saw tooth, sin, square & triangular waveform using TMS320C6713. Tools required: 1. PC 2. C6713 KIT 3. CRO PROGRAM: SQUARE WAVE: .SECT "06000h" .text DAC1 .set 90040008h start: mvkl .s1 DAC1,a0 mvkh .s1 DAC1,a0 nop mvkl 00000000h,a5 mvkh 00000000h,a5 nop nop mvkl 150h,b2 nop positive: nop stw .d1 a5,*a0 nop nop sub b2,1,b2 nop NOP [b2] b positive nop nop mvkl .s1 DAC1,a0 mvkh .s1 DAC1,a0 nop mvkl 00000fffh,a5 mvkh 00000fffh,a5 nop nop mvkl 150h,b2 nop negative: nop stw .d1 a5,*a0 nop nop sub b2,1,b2 nop NOP [b2] b negative nop nop nop nop nop nop b start .end
  • 41. SAWTOOTH WAVE: . sect "06000h" .text dac1 .set 90040008h start: mvkl .s1 dac1,a0 mvkh .s1 dac1,a0 nop mvkl 00000fffh,a5 mvkh 00000fffh,a5 nop nop mvkl 333h,b2 next: nop stw .d1 a5,*a0 nop 5 sub b2,1,b2 nop sub a5,5,a5 nop [b2] b next nop nop nop nop nop nop nop b start .end ************************************************************************ TRIANGULAR WAVE: .sect"06000h" .text dac1 .set 90040008h start: mvkl .s1 dac1,a0 mvkh .s1 dac1,a0 nop mvkl 00000000h,a5 mvkh 00000000h,a5 nop nop mvkl 85h,b2 nop positive: nop stw .d1 a5,*a0 nop nop sub b2,1,b2 nop add a5,5,a5 nop [b2]b positive nop nop mvkl .s1 dac1,a0 mvkh .s1 dac1,a0 nop mvkl 85h,b2 nop negative: nop stw .d1 a5,*a0 nop nop sub b2,1,b2 nop nop sub a5,5,a5 nop [b2]b negative nop nop nop nop nop nop b start .end
  • 42. SIN WAVE: . sect "06000h" .text dac1 .set 90040008h start: nop mvkl table,a0 mvkh table,a0 nop mvkl dac1,a1 mvkh dac1,a1 nop mvkl 0174h,b1 nop loop1: ldw .d1 *a0++[1],a2 nop 5 stw .d1 a2,*a1 nop 5 sub b1,1,b1 nop [b1] b loop1 nop nop 6 b start nop nop 6 hlt: b hlt nop nop 6 table: .word 07ffh .word 0815h .word 082ch .word 0842h .word 0859h .word 0870h .word 0886h .word 089dh .word 08b3h .word 08cah .word 08e0h .word 08f6h .word 090dh .word 0923h .word 0939h .word 094fh .word 0965h .word 097bh .word 0990h .word 09a6h .word 09bbh .word 09d1h .word 09e6h .word 09fbh .word 0a10h .word 0a25h .word 0a3ah .word 0a4eh .word 0a25h .word 0a62h .word 0a77h .word 0a8bh .word 0a9eh .word 0ab2h .word 0ac5h .word 0ad9h .word 0aech .word 0afeh .word 0b11h .word 0b23h .word 0b36h .word 0b47h .word 0b59h .word 0b6bh .word 0b7ch .word 0b8dh .word 0b9eh .word 0baeh .word 0bbeh .word 0bceh .word 0bdeh .word 0bedh .word 0bfch .word 0c0bh .word 0c1ah .word 0c28h .word 0c36h .word 0c43h .word 0c51h .word 0c5eh .word 0c6ah .word 0c77h .word 0c83h .word 0c8fh .word 0c9ah .word 0ca5h .word 0cb0h .word 0cbbh .word 0cc5h .word 0cceh .word 0cd8h .word 0ce1h .word 0ceah .word 0cf2h .word 0cfah .word 0d02h .word 0d09h .word 0d10h .word 0d17h .word 0d1dh .word 0d23h .word 0d28h .word 0d2dh .word 0d32h .word 0d37h .word 0d3bh .word 0d3eh .word 0d42h .word 0d45h .word 0d47h .word 0d49h .word 0d4bh .word 0d4dh .word 0d4eh .word 0d4eh .word 0d4eh .word 0d4eh .word 0d4eh .word 0d4dh
  • 43. .word 0d4ch .word 0d4ah .word 0d48h .word 0d46h .word 0d43h .word 0d40h .word 0d3dh .word 0d39h .word 0d34h .word 0d30h .word 0d2bh .word 0d26h .word 0d20h .word 0d1ah .word 0d13h .word 0d0dh .word 0d05h .word 0cfeh .word 0cf6h .word 0ceeh .word 0ce5h .word 0cdch .word 0cd3h .word 0ccah .word 0cc0h .word 0cb5h .word 0cabh .word 0ca0h .word 0c94h .word 0c89h .word 0c7dh .word 0c71h .word 0c64h .word 0c57h .word 0c4ah .word 0c3dh .word 0c2fh .word 0c21h .word 0c12h .word 0c04h .word 0bf5h .word 0be5h .word 0bd6h .word 0bc6h .word 0bb6h .word 0ba6h .word 0b95h .word 0b84h .word 0b73h .word 0b62h .word 0b50h .word 0b3eh .word 0b2ch .word 0b1ah .word 0b08h .word 0af5h .word 0ae2h .word 0acfh .word 0abch .word 0aa8h .word 0a94h .word 0a80h .word 0a6ch .word 0a58h .word 0a44h .word 0a2fh .word 0a1ah .word 0a06h .word 09f1h .word 09dbh .word 09c6h .word 09b1h .word 099bh .word 0985h .word 0970h .word 095ah .word 0944h .word 092eh .word 0918h .word 0901h .word 08ebh .word 08d5h .word 08beh .word 08a8h .word 0891h .word 087bh .word 0864h .word 084eh .word 0837h .word 0820h .word 080ah .word 07f4h .word 07ddh .word 07c7h .word 07b0h .word 0799h .word 0783h .word 076ch .word 0756h .word 073fh .word 0729h .word 0713h .word 06fch .word 06e6h .word 06d0h .word 06bah .word 06a4h .word 068eh .word 0678h .word 0663h .word 064dh .word 0638h .word 0622h .word 060dh .word 05f8h .word 05e3h .word 05cfh .word 05bah .word 05a6h .word 0591h .word 057dh .word 0569h .word 0556h .word 0542h .word 052fh .word 051ch .word 0509h .word 04f6h .word 04e4h .word 04d1h .word 04bfh .word 04aeh .word 049ch .word 048bh .word 047ah .word 0469h .word 0458h .word 0448h .word 0438h .word 0428h .word 0418h .word 0409h .word 03fah .word 03ech .word 03ddh .word 03cfh .word 03c1h .word 03b4h .word 03a7h .word 039ah .word 038dh .word 0381h .word 0375h .word 0369h .word 035eh .word 0353h .word 0349h .word 033eh .word 0334h .word 032bh .word 0322h .word 0319h .word 0310h .word 0308h .word 0300h .word 02f8h .word 02f1h .word 02ebh .word 02e4h .word 02deh .word 02d8h .word 02d3h .word 02ceh .word 02c9h .word 02c5h .word 02c1h .word 02beh .word 02bbh .word 02b8h .word 02b6h .word 02b4h .word 02b2h .word 02b1h .word 02b0h .word 02b0h .word 02b0h .word 02b0h .word 02b0h
  • 44. .word 02b2h .word 02b3h .word 02b5h .word 02b7h .word 02b9h .word 02bch .word 02c0h .word 02c3h .word 02c7h .word 02cch .word 02d1h .word 02d6h .word 02dbh .word 02e1h .word 02e7h .word 02eeh .word 02f5h .word 02fch .word 0304h .word 030ch .word 0314h .word 031dh .word 0326h .word 0330h .word 0339h .word 0344h .word 034eh .word 0359h .word 0364h .word 036fh .word 037bh .word 0387h .word 0394h .word 03a0h .word 03adh .word 03bbh .word 03c8h .word 03d6h .word 03e5h .word 03f3h .word 0402h .word 0411h .word 0430h .word 0440h .word 0450h .word 0461h .word 0471h .word 0482h .word 0494h .word 04a5h .word 04b7h .word 04c9h .word 04dbh .word 04edh .word 0500h .word 0513h .word 0526h .word 0539h .word 054ch .word 0560h .word 0574h .word 0588h .word 059ch .word 05b0h .word 05c5h .word 05d9h .word 05eeh .word 0603h .word 0618h .word 062dh .word 0643h .word 0658h .word 066eh .word 0683h .word 0699h .word 06afh .word 06c5h .word 06dbh .word 06f2h .word 0708h .word 071eh .word 0734h .word 074bh .word 0761h .word 0778h .word 078eh .end Output signal Amplitude Time period Square Triangular Saw tooth Sin RESULT: The signals like sine, square, triangular & saw tooth wave forms were generated using TMS320C6713 and the output was verified.
  • 45. Ex.no:11 Date: CONVOLUTION AIM: To calculate linear and circular convolution using TMS320C6713. Tools required: 1. PC 2. C6713 KIT PROGRAM: a. Linear convolution: input .set 80001000h ; 00009000h ; coeff .set 80001100h ; 00009050h ; output .set 80001200h ; 00009100h ; buff .set 80001300h ; 00009200h ; .sect "00006000h" .text mvkl input,a4 mvkh input,a4 mvkl coeff,a5 mvkh coeff,a5 add a4,10h,a4 nop 2 add a5,10h,a5 nop 2 mvkl buff,a3 mvkh buff,a3 mvkl output,a6 mvkh output,a6 mvkl 8,b2 mvkh 8,b2 zer: mvkl 00000000h,a2 mvkh 00000000h,a2 stw a2,*a3++ nop 7 stw a2,*a4++ nop 7 stw a2,*a5++ nop 7 stw a2,*a6++ nop 7 sub b2,1h,b2 nop 2 [b2] b zer nop 6 mvkl input,a4 mvkh input,a4 mvkl 7h,b1 mvkh 7h,b1 mvkl output,a9 mvkh output,a9 start1: mvkl coeff,a1 mvkh coeff,a1 mvkl buff,a3 mvkh buff,a3 ldw *a4++[1],a8 nop 6 stw a8,*a3 nop 6 mvkl 4,b0 mvkh 4,b0
  • 46. nop 3 mvkl 00000000H,a7 mvkh 00000000H,a7 loop1: ldw *a1++,a5 nop 6 ldw *a3++,a6 nop 6 mpy a5,a6,a6 nop 4 add a7,a6,a7 nop 2 sub b0,1,b0 nop 2 [b0] b loop1 nop 7 stw a7,*a9++[1] nop 6 mvkl 4,b0 mvkh 4,b0 mvkl buff,b3 mvkh buff,b3 ldw *b3,b4 nop 6 loop2: ; loop to copy x(n) to x(n-1) ldw *+b3(4),b5 nop 6 stw b4,*++b3 nop 6 mv b5,b4 nop 2 sub b0,1,b0 nop 2 [b0]b loop2 nop 6 sub b1,1,b1 nop 2 [b1]b start1 nop 7 halt: b halt nop 7 INPUT/OUTPUT: S.NO INPUT OUTPUT ADDRESS DATA ADDRESS DATA INPUT1:X(N) 80001000 00000001 80001200 00000001 80001004 00000002 80001204 00000004 80001008 00000003 80001208 0000000A 8000100C 00000004 8000120C 00000014 INPUT2:H(N) 80001210 00000019 80001100 00000001 80001214 00000018 80001104 00000002 80001218 00000010 80001108 00000003 8000110C 00000003
  • 47. b. Circular convolution: .sect "00006000h" .text value1 .SET 80001000H ; input value1 value2 .SET 80001100H ; input value2 OMEM .SET 80001200H ; output values IMEM .SET 80001500H ; intermediate start: mvkl value1,a12 mvkh value1,a12 mvkl value2,a13 mvkh value2,a13 add a12,10h,a12 add a13,10h,a12 nop 2 mvkl 8h,b0 mvkh 8h,b0 zero a5 filzer: stw a5,*a12++[1] nop 5 stw a5,*a12++[1] nop 5 sub b0,1,b0 nop 2 [b0]b filzer nop 7 mvkl IMEM,a12 mvkh IMEM,a12 nop mvkl value2,a13 mvkh value2,a13 nop mvkl 4,b0 mvkh 4,b0 nop another: ldw *a13++[1],a4 nop 6 stw a4,*a12++[1] nop 5 sub b0,1,b0 nop [b0] b another nop nop 5 mvkl IMEM,a14 mvkh IMEM,a14 nop ldw *++a14[1],a4 nop 5 ldw *++a14[2],a5 nop 5 stw a4,*a14--[2] nop nop 5 stw a5,*a14 nop nop 5 mvkl OMEM,a10 mvkh OMEM,a10 nop mvkl 4,b2 mvkh 4,b2 nop nextdata: mvkl IMEM,a11 mvkh IMEM,a11 nop mvkl value1,a12 mvkh value1,a12 nop mvkl 4,b0 mvkh 4,b0 nop mvkl 0,a9 mvkh 0,a9 nop next: ldw *a11++[1],a4 nop 6 ldw *a12++[1],a5 nop 6 mpy a4,a5,a6 nop 3
  • 48. add a6,a9,a9 nop 3 sub b0,1,b0 nop 3 [b0] b next nop nop 5 stw a9,*a10++[1] nop nop 5 mvkl back,b11 mvkh back,b11 nop b shift nop nop 5 back: sub b2,1,b2 nop 3 [b2] b nextdata nop nop 5 halt: b halt nop nop 5 shift: mvkl IMEM,a5 mvkh IMEM,a5 nop mvkl 3,b1 mvkh 3,b1 nop ldw *++a5[3],a4 nop 6 mvkl IMEM,a5 mvkh IMEM,a5 nop add a5,8H,a5 nop 2 shloop: ldw *a5++[1],a6 nop 6 stw a6,*a5--[2] nop 6 sub b1,1,b1 nop [b1] b shloop nop nop 6 mvkl IMEM,a5 mvkh IMEM,a5 nop stw a4,*a5 nop 6 b b11 nop nop 6 INPUT/OUTPUT: S.NO INPUT OUTPUT ADDRESS DATA ADDRESS DATA INPUT1:x1(N) 80001000 00000004 80001200 00000018 80001004 00000003 80001204 00000016 80001008 00000002 80001208 00000018 8000100C 00000001 8000120C 0000001e INPUT2:x2(N) 80001100 00000001 80001104 00000002 80001108 00000003 8000110C 00000004 RESULT: Thus the Linear and circular convolution was designed using TMS320C6713 and the output was verified.
  • 49. Ex.no:12 Date: FAST FOURIER TRANSFORM AIM: To calculate N point FFT of signal using TMS320C6713. Tools required: 1. PC 2. C6713 KIT PROGRAM: .sect "00006000h" .text NVAL .SET 80001000H MEMORY .SET 80001100H ; Data input MEMREAL .SET 80001500H ; Real output MEMIMAG .SET 80002500H ; Imaginary output MEMORY1 .SET 80003000H MEMWRI .SET 80003500H BFY .SET 80004200H GRP .SET 80004210H DNS .SET 80004220H STG .SET 80004230H STGC .SET 80004240H B0VAL .SET 80004600H tabcos .set 80005100h tabsin .set 80005200h main: mvkl NVAL,a10 nop mvkh NVAL,a10 nop ldw *a10,b9 nop 6 cmpeq b9,2,b0 nop [b0] b neqtwo nop nop 6 cmpeq b9,4,b0 nop [b0] b neqfour nop nop 6 cmpeq b9,8,b0 nop [b0] b neqeight nop nop 6 mvkl 16,b6 nop mvkh 16,b6 nop cmpeq b9,b6,b0 nop [b0] b neqsix nop nop 6 mvkl 32,b6 nop mvkh 32,b6 nop cmpeq b9,b6,b0 nop [b0] b neqthirty nop nop 6 mvkl 64,b6
  • 50. nop mvkh 64,b6 nop cmpeq b9,b6,b0 nop [b0] b neqsixty nop nop 6 b ncomplete nop nop 6 neqtwo: mvkl tabcos2,a2 nop mvkh tabcos2,a2 nop mvkl tabcos,a3 nop mvkh tabcos,a3 nop stw a2,*a3 nop 6 mvkl tabsin2,a2 nop mvkh tabsin2,a2 nop mvkl tabsin,a3 nop mvkh tabsin,a3 nop stw a2,*a3 nop 6 mvkl B0VAL,a2 nop mvkh B0VAL,a2 nop mvkl 1,a3 nop mvkh 1,a3 nop stw a3,*a2 nop 6 b ncomplete nop nop 6 neqfour: mvkl tabcos4,a2 nop mvkh tabcos4,a2 nop mvkl tabcos,a3 nop mvkh tabcos,a3 nop stw a2,*a3 nop 6 mvkl tabsin4,a2 nop mvkh tabsin4,a2 nop mvkl tabsin,a3 nop mvkh tabsin,a3 nop stw a2,*a3 nop 6 mvkl B0VAL,a2 nop mvkh B0VAL,a2 nop mvkl 2,a3 nop mvkh 2,a3 nop stw a3,*a2 nop 6 b ncomplete nop nop 6 neqeight: mvkl tabcos8,a2 nop mvkh tabcos8,a2 nop mvkl tabcos,a3 nop mvkh tabcos,a3 nop stw a2,*a3 nop 6 mvkl tabsin8,a2 nop mvkh tabsin8,a2 nop mvkl tabsin,a3 nop mvkh tabsin,a3 nop stw a2,*a3 nop 6 mvkl B0VAL,a2 nop mvkh B0VAL,a2 nop mvkl 3,a3 nop mvkh 3,a3 nop stw a3,*a2 nop 6 b ncomplete nop nop 6 neqsix: mvkl tabcos16,a2 nop mvkh tabcos16,a2 nop mvkl tabcos,a3 nop mvkh tabcos,a3 nop stw a2,*a3 nop 6 mvkl tabsin16,a2 nop mvkh tabsin16,a2 nop mvkl tabsin,a3 nop mvkh tabsin,a3 nop stw a2,*a3 nop 6 mvkl B0VAL,a2 nop mvkh B0VAL,a2
  • 51. nop mvkl 4,a3 nop mvkh 4,a3 nop stw a3,*a2 nop 6 b ncomplete nop nop 6 neqthirty: mvkl tabcos32,a2 nop mvkh tabcos32,a2 nop mvkl tabcos,a3 nop mvkh tabcos,a3 nop stw a2,*a3 nop 6 mvkl tabsin32,a2 nop mvkh tabsin32,a2 nop mvkl tabsin,a3 nop mvkh tabsin,a3 nop stw a2,*a3 nop 6 mvkl B0VAL,a2 nop mvkh B0VAL,a2 nop mvkl 5,a3 nop mvkh 5,a3 nop stw a3,*a2 nop 6 b ncomplete nop nop 6 neqsixty: mvkl tabcos64,a2 nop mvkh tabcos64,a2 nop mvkl tabcos,a3 nop mvkh tabcos,a3 nop stw a2,*a3 nop 6 mvkl tabsin64,a2 nop mvkh tabsin64,a2 nop mvkl tabsin,a3 nop mvkh tabsin,a3 nop stw a2,*a3 nop 6 mvkl B0VAL,a2 nop mvkh B0VAL,a2 nop mvkl 6,a3 nop mvkh 6,a3 nop stw a3,*a2 nop 6 ncomplete: mvkl MEMORY,a10 nop mvkh MEMORY,a10 nop ;shr b9,1,a1 mv b9,a1 nop 3 ;mvkl 8,a1 ;nop ; mvkh 8,a1 ; nop mvkl MEMORY1,a11 nop mvkh MEMORY1,a11 nop copymem: ldw *a10++[1],a12 nop 6 stw a12,*a11++[1] nop 6 sub a1,1,a1 nop [a1] b copymem nop nop 6 b bitrev nop nop 6 mainret1: b inczer nop nop 6 mainret2: mvkl 1,a4 ; BFY same for all nop mvkh 1,a4 nop shr b9,1,a5; GRP (N/2) nop 3 mvkl 2,a6 ; DNS same nop mvkh 2,a6 nop ; mvkl 3,a7 ; STG N = 2^x ; nop ; mvkh 3,a7 ; nop ; mvkl 2,a8 ; STGC (x-1) ; nop ; mvkh 2,a8 ; nop mvkl B0VAL,b15 ; stage loop x nop mvkh B0VAL,b15 nop ldw *b15,b0
  • 52. nop 6 stgloop: zero b3 ; (((b3))) -> k mv a6,b6 nop 3 mv a5,a9 shr b9,1,a15 nop 5 cmpeq a5,a15,a1 ; (N/2) nop [!a1] b nochg nop nop 6 zero a9 ; a9 -> INCTF nop nochg: mv a9,a9 ; INCTF nop mv a5,b1 nop mvkl MEMWRI,b10 nop mvkh MEMWRI,b10 nop grploop: zero b3 ; k mv a4,b2 ; ar4 nop bfyloop: ldw *b10++[b6],b7 nop 6 mvkl mulbk,b12 nop mvkh mulbk,b12 nop b mul nop nop 6 mulbk: mv a6,b6 nop 3 ldw *b10--[b6],b7 nop 6 mvkl adsmbk,b13 nop mvkh adsmbk,b13 nop b adsm nop nop 6 adsmbk: add b3,a9,b3 nop sub b2,1,b2 nop [b2] b bfyloop nop nop 6 mv a6,b6 nop 3 ldw *b10++[b6],b7 nop 6 sub b1,1,b1 nop [b1] b grploop nop nop 6 mpy a4,2,a4 nop mpy a6,2,a6 nop 3 mv a6,b6 nop 3 shr a5,1,a5 nop sub b0,1,b0 nop [b0] b stgloop nop nop 6 mvkl MEMWRI,a9 nop mvkh MEMWRI,a9 nop mv b9,b0 ; N nop 3 mvkl MEMREAL,a10 nop mvkh MEMREAL,a10 nop mvkl MEMIMAG,a11 nop mvkh MEMIMAG,a11 nop separate: ldw *a9++[1],a5 nop 6 stw a5,*a10++[1] nop 6 ldw *a9++[1],a5 nop 6 stw a5,*a11++[1] nop 6 sub b0,1,b0 nop [b0] bseparate nop nop 6 halt: b halt nop nop 5 inczer: mvkl MEMORY1,a4 nop mvkh MEMORY1,a4 nop mvkl MEMWRI,a5 nop mvkh MEMWRI,a5 nop ;mvkl 8,b0 ;N ;nop ; mvkh 8,b0 ; nop mv b9,b0 nop 5 inszer: ldw *a4++[1],a6 nop 5
  • 53. stw a6,*a5++[1] nop 5 zero a6 stw a6,*a5++[1] nop 5 sub b0,1,b0 nop [b0] b inszer nop nop 6 b mainret2 nop nop 6 bitrev: mvkl MEMORY1,b1 nop mvkh MEMORY1,b1 nop mvkl 1,b3 nop mvkh 1,b3 nop mvkl 1,b2 nop mvkh 1,b2 nop mainloop: cmpgt b3,b2,b0 nop [!b0] b noswap nop nop 6 sub b3,1,b4 nop ldw *b1++[b4],a5 nop 6 ldw *b1--[b4],a5 nop 6 sub b2,1,b5 nop ldw *b1++[b5],a6 nop 6 ldw *b1,a6 nop 6 stw a5,*b1--[b5] nop 6 stw a6,*++b1[b4] nop 6 ldw *b1--[b4],a10 nop 6 noswap: mv b9,b7 nop 6 ;mvkl 8,b7 ; N ; 8,16,32 ;nop ;mvkh 8,b7 ; 8,16,32 ;nop shr b7,1,b7 nop shloop: cmpgt b3,b7,b0 nop [!b0] b gtnsat nop nop 6 mvkl 1,b8 nop mvkh 1,b8 nop cmpgt b7,b8,b0 nop [!b0] b gtnsat nop nop 6 sub b3,b7,b3 nop shr b7,1,b7 nop b shloop nop nop 6 gtnsat: add b3,b7,b3 nop add b9,1,a8 nop 5 ;mvkl 9,a8 ; 9,17,33 ;nop ;mvkh 9,a8 ; 9,17,33 ;nop add b2,1,b2 nop cmplt b2,a8,a2 nop [a2] b mainloop nop nop 6 b mainret1 nop nop 6 mul: mvkl tabcos,b11 nop mvkh tabcos,b11 nop ldw *b11,b14 nop 6 mv b3,b6 nop 3 ldw *b14++[b6],a10 nop 6 ldw *b14,a10 ; c nop 6 mvkl tabsin,b11 nop mvkh tabsin,b11 nop ldw *b11,b14 nop 6 mv b3,b6 nop 3 ldw *b14++[b6],a11 nop 6 ldw *b14,a11 ; d nop 6
  • 54. ldw *b10++[1],a12 ; a nop 6 ldw *b10--[1],a13 ; b nop 6 zero a14 nop mpyi a12,a10,a14 ; ac nop 9 zero a15 nop mpyi a11,a13,a15 ; bd nop 9 sub a14,a15,a14 ; ac-bd nop 2 shr a14,8,a14 nop 2 stw a14,*b10++[1] nop 6 mpyi a12,a11,a14 ; ad nop 9 mpyi a10,a13,a15 ; bc nop 9 add a14,a15,a14 ; ad+bc nop 2 shr a14,8,a14 nop 2 stw a14,*b10--[1] nop 6 mv a6,b6 nop 3 b b12 nop nop 6 adsm: ldw *b10++[b6],b7 nop 6 mv b7,a10 nop 3 ldw *b10--[b6],b8 nop 6 mv b8,a11 nop 3 add b7,b8,b7 nop stw b7,*b10 nop 6 sub a10,a11,a12 nop ldw *b10++[b6],a10 nop 6 stw a12,*b10--[b6] nop 6 ldw *b10++[1],b7 nop 6 ldw *b10++[b6],b7 nop 6 mv b7,a10 nop ldw *b10--[b6],b8 nop 6 mv b8,a11 nop add b7,b8,b7 nop stw b7,*b10 nop 6 sub a10,a11,a12 nop ldw *b10++[b6],a10 nop 6 stw a12,*b10--[b6] nop 6 ldw *b10--[1],a10 nop 6 ldw *b10++[2],a10 nop 6 b b13 nop nop 6
  • 55. tabcos2: .word 000000100H tabsin2: .word 000000000H tabcos4: .word 000000100H .word 000000000H tabsin4: .word 000000000H .word 0FFFFFF00H tabcos8: .word 000000100H .word 0000000B5H .word 000000000H .word 0FFFFFF4BH tabsin8: .word 000000000H .word 0FFFFFF4BH .word 0FFFFFF00H .word 0FFFFFF4BH tabcos16: .word 00000100h .word 000000edh .word 000000b5h .word 00000061h .word 00000000h .word 0ffffff9fh .word 0ffffff4bh .word 0ffffff14h tabsin16: .word 000000000h .word 0ffffff9fh .word 0ffffff4bh .word 0ffffff14h .word 0ffffff00h .word 0ffffff14h .word 0ffffff4bh .word 0ffffff9fh tabcos32: .word 00000100h .word 000000fbh ; fb fa .word 000000ech ; ec ed .word 000000d4h .word 000000b5h .word 0000008eh ; 8e 8d .word 00000061h .word 00000031h .word 00000000h .word 0ffffffcfh .word 0ffffff9fh .word 0ffffff72h ; 72 73 .word 0ffffff4bh .word 0ffffff2ch .word 0ffffff14h .word 0ffffff05h ;05 06 tabsin32: .word 00000000h .word 0ffffffcfh .word 0ffffff9fh .word 0ffffff72h ;72 73 .word 0ffffff4bh .word 0ffffff2ch .word 0ffffff14h .word 0ffffff05h ;05 06 .word 0ffffff00h .word 0ffffff05h ;05 06 .word 0ffffff14h .word 0ffffff2ch .word 0ffffff4bh .word 0ffffff72h ;72 73 .word 0ffffff9fh .word 0ffffffcfh tabcos64: .word 000000100H .word 0000000feH .word 0000000fbH .word 0000000f4H .word 0000000ecH .word 0000000e1H .word 0000000d4H .word 0000000c5H .word 0000000b5H .word 0000000a2H .word 00000008eH .word 000000078H .word 000000061H .word 00000004aH .word 000000031H .word 000000019H
  • 56. .word 000000000H .word 0ffffffe7H .word 0ffffffcfH .word 0ffffffb6H .word 0ffffff9fH .word 0ffffff88H .word 0ffffff72H .word 0ffffff5eH .word 0ffffff4bH .word 0ffffff3bH .word 0ffffff2cH .word 0ffffff1fH .word 0ffffff14H .word 0ffffff0cH .word 0ffffff05H .word 0ffffff02H tabsin64: .word 000000000H .word 0ffffffe7H .word 0ffffffcfH .word 0ffffffb6H .word 0ffffff9fH .word 0ffffff88H .word 0ffffff72H .word 0ffffff5eH .word 0ffffff4bH .word 0ffffff3bH .word 0ffffff2cH .word 0ffffff1fH .word 0ffffff14H .word 0ffffff0cH .word 0ffffff05H .word 0ffffff02H .word 0ffffff00H .word 0ffffff02H .word 0ffffff05H .word 0ffffff0cH .word 0ffffff14H .word 0ffffff1fH .word 0ffffff2cH .word 0ffffff3bH .word 0ffffff4bH .word 0ffffff5eH .word 0ffffff72H .word 0ffffff88H .word 0ffffff9fH .word 0ffffffb6H .word 0ffffffcfH .word 0ffffffe7H S.NO INPUT OUTPUT(REAL PART) OUTPUT(IMAGINARY PART) ADDRESS DATA ADDRESS DATA ADDRESS DATA 1 80001000h 00000000h 80001300h 00001C00h 80001400h 00000000h 2 80001004h 00000100h 80001304h FFFFFC00h 80001404h 000009A8h 3 80001008h 00000200h 80001308h FFFFFC00h 80001408h 00000400h 4 8000100Ch 00000300h 8000130ch FFFFFC00h 8000140ch 000001A8h 5 80001010h 00000400h 80001310h FFFFFC00h 80001410h 00000000h 6 80001014h 00000500h 80001314h FFFFFC00h 80001414h FFFFFE58h 7 80001018h 00000600h 80001318h FFFFFC00h 80001418h FFFFFC00h 8 8000101Ch 00000700h 8000131ch FFFFFC00h 8000141ch FFFFF658h RESULT: The N point FFT was designed using TMS320C6713 and the output was verified.
  • 57. Ex.no:13 Date: DESIGN OF FIR LOW PASS FILTER USING TMS320C6713 AIM: To design window based FIR low pass filter for the following specifications Filter type : FIR-LPF Window type : Rectangular window Sampling frequency : 41khz Cut-off frequency : 4khz No. of taps : 52 Tools required: 1. PC 2. C6713 KIT 3. CRO 4. Function Generator PROGRAM: .sect"00006000h" .text adcsoc1 .set 9004000ch adcsoc2 .set 9004000eh adcdata .set 90040008h adc2 .set 90040008h dac1 .set 90040008h dac2 .set 9004000ah mvkl 0x01800004,a0 mvkh 0x01800004,a0 mvkl 01e0c712h,a1 mvkh 01e0c712h,a1 sth a1,*a0 nop 6 b start nop 7 coeff: .word 01fh .word 010eh .word 01abh .word 01b4h .word 0117h .word 0h .word 0fecdh .word 0fdeeh .word 0fdc2h .word 0fe6eh .word 0ffcdh .word 016fh .word 02c0h .word 0333h .word 0274h .word 097h .word 0fe19h .word 0fbcbh .word 0fa9bh .word 0fb53h .word 0fe50h .word 0362h .word 09c5h
  • 58. .word 01048h .word 01599h .word 01895h .word 01895h .word 01599h .word 01048h .word 09c5h .word 0362h .word 0fe50h .word 0fb53h .word 0fa9bh .word 0fbcbh .word 0fe19h .word 097h .word 0274h .word 0333h .word 02c0h .word 016fh .word 0ffcdh .word 0fe6eh .word 0fdc2h .word 0fdeeh .word 0fecdh .word 0h .word 0117h .word 01b4h .word 01abh .word 010eh .word 01fh start: mvkl coeff,a1 mvkh coeff,a1 mvkl 80031200h,a3 mvkh 80031200h,a3 mvkl adcsoc1,a10 mvkh adcsoc1,a10 mvkl adcdata,a0 mvkh adcdata,a0 mvkl 0x00000fff,a12 mvkh 0x00000fff,a12 mvkl 0x0800,a13 mvkh 0x0800,a13 mvkl dac1,a15 mvkh dac1,a15 mvkl 52,b2 mvkl 52,b2 zer: mvkl 00000000h,a2 mvkh 00000000h,a2 stw a2,*a3++ nop 7 sub b2,1h,b2 nop 2 [b2]b zer nop 6 mvkl 80031200h,a3 mvkh 80031200h,a3 start1: ldh *a10,a2 nop 6 ldh *a0,a2 nop 6 and a12,a2,a14 xor a14,a13,a2 sub a2,a13,a2 sth a2,*a3 nop 6 mvkl 52,b0 mvkh 52,b0 nop 3 mvkl 00000000h,a7 mvkh 00000000h,a7 loop1: ldw *a1++,a5 nop 6 ldh *a3++,a6 nop 6 mpy a5,a6,a6 nop 4 shru a6,10h,a6 nop 3 add a7,a6,a7 nop 2 sub b0,1,b0 nop 2 [b0]b loop1 nop 7 mvkl 0x0800,a13 mvkh 0x0800,a13 add a7,a13,a7 nop 4 sth a7,*a15
  • 59. nop 6 mvkl 52,b1 mvkl 80031200h,b3 mvkh 80031200h,b3 ldh *b3,b4 nop 6 loop2: ldh *+b3(2),b5 nop 6 sth b4,*++b3 nop 6 mv b5,b4 nop 2 sub b1,1h,b1 nop 2 [b1]b loop2 nop 6 mvkl coeff,a1 mvkh coeff,a1 mvkl 80031200h,a3 mvkh 80031200h,a3 b start1 nop 7 .end Output: Input voltage:___________________ V S.No Frequency in KHz Output voltage in volts Gain in db 1 2 3 4 5 6 RESULT: The FIR low pass filter was designed using TMS320C6713 and the output was verified.
  • 60. Ex.no:14 Date: DESIGN OF IIR LOW PASS FILTER USING TMS320C6713 AIM: To design window based IIR low pass filter for the following specifications Filter type : IIR-LPF Sampling frequency : 41khz Cut-off frequency : 3800hz No. of taps : 52 Tools required: 1. PC 2. C6713 KIT 3. CRO 4. Function Generator PROGRAM: ca10 .set 0100h ca11 .set 0ffa2h ca12 .set 0032h cb10 .set 0100h cb11 .set 0200h cb12 .set 0100h gain .set 0034h xn .set 00009500h xnm1 .set 00009504h xnm2 .set 00009508h yn .set 0000950ch ynm1 .set 00009510h ynm2 .set 00009514h ynout .set 00009518h adcsoc1 .set 9004000ch adcdat1 .set 90040008h dac1 .set 90040008h
  • 61. .sect "00006000h" .text mvkl xn,a4 mvkh xn,a4 mvkl 0h,a5 mvkh 0h,a5 mvkl 6,b0 mvkh 6,b0 filz: stw a5,*a4++[1] nop 5 sub b0,1,b0 nop [b0] b filz nop nop 6 start: nop mvkl adcsoc1,a3 mvkh adcsoc1,a3 nop nop ldw *a3,b3 nop 6 mvkl adcdat1,a4 mvkh adcdat1,a4 nop nop ldw *a4,b3 nop 6 mvkl 00000fffh,b4 mvkh 00000fffh,b4 and b3,b4,b3 nop mvkl 00000800h,b4 mvkh 00000800h,b4 xor b4,b3,b3 mvkl 00000800h,b4 mvkh 00000800h,b4 sub b3,b4,b3 nop mvkl xn,b4 mvkh xn,b4 stw b3,*b4 nop 6 mvkl 0h,a4 mvkh 0h,a4 mvkl xn,b4 mvkh xn,b4 mvkl cb10,b5 mvkh cb10,b5 ldw *b4,b6 nop 6 mpy b5,b6,b7 nop 2 shru b7,8,b7 add a4,b7,a4 nop 2 mvkl xnm1,b4 mvkh xnm1,b4 mvkl cb11,b5 mvkh cb11,b5 ldw *b4,b6 nop 6 mpy b5,b6,b7 nop 2 shru b7,8,b7 add a4,b7,a4 nop 2 mvkl xnm2,b4 mvkh xnm2,b4 mvkl cb12,b5 mvkh cb12,b5 ldw *b4,b6 nop 6 mpy b5,b6,b7 nop 2 shru b7,8,b7 add a4,b7,a4 nop 2 mvkl ynm1,b4 mvkh ynm1,b4 mvkl ca11,b5 mvkh ca11,b5 ldw *b4,b6 nop 6 mpy b5,b6,b7 nop 2 shru b7,8,b7 sub a4,b7,a4 nop 2 mvkl ynm2,b4 mvkh ynm2,b4 mvkl ca12,b5 mvkh ca12,b5 ldw *b4,b6 nop 6 mpy b5,b6,b7 nop 2 shru b7,8,b7 sub a4,b7,a4 nop 2 mvkl yn,b4 mvkh yn,b4 stw a4,*b4 nop 5 mvkl gain,b4 mvkh gain,b4 mvkl yn,b5 mvkh yn,b5 mvkl ynout,b3 mvkh ynout,b3 ldw *b5,b6 nop 6 mpy b4,b6,b7 nop 2 shru b7,8,b7 sub a4,b7,a4 nop 2 stw a4,*b3 nop 6
  • 62. mvkl ynm1,b4 mvkh ynm1,b4 mvkl ynm2,b5 mvkh ynm2,b5 ldw *b4,b6 nop 6 stw b6,*b5 nop 5 mvkl yn,b4 mvkh yn,b4 mvkl ynm1,b5 mvkh ynm1,b5 ldw *b4,b6 nop 6 stw b6,*b5 nop 5 mvkl xnm1,b4 mvkh xnm1,b4 mvkl xnm2,b5 mvkh xnm2,b5 ldw *b4,b6 nop 6 stw b6,*b5 nop 5 mvkl xn,b4 mvkh xn,b4 mvkl xnm1,b5 mvkh xnm1,b5 ldw *b4,b6 nop 6 stw b6,*b5 nop 5 mvkl ynout,b3 mvkh ynout,b3 ldw *b3,b4 nop 6 mvkl 00000800h,b6 mvkh 00000800h,b6 add b4,b6,b4 nop ; sth b4,*a1++[1] ; nop 6 mvkl dac1,a3 mvkh dac1,a3 nop sth b4,*a3 nop 6 b start nop nop 6 halt: b halt nop nop 5
  • 63. Output: Input voltage: __________V S.No Frequency in KHz Output voltage in (mv)volts Gain in db 1 2 3 4 5 6 7 8 9 RESULT: The FIR low pass filter was designed using TMS320C6713 and the output was verified.
  • 64. Ex.no:15 Date: STUDY OF SIGNAL PROCESSING ARCHITECTURE TMS320C6713 Aim: To study the TMS320C 6713 DSP processor architecture Theory: The TMS320C6x are the first processors to use velociTI architecture, having implemented the VLIW architecture. The TMS320C62x is a 16-bit fixed point processor and the ‘67x is a floating point processor, with 32-bit integer support. The discussion in this chapter is focused on the TMS320C67x processor. The architecture and peripherals associated with this processor are also discussed. The C6713 DSK is a low-cost standalone development platform that enables users to evaluate and develop applications for the TI C67xx DSP family. The DSK also serves as a hardware reference design for the TMS320C6713 DSP. Schematics, logic equations and application notes are available to ease hardware development and reduce time to market. FEATURES  A Texas Instruments TMS320C6713 DSP operating at 225 MHz.  An AIC23 stereo codec  16 Mbytes of synchronous DRAM  512 Kbytes of non-volatile Flash memory (256 Kbytes usable in default configuration)  4 user accessible LEDs and DIP switches  Software board configuration through registers implemented in CPLD  Configurable boot options  Standard expansion connectors for daughter card use  JTAG emulation through on-board JTAG emulator with USB host  Interface or external emulator  Single voltage power supply (+5V)  VelociTI Very Long Instruction Word(VLIW) CPU Core Fetches eight 32-bit instructions at once
  • 65.  Eight Independent functional units  Four ALUs (fixed and floating-point)  Two ALUs (fixed-point)  Two multipliers (fixed and floating-point)  32*32 bit integer multiply with 32 or 64-bit result  Instruction Set Features  Hardware support for IEEE single and double precision floating-point operations 8, 16, and 32-bit addressable 8-bit over overflow protection and saturation Bit-field extract, set, clear; bit-counting; normalization Addressing Modes  Linear Addressing -with all registers  Circular Addressing -with registers A4-A7 and B4-B7 TMS320C6713 DSK The DSP on the 6713 DSK interfaces to on-board peripherals through a 32-bit wide EMIF (External Memory InterFace). The SDRAM, Flash and CPLD are all connected to the bus. EMIF signals are also connected daughter card expansion connectors which are used for third party add-in boards.
  • 66. The DSP interfaces to analog audio signals through an on-board AIC23 codec and four 3.5 mm audio jacks (microphone input, line input, line output, and headphone output). The codec can select the microphone or the line input as the active input. The analog output is driven to both the line out (fixed gain) and headphone (adjustable gain) connectors. McBSP0 is used to send commands to the codec control interface while McBSP1 is used for digital audio data. McBSP0 and McBSP1 can be re-routed to the expansion connectors in software. A programmable logic device called a CPLD is used to implement glue logic that ties the board components together. The CPLD has a register based user interface that lets the user configure the board by reading and writing to its registers. The DSK includes 4 LEDs and a 4 position DIP switch as a simple way to provide the user with interactive feedback. Both are accessed by reading and writing to the CPLD registers. An included 5V external power supply is used to power the board. On-board switching voltage regulators provide the +1.26V DSP core voltage and +3.3V I/O supplies. The board is held in reset until these supplies are within operating specifications. Code Composer communicates with the DSK through an embedded JTAG emulator with a USB host interface. The DSK can also be used with an external emulator through the external JTAG connector. The processor consists of three main parts: CPU, peripherals and memory. Result: Thus the TMS320C6713 Architecture were Studied.
  • 67. DESIGN OF BUTTERWORTH DIGITAL IIR FILTERS LOW PASS HIGH PASS BAND PASS BAND STOP clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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); [b,a]=butter(n,wn); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency----->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians------->’); xlabel(‘Normalised frequency----->’); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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); [b,a]=butter(n,wn,’high’); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency---->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians------->’); xlabel(‘Normalised frequency---->’); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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); wn=[w1,w2]; [b,a]=butter(n,wn,’bandpass’); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency----->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians------->’); xlabel(‘Normalised frequency----->’); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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); wn=[w1,w2]; [b,a]=butter(n,wn,’ stop’); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency----->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians------->’); xlabel(‘Normalised frequency----->’);
  • 68. DESIGN OF CHEBYSHEV DIGITAL IIR FILTERS LOW PASS HIGH PASS BAND PASS BAND STOP clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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]= cheblord(w1,w2,rp,rs); [b,a]=chebyl(n,rp,wn); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency----->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians----->’); xlabel(‘Normalised frequency----->’); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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]= cheblord(w1,w2,rp,rs); [b,a]=chebyl(n,rp,wn, highpass ); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency----->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians----->’); xlabel(‘Normalised frequency----->’); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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]= cheblord(w1,w2,rp,rs); wn=[w1,w2]; [b,a]=chebyl(n,rp,wn,’bandpass’); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency----->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians----->’); xlabel(‘Normalised frequency----->’); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); 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]= cheblord(w1,w2,rp,rs); wn=[w1,w2]; [b,a]=chebyl(n,rp,wn,’stop’); w=0:.01:pi; [h,om]=freqz(b,a,w); m=20*log10(abs(h)); an=angle(h); subplot(2,1,1); plot(om/pi,m); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency----->’); subplot(2,1,2); plot(om/pi,an); ylabel(‘Phase in radians----->’); xlabel(‘Normalised frequency----->’);
  • 69. OUTPUT FOR IIR FILTER LOW PASS HIGH PASS BAND PASS BAND STOP enter the passband ripple20 enter the stopband ripple40 enter the passband freq500 enter the stopband freq1000 enter the sampling freq5000 enter the passband ripple20 enter the stopband ripple40 enter the passband freq500 enter the stopband freq1000 enter the sampling freq5000 enter the passband ripple20 enter the stopband ripple40 enter the passband freq500 enter the stopband freq1000 enter the sampling freq5000 enter the passband ripple20 enter the stopband ripple40 enter the passband freq500 enter the stopband freq1000 enter the sampling freq5000 BUTTERWORTH IIR FILTERS CHEBYSHEV DIGITAL FILTERS 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -250 -200 -150 -100 -50 0 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -4 -2 0 2 4 Phaseinradians-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -100 -80 -60 -40 -20 0 20 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -4 -2 0 2 4 Phaseinradians-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -250 -200 -150 -100 -50 0 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -4 -2 0 2 4 Phaseinradians-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -120 -100 -80 -60 -40 -20 0 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -4 -2 0 2 4 Phaseinradians-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -250 -200 -150 -100 -50 0 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -4 -2 0 2 4 Phaseinradians-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -150 -100 -50 0 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -3 -2 -1 0 1 2 3 Phaseinradians-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -250 -200 -150 -100 -50 0 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -3 -2 -1 0 1 2 3 Phaseinradians-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -150 -100 -50 0 50 GainindB-------> Normalised frequency-----> 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -3 -2 -1 0 1 2 3 Phaseinradians-------> Normalised frequency----->
  • 70. DESIGN OF FIR FILTERS USING WINDOWS HANNING HAMMING KAISER clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); fp=input(‘enter the passband freq’); fs=input(‘enter the stopband freq’); f=input(‘enter the sampling freq’); 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)~=0) n1=n; n=n-1; end y=hanning(n1); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); fp=input(‘enter the passband freq’); fs=input(‘enter the stopband freq’); f=input(‘enter the sampling freq’); 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)~=0) n1=n; n=n-1; end y=hamming(n1); clc; clear all; close all; format long rp=input(‘enter the passband ripple’); rs=input(‘enter the stopband ripple’); fp=input(‘enter the passband freq’); fs=input(‘enter the stopband freq’); f=input(‘enter the sampling freq’); 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)~=0) n1=n; n=n-1; end beta=5.8; y=kaiser(n1,beta); LOW PASS HIGH PASS BAND PASS BAND STOP %lowpass 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); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency-->’); %highpass 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); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency--->’); %bandpass 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); ylabel(‘Gain in dB---->’); xlabel(‘Normalised frequency-->’); %bandstop 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); ylabel(‘Gain in dB------->’); xlabel(‘Normalised frequency-->’);
  • 71. OUTPUT FOR FIR FILTER USING WINDOWS HANNING HAMMING KAISER enter the passband ripple0.03 enter the stopband ripple0.01 enter the passband freq1400 enter the stopband freq2000 enter the sampling freq8000 enter the passband ripple0.02 enter the stopband ripple0.01 enter the passband freq1200 enter the stopband freq1700 enter the sampling freq9000 enter the passband ripple0.02 enter the stopband ripple0.01 enter the passband freq1000 enter the stopband freq1500 enter the sampling freq10000 0 0.2 0.4 0.6 0.8 1 -150 -100 -50 0 50 GainindB-------> Normalised frequency-------> low pass filter 0 0.2 0.4 0.6 0.8 1 -80 -60 -40 -20 0 20 GainindB-------> Normalised frequency-------> hgh pass filter 0 0.2 0.4 0.6 0.8 1 -120 -100 -80 -60 -40 -20 0 GainindB-------> Normalised frequency-------> band pass filter 0 0.2 0.4 0.6 0.8 1 -15 -10 -5 0 5 GainindB-------> Normalised frequency-------> band stop filter 0 0.2 0.4 0.6 0.8 1 -150 -100 -50 0 50 GainindB-------> Normalised frequency-------> low pass filter 0 0.2 0.4 0.6 0.8 1 -100 -80 -60 -40 -20 0 20 GainindB-------> Normalised frequency-------> hgh pass filter 0 0.2 0.4 0.6 0.8 1 -120 -100 -80 -60 -40 -20 0 GainindB-------> Normalised frequency-------> band pass filter 0 0.2 0.4 0.6 0.8 1 -15 -10 -5 0 5 GainindB-------> Normalised frequency-------> band stop filter 0 0.2 0.4 0.6 0.8 1 -150 -100 -50 0 50 GainindB-------> Normalisedfrequency-------> lowpass filter 0 0.2 0.4 0.6 0.8 1 -150 -100 -50 0 50 GainindB-------> Normalisedfrequency-------> hghpass filter 0 0.2 0.4 0.6 0.8 1 -150 -100 -50 0 50 GainindB-------> Normalisedfrequency-------> bandpass filter 0 0.2 0.4 0.6 0.8 1 -15 -10 -5 0 5 GainindB-------> Normalisedfrequency-------> bandstopfilter
  • 72. Erode Sengunthar Engineering College (Approved by AICTE, New Delhi, Affiliated to Anna University – Chennai & Accredited by National Board of Accreditation (NBA), New Delhi.) Erode 638 057 DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING DSP LAB VIVA QUESTION 1. What is MATLAB? 2. What are the applications of MATLAB? 3. Define discrete time and digital signal. 4. Explain briefly, the various methods of representing discrete time signal 5. Express the discrete time signal x(n) as a summation of impulses. 6. How will you classify the discrete time signals? 7. When a discrete time signal is called periodic? 8. What is the relationship between unit step/unit impulse signals? 9. What are the elements of DSP? 10. What is discrete time system? 11. What is meant by impulse response? 12. What is energy signal? How to calculate energy of a signal? 13. What is power signal? How to calculate power of a signal? 14. Differentiate between even and odd signals. 15. Explain time invariance property of a system with an example. 16. What is memory less system? 17. When a system is said to have memory? 18. What is meant by causality? 19. Explain scaling and superposition properties of a system. 20. What is meant by linearity of a system and how it is related to scaling and superposition? 21. What is impulse function? 22. Why MATLAB is called as matrix laboratory? 23. How to create a figure window in MATLAB? 24. What is the function of subplot command in MATLAB? 25. What the use is of stem and plot command in MATLAB? 26. What is use of clc, clear all & close all command in MATLAB? 27. What is the command used to find the correlation/convolution in MATLAB? 28. What is command for generating the exponentional function in MATLAB? 29. What is use of title, xlabel & ylabel command in MATLAB? 30. What is use of ceil & floor command in MATLAB? 31. State sampling theorem. 32. What is meant by Nyquist rate and Nyquist criteria? 33. Define aliasing. 34. Explain linear convolution and circular convolution 35. Write the properties of linear convolution. 36. What is sectioned convolution? Why is it performed? 37. What are the two methods of sectioned convolution? 38. What are the properties of correlation?
  • 73. 39. What are the advantages of using autocorrelation and cross correlation properties in signal processing fields? 40. How auto-correlation can be used to detect the presence of noise? 41. What is the length of linear and circular convolutions if the two sequences are having the length n1 and n2? 42. What are Fourier series and Fourier transform? 43. What are the advantages and special applications of Fourier transform, Fourier series, Z transform and Laplace transform? 44. Differentiate between DTFT and DFT. Why it is advantageous to use DFT in computers rather than DTFT? 45. What is FFT, What it's importance? 46. What is the drawback in Fourier transform and how is it overcome? 47. What are the various algorithms to calculate FFT? 48. What is phase factor or twiddle factor? 49. What are the phase factors involved in all stages of computation in the 8-point DIT radix- 2 FFT? 50. What is magnitude and phase spectrum? 51. Differentiate between IIR filters and FIR filters. 52. What is the procedure to design a digital Butterworth filter? 53. What is the difference between Butterworth, Chebyshev I and Chebyshev II filters? 54. What are difference equations and differential equations? 55. What is non real time processing? 56. What is meant by real time processing? 57. What is mean by filter? 58. What is mean by pass /stop band? 59. Write the characteristics features of Hanning window 60. Define pre-warping effect? Why it is employed? 61. Give any two properties of Butterworth filter. 62. When a FIR filter is said to be a linear phase FIR filter 63. Write the characteristics features of rectangular window. 64. What is mean by Gibbs phenomenon? 65. Write the expression for Kaiser window function.. 66. What are the advantages and disadvantages of FIR filters? 67. Write the characteristics features of Hamming window 68. Why mapping is needed in the design of digital filters? 69. What are the effects of finite word length in digital filters? 70. List the errors which arise due to quantization process. 71. Discuss the truncation error in quantization process. 72. Write expression for variance of round-off quantization noise. 73. Define limit cycle Oscillations, and list out the types. 74. When zero limit cycle oscillation and Over flow limit cycle oscillation has occur? 75. Why? Scaling is important in Finite word length effect. 76. What are the differences between Fixed and Binary floating point number representation? 77. .What is the error range for Truncation and round-off process 78. What is mean by multi rate? 79. What is mean by decimation?
  • 74. 80. What is mean by interpolation? 81. What is anti aliasing filter? 82. What is anti imaging filter? 83. What is mean by adaptive filter? 84. What is a Digital Signal Processor (DSP)? 85. Differentiate between RISC and CISC architectures. 86. Differentiate between General purpose MPU(Micro Processor Unit) and DSP Processor 87. What is pipelining? 88. What is parallel processing? 89. What is MAC? 90. What is barrel shifter? Why it is advantageous to use it in DSP processor? 91. Differentiate between floating point DSP and fixed point DSP. 92. What is code composer studio? 93. Explain Von-Neumann and Harvard architectures 94. What are Line-in, Line-out, Mic-in, Mic-out? 95. What are the factors that influence the selection of DSPs. 96. What are the advantages and disadvantages of VLIW architecture? What is pipelining? and What are the stages of pipelining? 97. What are the different buses of TMS 320C5x processor and list their functions 98. List the various registers used with ARAU. 99. What are the shift instructions in TMS 320 C5x. 100. List the on-chip peripherals of C5x processor. 101. Give the applications of multirate DSP system. 102. What are the two different algorithm used in adaptive signal processing 103. What are the various areas in which multirate signal processing is used. 104. What are the different applications in adaptive signal processing? 105. List out the various audio effects that can be implemented digitally 106. What are the advantages of Digital signal processing?