Вы находитесь на странице: 1из 31

30 September 2016

LAB NO 11

2011-TE-104

1. Find the help of the following commands


Help win
This command opens a list of default topics for help in a new window.
ii.
Help desk
Provides access to a wide range of help and reference information stored on a
disk or CD-ROM in your local system.
iii.
Help if
The if function can be used alone or with the else and elseif functions. When
using elseif and/or else within an if statement
iv.
Help colon
The colon is one of the most useful operators in MATLAB. It can create vectors,
subscript arrays, and specify for iterations.
v.
Help ?
Provides information about operators and special characters.
vi.
Look for sum
searches for word sum in its directory and shows all its related results.
vii.
Lool for gradient
searches for word gradient in its directory and shows all its related results.
2. Assign 15 sample from 15 to 0 of time vector t.
Command:
t=[15:-1:0]
Output:
t = Columns 1 through 12

15 14 13 12 11 10
9
8
7
6
5
4
Columns 13 through 16

3
2
1
0
3. Assign vector of even samples without assigning it to a variable.
Command:
[0:2:10]
Output:
ans =0
2
4
6
8 10
4. Perform matrix and element wise multiplication of the following.
A=[5 8 6;0 9 4;11 5 3]
B=[6 4 9;7 1 5;2 8 2]
Command:
A=[5 8 6;0 9 4;11 5 3]
A =5
8
6

0
9
4

11
5
3
B=[6 4 9;7 1 5;2 8 2]
B=

6
4
9

7
1
5

2
8
2
i.

Command:
A*B
Output:
ans = 98
1

76

97

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

71 41 53
107 73 130
Command (for element wise):

A.*B
Output:
ans =30 32 54

0
9 20

22 40
6
5. Generate a complex valued matrix A=zeros(1,10) + i*(1,10) And
calculate the absolute square of all elements of the matrix.
Command:
a=zeros(1,10) + i*(1:10)
a=
Columns 1 through 3

0 + 1.0000i
0 + 2.0000i
Columns 4 through 6

0 + 4.0000i
0 + 5.0000i
Columns 7 through 9

0 + 7.0000i
0 + 8.0000i
Column 10

0 +10.0000i
abs (a).^2

0 + 3.0000i
0 + 6.0000i
0 + 9.0000i

Output:
ans =
1
4
9 16 25
6. Function
[y]=cosin wave (t)

36

49

64

81 100

In m flie:

function[y]=cosinewave(t)
f=2;
a=3;
y=a*cos(2*pi*f*t)
plot(t,y,'magenta','linewidth',1.5).
Command:
cosinewave(1:0.1:3)
Output:
y=
Columns 1 through 7
3.0000 0.9271 -2.4271 -2.4271 0.9271 3.0000 0.9271
Columns 8 through 14
-2.4271 -2.4271 0.9271 3.0000 0.9271 -2.4271 -2.4271
Columns 15 through 21
0.9271 3.0000 0.9271 -2.4271 -2.4271 0.9271 3.0000

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016
cos wave

cosine wave

-1

-2

-3

1.2

1.4

1.6

1.8

2
time

2.2

2.4

2.6

2.8

7. Simulink
i.
Y=6u(t) +3u(t)
Block diagram:
6
Step

Gain
3

Scope

Gain1

Output wave form

ii.

Z=cot(t)
Block diagram

Cos Wave
Di vide

Scope

Sine Wave

Out put waveform

DIGITAL SIGNAL PROCESSING

2011-TE-104

LAB NO 11

30 September 2016

iii.

A=tan(t)
Block diagram

Si ne Wave
Di vide

Scope

Cos Wave

Output wave form:

8. Y(t)=0.2x(t)+0.8x(t-2)-0.4x(t-5)
X(t)=3sin(2*pi*f*t)
Simulate the system between t=0 to 10seconds.
Block diagram:
0.2
Si ne Wave

Gai n
0.8
Gai n1

T ransport
Del ay

0.4
Gai n2

T ransport
Del ay1

Out put wave form:


4

DIGITAL SIGNAL PROCESSING

Scope

2011-TE-104

LAB NO 11

30 September 2016

2011-TE-104

9. Y(t)=0.4x(t-1) 0.9x(t) x(t-3) + 2.5x(t-5)


X(t)=u(t)
Simulate the system between t=0 to 15 seconds.
Block diagram:
0.4
Step

Gain
0.9

Transport
Delay

Gai n1
1
Gai n2
2.5
Gain3

Scope
T ransport
Del ay1
T ransport
Del ay2

Output wave form:

1.
a.
b.
c.
d.
e.

Plot the signal x(n)


Fs=0.5kHz
f1=2kHz
f2=3kHz
f3=4.5kHz
Explain the differences & similarities along the various plots

Coding
clc;
clear all;
close all;
n=[0:0.1:10];
5

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

fs=500;
f1=2000;
f2=3000;
f3=4500;
subplot(3,1,1);
x1=sin ((f1/fs)*n);
plot (n,x1,'red','linewidth',3)
hold on;
stem (n,x1,'magenta','linewidth',2)
hold of;
subplot (3,1,2);
x2=sin ((f2/fs)*n);
plot (n,x2,'red','linewidth',3)
hold on;
stem (n,x2,'magenta','linewidth',2)
hold of;
subplot (3,1,3);
x3=sin ((f3/fs)*n);
plot (n,x3,'red','linewidth',3)
hold on;
stem (n,x3,'magenta','linewidth',2)
hold of;
1
0
-1

10

10

10

1
0
-1
1
0
-1

As the frequency increases, providing the same sampling rate, the timezperiod of
the signal decreases allowing more cycles to be covered under a certain time
range.

2. Plot the signal x(n) when


f1=2kHz
Fs=50kHz
What is fd?
Also plot the signal y(n) created by even 100 samples of x(n).
Is this a sinusoidal signal? Why?
Coding
clc;
6

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

clear all;
close all;
f1=2000;
fs=50000;
fd=f1/fs;
n=0:100;
x=sin(fd*n);
subplot(2,1,1)
stem(n,x,'magenta','linewidth',2)
n=1:2:100;
y=sin(fd*n);
subplot(2,1,2)
stem(n,y,'magenta','linewidth',2)
1
0.5
0
-0.5
-1

10

20

30

40

50

60

70

80

90

100

10

20

30

40

50

60

70

80

90

100

1
0.5
0
-0.5
-1

Fd is a ratio of maximum frequency and the sampling frequency


Yes this is a sinusoidal signal, frequency is rational i.e. 0.04 samples/sec.
Sampling period is (1/0.04) = 25 samples.

3. Write a script to convert analog continuous time signal of any


amplitude to a discrete time signal. Take analog frequency as its
input in such a way that the analog frequency is:
a) Half than the twice of max frequency
b) Greater than the twice of max frequency
c) Equal to the twice of max frequency
Coding:
clc;
close all;
clear all;
a=input('Enter your roll number: ');
n=[0:0.1:20];
fmax=input ('Enter max frequency: ');
subplot(3,1,1);
fs1=(2*fmax)/2;
y1=a*sin((fmax/fs1)*n);
stem(n,y1,'magenta','linewidth',1)
title('Sampling Frequency is Half than the twice of max frequency i.e
fs=(2*fmax)/2');
subplot(3,1,2);

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

fs2=2*(2*fmax);
y2=a*sin((fmax/fs2)*n);
stem(n,y2,'magenta','linewidth',1)
title('Sampling Frequency is Greater than the twice of max frequency i.e
fs=2*(2*fmax)');
subplot(3,1,3);
fs3=2*fmax;
y3=a*sin((fmax/fs3)*n);
stem(n,y3,'magenta','linewidth',1)
title('Sampling Frequency is Equal than the twice of max frequency i.e
fs=2*fmax');
Output
Enter your roll number: 104
Enter max frequency: 100
Sampling Frequency is Half than the twice of max frequency i.e fs=(2*fmax)/2
200
0
-200

10

12

14

16

18

20

Sampling Frequency is Greater than the twice of max frequency i.e fs=2*(2*fmax)
200
0
-200
200

10

12

14

16

18

20

Sampling Frequency is Equal than the twice of max frequency i.e fs=2*fmax

0
-200

10

12

14

16

18

20

4. Consider a signal x(t)=3 cos (100 pi t),Determine the min sampling


frequency to avoid aliasing.
Coding:

clc
close all
clear all
display('Minimum Sampling Frequency(fmin) = Twice of Maximum Frequency i.e
fmin=2*fmax')
fmax=100;
fmin=2*100;
t=[0:0.01:0.5];
x=3*cos(100*pi*t);
plot(t,x,'magenta','linewidth',2)
3

-1

-2

-3

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

0.5

1. a) Plot two Continuous Time Signals of 10Hz & 110Hz for 0<t<0.2
sampled at 100 samples/sec.
8

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

2011-TE-104

b) Plot the Discrete samples of each sine wave w.r.t Continuous


Time Signals.
Coding:

clc;
close all;
clear all;
t=[0:0.01:0.2];
x1=cos(2*pi*10*t);
x2=cos(2*pi*110*t);
n=[0:0.01:0.2];
y1=cos((2*pi*(10/100))*n);
y2=cos((2*pi*(110/100))*n);
subplot(3,2,1);
plot(t,x1,'magenta','linewidth',2);
title('f1=10HZ');
subplot(3,2,2);
plot(t,x2,'magenta','linewidth',2);
title('f2=110hz');
subplot(3,2,3);
stem(n,y1,'linewidth',2);
title('f1/fs');
subplot(3,2,4);
stem(n,y2,'linewidth',2);
title('f2/fs');
subplot(3,2,5);
plot(t,x1,'magenta','linewidth',2);
hold on;
stem(n,y1,'linewidth',2);
title('D.T wrt C.T of f1=10HZ');
subplot(3,2,6);
plot(t,x2,'magenta','linewidth',2);
hold on;
stem(n,y2,'linewidth',2);
title('D.T wrt C.T of f2=110HZ');

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

f1=10HZ

-1

0
0

0.05

0.1

0.15

0.2

f1/fs

0.05

0.1

0.15

0.2

0.15

0.2

f2/fs

0.5
0

0.05

0.1

0.15

0.2

D.T wrt C.T of f1=10HZ

0.05

0.1

D.T wrt C.T of f2=110HZ

0
-1

-1
1

0.5
0

f2=110hz

2011-TE-104

0
0

0.05

0.1

0.15

0.2

-1

0.05

0.1

0.15

0.2

1. Generate a D.T signal of 1/50 cycles/samples with the length to be


500 and choose the number of significant digit for round off and
apply the signal generate above plot the quantized signal and
original signal
Coding:

clc
clear all;
close all;
n=0:199;
fd=1/50;
x1=sin(2*pi*fd*n);
q=input('Enter Q Level: ');
xq=(round(x1*q))/q;
xe=xq-x1;
subplot(3,1,1)
plot(n,x1,'magenta','linewidth',2)
title('original signal');
subplot(3,1,2)
plot(n,xq,'magenta','linewidth',2)
title('quantized signal')
subplot(3,1,3)
plot(n,xe,'magenta','linewidth',2)
title('error signal')

10

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

original signal

1
0
-1

20

40

60

80

100

120

140

160

180

200

120

140

160

180

200

120

140

160

180

200

quantized signal

1
0
-1

20

40

60

80

100
error signal

0.5
0
-0.5

20

40

60

80

100

2. Perform task1 using truncation


a) Generation a DT signal of 1/50 cycles/samples with the length of
signal to be 200 and choose the significant digit number for
roundoff and apply to the signal generate above ,plot the quantized
and original signal
b) Plot the error signal
c) Compute SQNR
Coding

clc
clear all;
close all;
n=0:199;
fd=1/50;
x1=sin(2*pi*fd*n);
q=input('Enter Q Level: ');
xq=(round(x1*q))/q;
subplot(2,1,1)
plot(n,xq,'magenta','linewidth',2)
xe=xq-x1;
subplot(2,1,2)
plot(n,xe,'magenta','linewidth',2)
11

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

px=sum(x1.^2)/(length(x1));
pq=sum(xq.^2)/(length(xq));
SQNR=10*log(px/pq)

Output
Enter Q Level: 2
SQNR =
-1.1333
1
0.5
0
-0.5
-1

20

40

60

80

100

120

140

160

180

200

20

40

60

80

100

120

140

160

180

200

0.4
0.2
0
-0.2
-0.4

3. Perform the quantization of signal with multiple number of


level and fine quantization errors and sqnr for signal
Coding

clc
clear all;
close all;
n=0:199;
fd=1/50;
x1=sin(2*pi*fd*n);
q1=input('Enter Level of signal 1: ');
q2=input('Enter Level of signal 2: ');
q3=input('Enter Level of signal 3: ');
xq1=(round(x1*q1))/q1;
xq2=(round(x1*q2))/q2;
xq3=(round(x1*q3))/q3;
xe1=xq1-x1;
xe2=xq2-x1;
xe3=xq3-x1;
12

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

subplot(3,1,1)
plot(n,xe1,'magenta','linewidth',2)
title('Error Signal 1')
subplot(3,1,2)
plot(n,xe2,'magenta','linewidth',2)
title('Error signal 2')
subplot(3,1,3)
plot(n,xe3,'magenta','linewidth',2)
title('Error Signal 3')
px=sum(x1.^2)/(length(x1));
pq1=sum(xq1.^2)/(length(xq1));
pq2=sum(xq2.^2)/(length(xq2));
pq3=sum(xq3.^2)/(length(xq3));
SQNR1=10*log(px/pq1)
SQNR2=10*log(px/pq2)

SQNR3=10*log(px/pq3)
Output
Enter Level of signal 1: 4
Enter Level of signal 2: 14
Enter Level of signal 3: 67
SQNR1 =
-0.1980
SQNR2 =
-0.1700
SQNR3 =
-0.0702

13

DIGITAL SIGNAL PROCESSING

2011-TE-104

30 September 2016

LAB NO 11

2011-TE-104

Error Signal 1

0.2
0
-0.2

20

40

60

80

100

120

140

160

180

200

140

160

180

200

140

160

180

200

Error signal 2

0.05
0
-0.05

20

40

60

80

100

120

Error Signal 3

0.01
0
-0.01

14

20

40

60

80

DIGITAL SIGNAL PROCESSING

100

120

30 September 2016

LAB NO 11

2011-TE-104

1. generate a transfer function and plot its response to check


whether:
the system is stable, unstable or imaginary stable..
Also plot its bode magnitude with linear scales & impulse
response
a. H(z)=z/z+1
b. H(z)=z/z+1.5
c. H(z)=2z^2 + 5z + 12/ z^2 + 2z + 10
Coding

close all;
clear all;
clc;
t=[1:1:100];
num=[1 0];
den=[1 1];
sys=tf(num,den,1);
figure(1)
subplot(3,1,1);
pzmap(sys,'magenta-+');
[mag phase w]=bode(sys);
mag=squeeze(mag);
subplot(3,1,2);
plot(w,mag,'magenta','linewidth',2);
subplot(3,1,3);
impulse(sys,t,'magenta-+');
num1=[1 0];
den1=[1 1.5];
sys1=tf(num1,den1,1);
figure(2)
subplot(3,1,1);
pzmap(sys1,'magenta-+');
[mag phase w]=bode(sys1);
mag=squeeze(mag);
subplot(3,1,2);
plot(w,mag,'magenta','linewidth',2);
subplot(3,1,3);
impulse(sys1,t,'magenta-+');
num2=[2 5 12];
den2=[1 2 10];
15

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

2011-TE-104

Imaginary Ax is

sys2=tf(num2,den2,1);
figure(3)
subplot(3,1,1);
pzmap(sys2,'magenta-+');
[mag phase w]=bode(sys2);
mag=squeeze(mag);
subplot(3,1,2);
plot(w,mag,'magenta','linewidth',2);
subplot(3,1,3);
impulse(sys2,t,'magenta-+');
Figure 1
Pole-Zero Map

1
0
-1
-1

-0.8

-0.6

-0.4

-0.2

0.2

0.4

0.6

0.8

Real Axis

15

x 10

Amplitude

0.5

1.5

2.5

3.5

Impulse Response

1
0
-1

10

20

30

40

50

60

70

80

90

100

Time (sec)

This system (sys) is marginally stable.. because 1 pole lies on the


boundary of unit circle while others are inside the circle

Figure 2

16

DIGITAL SIGNAL PROCESSING

LAB NO 11

Im a g in a r y A x is

30 September 2016

2011-TE-104

Pole-Zero Map

1
0
-1
-1.5

-1

-0.5

0.5

Real Axis

2
1
0

0.5

1.5

A m p litu d e

17

2.5

3.5

Impulse Response

x 10

0
-5

10

20

30

40

50

60

70

80

90

100

Time (sec)

This system (sys1) is unstable, because a pole lies outside the


boundary of unit circle

Imaginary Axis

Figure 3:
Pole-Zero Map

5
0
-5
-1.5

-1

-0.5

0.5

Real Axis

1.5
1
0.5

0.5

1.5

50

Amplitude

2.5

3.5

Impulse Response

x 10

0
-1

10

20

30

40

50

60

70

80

90

100

Time (sec)

This system(sys2) is unstable.because the poles lies outside the


unit circle.

17

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

2. Refer to q1 & show that system is Margi nary stable. Also plot
bode magnitude & impulse response
Coding
clc;
close all;
clear all;
num=poly([j -j]);
den=poly([exp(0) exp(-0.2)]);
sys=tf(num,den,1);
subplot(3,1,1)
pzmap(sys, 'magenta')
xlim([-2 2])
ylim([-4 4])
[mag phase w]=bode(sys)
mag=squeeze(mag)
subplot(3,1,2)
plot(w,mag,'magenta','linewidth',2)
xlim([0 pi])
subplot(3,1,3)
impulse(sys,'magenta')
Pole-Zero Map

Imaginary Axis

0
-1
-1

-0.8

-0.6

-0.4

-0.2

0.2

0.4

0.6

0.8

Real Axis

1500
1000
500
0

0.5

2.5

Impulse Response

20
Amplitude

1.5

10
0

10

15

20

25

30

35

Time (sec)

This system is marginally stable,because one pole lieas on the


boundary of unit circle while others are inside the circle.
18

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

2011-TE-104

2.Use fft command to compute DFT function for the given data
sequence in Task#1.Also plot the phase and magnitude graphs of
DFT functions
Coding

clc;
close all;
clear all;
x=[1 2 1 0];
n=[0:1:3];
y=ft(x)
mag=abs(y)
subplot(3,1,1)
stem(n,mag,'magenta','linewidth',2);
title('magnitude graph');
Xlabel('n')
Ylabel('magnitude')
b=imag(y);
subplot(3,1,2)
stem(n,b,'magenta','linewidth',2);
title('imaginary');
Xlabel('n')
Ylabel('imaginary axix')
19

DIGITAL SIGNAL PROCESSING

30 September 2016

2011-TE-104

c=angle(y);
subplot(3,1,3)
stem(n,c,'magenta','linewidth',2);
title('phase graph')
Xlabel('n')
i m a g i n a r y amx ai xg n i t u d e

Ylabel('phase')

phase

LAB NO 11

magnitude graph

4
2
0

0.5

1.5
n
imaginary

2.5

0.5

1.5
n
phase graph

2.5

0.5

1.5
n

2.5

2
0
-2

2
0
-2

y =Columns 1 through 3
4.0000
0 - 2.0000i
Column 4
0 + 2.0000i
mag =
4
2
0
2

3. Compute the IDFT of the audio signal. Generate the frequency


vector in (Hz).
Display the IDFT and observe the frequency of the added tone.
Coding:

clc;
close all;
clear all;
[y,fs,bits]= wavread('dsp1.wav');
ts=1/fs;
n=[0:length(y)-1];
t=n*ts;
k=n;
df=fs/length(y);
f=df*k;
a=ft(y);
magy=abs(y);
sound(y,fs);
subplot(2,1,1)
plot(f,magy,'magenta','linewidth',2);
20

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

grid on;
xlim([0 fs/2]);
subplot(2,1,2);
plot(f,magy,'magenta','linewidth',2);
grid on;
xlim([0 1000]);
1

0.5

0.5

1.5

2
4

x 10
0.2
0.15
0.1
0.05
0

100

200

300

400

500

600

700

800

1. Generate horizontal lines of image 200 x 200.


Coding
clc;
close all;
clear all;
for row=1:200;

for col=1:200;

a(row,col)=1;

end
end
for row=1:20:200;

for col=1:200;

a(row,col)=0;

end
end
21

DIGITAL SIGNAL PROCESSING

900

1000

30 September 2016

LAB NO 11

imshow(a)

2. For task 1 show negative and flipped version.


Coding:

for row=1:200;
for col=1:200;
a(row,col)=1;
end
end
for row=1:20:200;
for col=1:200;
a(row,col)=0;
end
end
figure(1);
imshow(a);
title('Original Image');
J=flipud(a);
figure(2)
imshow(J)
title('Flipped Image');
I=imread('Task1.tif');
K=255-I;
figure(3)
imshow(K)
title('Negative Image');

22

DIGITAL SIGNAL PROCESSING

2011-TE-104

LAB NO 11

30 September 2016

Original Image

2011-TE-104

Flipped Image

3. Take any image and add speckle , poisson and then pass
through average and midian filter.
Coding

23

clc;
close all;
clear all;
I=imread('pout.tif');
figure(1);
imshow(I);
title('Original Image');
k=imnoise(I,'speckle',0.10);
l=imnoise(k,'poisson');
figure(2);
imshow(l);
title('Poisson & Speckle added');
a=filter2(fspecial('average',3),l)/255;
b=medfilt2(a,[3 3]);
figure(3);
imshow(b);
title('Average & median filter')

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

Original Image

2011-TE-104

Poisson & Speckle added

Average & median filter

4. Import any image and display it. Also convert image format
into
a. Grayscale image
b. Indexed image
c. Binary image
d. Use subplot command to display results.
Coding:

clc;
close all;
clear all
I=imread('Tulips','JPEG');
subplot(2,2,1)
imshow(I);
title('Original Image');
J=rgb2gray(I);
subplot(2,2,2)
24

DIGITAL SIGNAL PROCESSING

LAB NO 11

30 September 2016

2011-TE-104

imshow(J)
title('Grayscale Image');
[IND,map]=rgb2ind(I,32);
subplot(2,2,3)
imagesc(IND);
title('Indexed Image');
K=im2bw(I);
subplot(2,2,4)
imshow(K);
title('binary Image');
Original Image

Grayscale Image

Indexed Image

binary Image

200
400
600
200

25

400

600

800 1000

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

2011-TE-104

1. Write a program such that LED#1 glows 3 times , LED#2 glows


2 times and LED#3 glows only once. After this reverse this
sequence such that LED#1 glows only 1 time,LED#2 glows 2
times and LED#3 glows 3 times.
Coding

#include <stdio.h>
#define LED_OFF 0*07000000
#define msec 500
void main(void)
{
short toggle=0;
int LED[]={0*06000000 , 0*05000000 , 0*03000000}
printf("The LED Dancing Program");
LED_control(LED_OFF);
while(toggle==0)
{
for(int a=0;a<3;a++)
{
LED_control(LED[0]);
delay_msec(msec);
}
for(a=0;a<2;a++)
{
LED_control(LED[1]);
delay_msec(msec);
}
LED_control(LED[2]);
delay_msec(msec);
toggle=1;
}
while(toggle==1)
{
LED_control(LED[0]);
delay_msec(msec);
for(int a=0;a<2;a++)
{
LED_control(LED[1]);
delay_msec(msec);
}
for(a=0;a<3;a++)
{
LED_control(LED[2]);
delay_msec(msec);
}
toggle=0;

26

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

2011-TE-104

2. Write down the features of DSK C6416.


TMS320C6416 (1 Ghz) DSP Starter Kit (DSK)
Hardware Features
Texas Instruments TMS3206416 DSP operating at 1 Ghz.
Embedded USB JTAG controller with plug and play, USB cable included
TLV320AIC23 codec
2M x 64 on board SDRAM
512K bytes of on board Flash ROM
3 expansion connectors (Memory Interface, Peripheral Interface, and Host
Port Interface)
On board IEEE 1149.1 JTAG connection for optional emulator debug
Four 3.5 mm. audio jacks (microphone, line-in, speaker, line-out)
4 user definable LEDs
4 position dip switch, user definable
+5 Volt operation only, power supply included
Size: 8.25" x 4.5" (210 x 115 mm), 0.062" thick, 6 layers
Compatible with Spectrum Digital's DSK Wire Wrap Prototype Card
RoHS Compliant
Software Features
TMS320C6416 specific Code Composer Studio from Texas Instruments
Test/sample code provided to reduce coding time
Compatible with JTAG emulators from Spectrum Digital
Compatible with Win 98 SE/2000/XP
What's Included
TMS320C6416 (1 Ghz) DSK Board
Code Composer Studio for C6416 DSK
USB Cable
AC Power Cord(s) and Power Supply
Quick Start Guide
Technical Reference (includes schematics)
Customer Support Guide

27

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

2011-TE-104

1. Write what you learnt in lab


BUILDING & AUDIO EFFECT PROCESSOR
We use this efect to produce delay and attenuation and consequently echo is
produced due to delay in voice. WE create and build a model that simulates
audio reverberation applied to an input signal. Reverberation is similar to the
echo efect you can hear when you shout across an open valley or in a large
empty room.
The C6711 DSK ADC and C6711 DSK DAC blocks let you configure the codec on
the C6711 DSK to accept input signals from the input connectors on the board,
and send the model output to the output connector on the board. Essentially, the
C6711 DSK ADC and C6711 DSK DAC blocks add driver software that controls the
behavior of the codec for your model.

TI TMS320C6711
DIFFERENCE EQUATION:
Y[n] = x[n] + ax [n-D]
Where,
28

DIGITAL SIGNAL PROCESSING

30 September 2016

LAB NO 11

2011-TE-104

a = Gain,
D =Delay.
It follows the following block diagram

Edit
Edit

Compile

.out (permanent file)

Assemb
le

Link

STEPS:=

i.

From the Simulation menu, choose Simulation Parameters. The


Simulation Parameters dialog opens.

ii.

Click the optmitization and unblock the block reduction.

iii.

Then click on sample time , single task rate transition and press none.

iv.

Real time workshop , chose Ti-c6000.tlc file open browse and click tic6000.tlc

v.

Then open debug and click on verbose build.

vi.

Click on c6000 target selection, system target file and chose C6711 DSK.

vii.

Open IT compiler c6000 , click on symbolic debug.


29

DIGITAL SIGNAL PROCESSING

30 September 2016
viii.

LAB NO 11

2011-TE-104

Then save it.

ix.

Again open configure parameter , real time , click on build and press ok.

x.
QUICK TEST OF DSK

Launch CCS from the icon on the desktop. Press GEL Check DSK Quick Test.
The Quick Test can be used for confirmation of correct operation and installation.
The following message is then displayed:
Switches: 7
Revision: 2
Target is OK
This assumes that the first three switches, USER_SW1, USER_SW2, and
USER_SW3, are all in the
up (ON) position. This assumes that the first three switches, USER_SW1,
USER_SW2, and USER_SW3,are all in the up (ON) position. Change the switches
to (1 1 0 x)2 so that
the first two switches are up (press the third switch down). The fourth switch is
not
used. Repeat the procedure to select GEL Check DSK Quick Test and verify
that the value of the switches is now 3 (with the display Switches: 3).You can
set the value of the
first three user switches from 0 to 7.Within your program you can then direct the
execution of your
code based on these eight values. Note that the Quick
Test cycles the LEDs three times

Conclusion
If you have followed the above steps correctly it will show you the message that
Build procedure complete and if you have missed any configuration step it will
generate code. As a result you will listen an echo until the time out.

30

DIGITAL SIGNAL PROCESSING

30 September 2016

31

LAB NO 11

DIGITAL SIGNAL PROCESSING

2011-TE-104

Вам также может понравиться