EE115IU_Lab4
EE115IU_Lab4
EE115IU
PRINCIPLES OF COMMUNICATIONS SYSTEMS
LABORATORY
Lab 4
SAMPLING AND RECONSTRUCTION
OF ANALOG SIGNALS
Class: …………………………………….
Date: ……………………………………...
Page 1 of 5
INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING (EE)
I. Objectives
The objective of this lab is to explore the concepts of sampling and reconstruction of analog
signals. Specifically, we will simulate the sampling process of an analog signal using
MATLAB, investigate the effect of sampling in the time and frequency domains, and
introduce the concept of aliasing.
II. Required Equipment
1. Computer
2. MATLAB software
III. Discussion of Fundamentals
An analog-to-digital converter (ADC) converts an analog signal to a digital form. An ADC
produces a stream of binary numbers from analog signals by taking the samples of the analog
signal and digitizing the amplitude at these discrete times. Prior to the ADC conversion, an
analog filter called the prefilter or antialiasing filter is applied to the analog signal in order to
deal with an effect known as aliasing. Aliasing causes multiple continuous time signals to
yield the exact same sampled discrete time signal.
In this lab, we focus our attention in the process of sampling and how to avoid the problem of
Ts
aliasing. During sampling, an analog signal is periodically measured every seconds:
(1)
where T s is called the sampling period or the fixed time interval between samples (here we
assume a uniform sampling rate that does not change with time.) The inverse of T s is called
the sampling frequency, that is, the samples per second:
(2)
When sampling an analog signal, we must sample fast enough (i.e., be sure f s is sufficiently
high), so that the samples are a good representation of the original analog signal. If the
sampling frequency f s is not fast enough then too much information is lost, and it becomes
impossible to reconstruct our original analog signal using a digital-to-analog converter
(DAC). However, if you do sample fast enough, then, theoretically, it is possible to exactly
reconstruct the original signal.
Sampling theorem
For accurate representation of signal by its time samples , two conditions must
be met:
Page 2 of 5
INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING (EE)
1) The signal must be bandlimited, that is, its frequency content (spectrum)
2) The sampling rate must be chosen to be at least twice the maximum frequency
, that is
(3)
According to the sampling theorem, before sampling we must make sure the signal is
bandlimited (this is the function of the analog prefilter) and that the sampling frequency is at
least twice the maximum frequency.
The traditional Nyquist sampling theorem presented above is true for real-valued (i.e. not
complex), lowpass (i.e. baseband) signals. For complex lowpass signals, the sampling
theorem states that the ultimate minimum sampling rate to avoid aliasing is actually ,
where B is the double-sided bandwidth. For bandpass signals, things get even more
interesting. You can subsample (i.e. sample below the Nyquist rate) to achieve frequency
translation to lower frequencies and recover the original signal.
Reconstruction formula
When an analog signal is sampled by using sampling theorem, then it is possible to
reconstruct the original signal from the sample values by the reconstruction
formula
(4)
where satisfies the condition and B is the bandwith of the analog signal.
IV. Problems
Problem 1
Consider a continuous time domain signal:
a. Suppose we sample x a (t) with a sampling frequency f s=10 f max. Please program
MATLAB to create a 3-by-1 plot where
- You plot the original continuous time signal x a (t)
- The sampled discrete time signal x [n T s]
Page 3 of 5
INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING (EE)
- And the sampled discrete time signal x [ nT s ] superimposed over the reconstructed
signal x a (t)
Note: Please give explanation for your code
Problem 2
Given the signal x (t )=2−cos ( 500 πt ) −sin (1000 πt). Sample the signal with two sample
frequencies f s =1200 samples/sec and f s =120 samples /sec . Which sampled signal is under
1 1
V. Review Questions
1. What are the main stages involved in the process of analog-to-digital conversion? Briefly
describe each stage.
The process of analog-to-digital conversion (ADC) involves converting continuous
analog signals into discrete digital values. The main stages are:
Sampling
o The continuous analog signal is measured at regular time intervals (sampling
rate).
o The Nyquist Theorem states the sampling rate must be at least twice the
highest frequency of the analog signal to avoid aliasing (loss of information).
Quantization
o The amplitude of each sampled signal is mapped to the nearest value within a
finite set of levels.
Page 4 of 5
INTERNATIONAL UNIVERSITY
SCHOOL OF ELECTRICAL ENGINEERING (EE)
2. What is quantization in the context of ADC, and how does the number of bits used in the
ADC affect the quality of the digital representation?
Quantization in the context of ADC is the process of mapping the continuous range of an
analog signal's amplitude into a finite set of discrete levels. Each sampled value is
assigned to the nearest quantization level, resulting in an approximation of the original
signal.
Impact of the Number of Bits on Quality:
The number of bits used in the ADC determines the number of quantization levels
available:
Higher Number of Bits (More Levels):
o Increases the resolution of the ADC, allowing for finer distinctions between
amplitude levels.
o Reduces quantization error, leading to a digital representation that is closer
to the original analog signal.
o Improves the signal-to-noise ratio (SNR) and overall quality of the digital
signal.
Lower Number of Bits (Fewer Levels):
o Decreases the resolution, resulting in larger quantization steps.
o Increases quantization error and introduces more distortion in the signal.
o May cause significant loss of detail, especially in signals with small amplitude
variations.
Page 5 of 5