You are on page 1of 21

Laboratory Session No.

03

Objective:
An Introduction to Analog to Digital Conversion (Quantization and Coding).
Post Lab Exercises:
Question 1:
What do you mean by the term quantization? Discuss it briefly.
Answer:
The Quantization is the process of converting Continuous Value Discrete Time (DTCV) signal
into a Discrete Value Discrete Time (DTDV) signal. In sampling we define signal at specific
time intervals nTs known as samples in order to process the signal having defined over finite
interval. Similarly the ADC processor has specific bits and these bits can only allow specific
unique bit combinations to represent specific values (levels). A Continuous Value signal contains
infinite values and needs to be approximated over the values allowed by the quantizer and this
process is called quantization.

Question 2:
Execute the quantization code , understand it , plot and comment on the output plot?
Answer:
OUTPUT PLOT

COMMENT
The output plot clarifies the difference between the main sinusoidal signal and the quantized
signal. During quantization the continuous values are approximated to the values which are
allowed known as quantization level and these values are assigned by determining the resolution
of ADC. This plot also shows the data loss when the values are approximated to the nearest
levels.
Question 3:
Discuss the specifications of Arduino Uno ADC like number of bits, number of quantization
levels, etc. Also, calculate the default Arduino Uno ADC resolution.
Link: https://store.arduino.cc/usa/arduino-uno-rev3

Answer:

Arduino is a microcontroller which is used to process signal and extract data from them by
applying signal processing techniques.
The specifications of Arduino are as follows:
• The Arduino has 6 analog inputs meaning that it has 6 channels
• The Arduino UNO ADC has a 10 bit resolution. Therefore the quantization levels
available in arduino is 𝟐𝟏𝟎 = 𝟏𝟎𝟐𝟒
• This means that it will map the input voltages 0-5V between 0 to 1023 integers.
𝟓
Therefore every 1 unit represents 𝟏𝟎𝟐𝟑 = 𝟒. 𝟖𝟖 𝒎𝑽

• The resolution of Arduino UNO is as follows


𝑋𝑚𝑎𝑥 − 𝑋𝑚𝑖𝑛 5−0
𝑅𝑒𝑠𝑜𝑢𝑙𝑡𝑖𝑜𝑛 = = = 4.88𝑚𝑉
𝐿−1 1024 − 1

Question 4:
A 12-bit ADC has input values in the range of 0 – 1 V. Calculate the resolution of ADC.

Answer:
𝑋𝑚𝑎𝑥 − 𝑋𝑚𝑖𝑛 1−0
𝑅𝑒𝑠𝑜𝑢𝑙𝑡𝑖𝑜𝑛 = = 12 = 244.2𝜇𝑉
𝐿−1 2 −1
Question 5:
What do you mean by the term SQNR and ENOB? Discuss it briefly.

Answer

ENOB
Effective number of bits (ENOB) is a measure of the dynamic range of an analog-to-digital
converter (ADC), digital-to-analog converter, or their associated circuitry. The resolution of an
ADC is specified by the number of bits used to represent the analog value. Ideally, a 12-bit ADC
will have an effective number of bits of almost 12. However, real signals have noise, and real
circuits are imperfect and introduce additional noise and distortion. Those imperfections reduce
the number of bits of accuracy in the ADC. The ENOB describes the effective resolution of the
system in bits. An ADC may have 12-bit resolution, but the effective number of bits when used
in a system may be 9.5.

SQNR
Signal-to-noise ratio is a measure used in science and engineering that compares the level of a
desired signal to the level of background noise. SNR is defined as the ratio of signal power to the
noise power, often expressed in decibels.
When a measurement is digitized, the number of bits used to represent the measurement
determines the maximum possible signal-to-noise ratio. This is because the minimum
possible noise level is the error caused by the quantization of the signal, sometimes called noise.
The ratio of signal to quantization noise is called Signal to Quantization Noise Ratio (SQNR).
Laboratory Session No. 04

Objective:
An Introduction to Time shifting, Reversal and scaling.
Post Lab Exercises:
Question 1:
Let x(n)=[1 1 2 3 -1 -1 2 5 6 ]

Using Matlab plot the following signals.

a) x(n-3)
b) x(n+1)
c) x(-n)
d) x(2n)
e) x(n/3)
f) x(-n+1)
g) x(-n-1)

also show every step and mention operations i.e. time shifting, time scaling etc.

Answer:

ORIGINAL FUNCTION

CODE
1. X(n-3)
This operation is time shifting which will shift every instant of original waveform to right
by factor of 3.

CODE
2. X(n+1)
This operation is time shifting which will shift every instant of original waveform to left
by factor of 1.

CODE
3. X(-n)
This operation will basically flip the entire waveform.

CODE
4. x(2n)

This operation will down sample the signal by factor of 2 meaning that it is usually done
to reduce the data rate or the size of the data.

CODE
5. x(n/3)

This operation will down sample the signal by factor of 3 meaning that it is usually done
to increase the data rate or the size of the data.

CODE
6. x(-n+1)
This operation will first shift the signal to left by factor of 1 and then that signal will be
flipped.

CODE
7. x(-n-1)
This operation will first shift the signal to right by factor of 1 and then that signal will be
flipped.

CODE
Question 2:
let x(n)= [-2 2 1 -1 3 2 +2 -3 -1 5 0 1]

using Matlab plot the following signals.

a) x(n+2)
b) x(-n+2)
c) x(2n)
d) x(2n+3)
also show every step and mention operations i.e. time shifting, time scaling etc.
Answer:

ORIGINAL SIGNAL

CODE
1. x(n+2)
This operation is time shifting which will shift every instant of original waveform to left
by factor of 2.

CODE
2. x(-n+2)
This operation will first shift the signal to left by factor of 2 and then that signal will be
folded.

CODE
3. x(2n)
This operation will down sample the signal by factor of 2 meaning that it is usually done
to reduce the data rate or the size of the data.

CODE
4. x(2n+3)
This operation will first shift the signal to left by factor of 3 and then that signal will be
down sampled by a factor of 2.

CODE

You might also like