Sunteți pe pagina 1din 8

ACTIVITY No.

Analog To Digital Conversion

I. Objective:

To be able to simulate the processes of sampling, quantization, and encoding


using SciLab.

II. Procedure and Requirements:

1. Write a program to generate and plot the following signals at a time interval t, of 1µs.
a. x(t)=10sin200πt
b. x(t)=15sin400πt+10cos750πt
c. x(t)=20cos800πtsin450πt
2. Write a program to generate and plot the output of a sample and hold circuit that
samples the signals in No. 1 at Fs=3000Hz.
3. Write a program to generate and plot the output of a quantizer that quantizes the
samples in No. 2 at a resolution of 30mV.
4. Write a program to encode each quantized sample in No. 3 into a 12-bit binary code.
5. Tabulate the magnitudes for items 2-to-4 for 1 cycle of each signal in the format
given:

n Sn Qn En
1
2



30

6. Formats your plots for items 1-to-4 as:

ANALOG INPUT S/H INPUT QUANTIZER OUTPUT


III. Results:

A. PROGRAMS AND THEIR CORRESPONDING WAVEFORMS

1. a. x(t) = 10sin200πt

t=0:0.0000010:1/100;
xt=10*(sin*%pi*t);
plot2d2(t,xt)
xgrid
10

-2

-4

-6

-8

-10
0.000 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010

b. x(t) = 15sin400πt + 10cos750πt

t=0:0.0000010:1/100;
xt=(15*sin(400*%pi*t))+(10*cos(750*%pi*t));
plot2d2(t,xt)
xgrid
20

15

10

-5

-10

-15

-20

-25
0.000 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010
c. x(t) = 20cos800πtsin450πt

t=0:0.0000010:1/100;
xt=(20*cos(800*%pi*t)).*(1*sin(450*%pi*t));
plot2d2(t,xt)
xgrid

20

15

10

-5

-10

-15

-20
0.000 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010

2. a. x(t) = 10sin200πt

t=0:1/3000:1/100;
xn=10*sin(200*%pi*t);
n=t*3000;
plot2d2(n,xn)
xgrid
10

-2

-4

-6

-8

-10
0 5 10 15 20 25 30
b. x(t) = 15sin400πt + 10cos750πt

t=0:1/3000:1/100;
xn=(15*sin(400*%pi*t))+(10*cos(750*%pi*t));
n=t*3000;
plot2d2(n,xn)
xgrid

20

15

10

-5

-10

-15

-20

-25
0 5 10 15 20 25 30

c. x(t) = 20cos800πtsin450πt

t=0:1/3000:1/100;
xn=(20*cos(800*%pi*t)).*(1*sin(450*%pi*t));
n=t*3000;
plot2d2(n,xn)
xgrid

20

15

10

-5

-10

-15

-20
0 5 10 15 20 25 30
3. a. x(t) = 10sin200πt

t=0:1/3000:1/100;
xn=10*sin(200*%pi*t);
n=t*3000;
qn=round(xn/0.03);
plot2d2(n,qn)
xgrid
400

300

200

100

-100

-200

-300

-400
0 5 10 15 20 25 30

b. x(t) = 15sin400πt + 10cos750πt

t=0:1/3000:1/100;
xn=(15*sin(400*%pi*t))+(10*cos(750*%pi*t));
n=t*3000;
qn=round(xn/0.03);
plot2d2(n,qn)
xgrid
800

600

400

200

-200

-400

-600

-800

-1000
0 5 10 15 20 25 30
c. x(t) = 20cos800πtsin450πt

t=0:1/3000:1/100;
xn=(20*cos(800*%pi*t)).*(1*sin(450*%pi*t));
n=t*3000;
qn=round(xn/0.03);
plot2d2(n,qn)
xgrid
800

600

400

200

-200

-400

-600

-800
0 5 10 15 20 25 30

B. TABLES

ANALOG INPUT S/H INPUT QUANTIZER OUTPUT


10 10
400
8 8

300
6
6

4 200
4

2
2 100

0
0
0
-2
-2
-100
-4
-4

-6 -200
-6

-8
-300
-8
-10
0.000 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010 -10 -400
0 5 10 15 20 25 30 0 5 10 15 20 25 30

20

15
20
800
10
15
600
5
10
400
0
5
200
-5
0
0
-10
-5
-200
-15
-10

-400
-20
-15

-600
-25
0.000 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010 -20

-800
-25
0 5 10 15 20 25 30
-1000
0 5 10 15 20 25 30

20

20 800
15

15 600
10

10 400
5

5 200
0

0 0
-5

-5 -200
-10

-10 -400
-15

-600
-15
-20
0 5 10 15 20 25 30
-800
-20
0 5 10 15 20 25 30
0.000 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.010
n Sn Qn En
1 0. 0 000000000000
2 2.0791169 69 000001000101
3 4.0673664 136 000010001000
4 5.8778525 196 000011000100
5 7.4314483 248 000011111000
6 8.660254 289 000100100001
7 9.5105652 317 000100111101
8 9.945219 332 000101001100
9 9.945219 332 000101001100
10 9.5105652 317 000100111101
11 8.660254 289 000100100001
12 7.4314483 248 000011111000
13 5.8778525 196 000011000100
14 4.0673664 136 000010001000
15 2.0791169 69 000001000101
16 1.225D-15 0 000000000000
17 - 2.0791169 - 69 111110111011
18 - 4.0673664 - 136 111101111000
19 - 5.8778525 - 196 111100111100
20 - 7.4314483 - 248 111100001000
21 - 8.660254 -289 111011011111
22 - 9.5105652 - 317 111011000011
23 - 9.945219 - 332 111010110100
24 - 9.945219 - 332 111010110100
25 - 9.5105652 - 317 111011000011
26 - 8.660254 - 289 111011011111
27 - 7.4314483 - 248 111100001000
28 - 5.8778525 - 196 111100111100
29 - 4.0673664 - 136 111101111000
30 - 2.0791169 - 69 111110111011

IV. OBSERVATION:

As a preliminary action, the group familiarized each code in the SciLab software which are
necessary to use for the provided activity, as well as their functions to further understand how this
particular software works. Next, the group is tasked to generate program and plot the corresponding
waveform for the three signal equations, x(t) = 10sin200πt, x(t) = 15sin400πt + 10cos750πt, and x(t) =
20cos800πtsin450πt respectively. The first requirement that the group is able to accomplish is to
generate a program and plot the output waveform for signals with time interval Δt of 10μsec. Each
equations have different output waveforms, but at the same Δt. Then, the group again generated
programs and plotted their respective output waveforms, however, this time the sampling frequency Fs is
set to 3000Hz. The output waveforms are sampled and “ladder-like” figures are formed following the
original pattern of the waveforms. The group then generated a program that quantized each samples to a
30mV rounding-off resolution with 12-bit folded binary. Notice that the original sampled waveforms have
smaller step values while the output of the rounded-off sampled waveforms have larger values regardless
of the scale of each waveforms. Afterwards, the results from previous procedures were tabulated with
respect to the sample number, quantization number, and encoded values or binary values.
V. CONCLUSION:

The group is able to simulate the processes of sampling, quantization, and encoding using
SciLab software. Analog-to-digital (ADC) conversion plays a vital role in digital signal processing (DSP).
From the previous activity, the group is able to understand well the function of an ADC in DSP system.
Analog signal processing is concerned with the processing of continuous time function. Analog or
continuously varying electrical waveforms are applied to the device and are sampled at a fixed rate. On
the other hand, digital signal processing is concerned with the processing of sequences of sample or data
in discrete manner. Sample values are then expressed as digital numbers, using binary number system
consisting of 1’s and 0’s. The resulting digital codes can be used in various type of communication
systems.

S-ar putea să vă placă și