0% found this document useful (0 votes)
284 views

Lesson 4 Analog To Digital Conversion

x(t) = 3cos(100πt) In (a), Fs=200Hz which is greater F=50Hz than the minimum required 100Hz. Fs=200Hz So there will be no aliasing. x[n] = 3cos(100πn/200) In (b), Fs=75Hz which is less than the minimum required 100Hz. So there will be aliasing. The discrete b) Given: Fs=75Hz, F=50Hz time signal x[n] will not represent Required: x[n] the original analog signal properly due to aliasing. x[n]

Uploaded by

ChantaelNimer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
284 views

Lesson 4 Analog To Digital Conversion

x(t) = 3cos(100πt) In (a), Fs=200Hz which is greater F=50Hz than the minimum required 100Hz. Fs=200Hz So there will be no aliasing. x[n] = 3cos(100πn/200) In (b), Fs=75Hz which is less than the minimum required 100Hz. So there will be aliasing. The discrete b) Given: Fs=75Hz, F=50Hz time signal x[n] will not represent Required: x[n] the original analog signal properly due to aliasing. x[n]

Uploaded by

ChantaelNimer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Analog to Digital

Conversion
Analog to Digital Conversion
• Sampling is the process of converting analog signal from continuous time to
discrete time, obtained by taking samples of the analog signal.
• Quantization is the conversion of a discrete-time continuous-valued signal into a
discrete-time discrete-valued signal.
• Coding is the process wherein each discrete value of the quantized signal is
represented by a b-bit binary sequence.
SAMPLING
Generally, the continuous-time signal is described by
the function
x(t ) = A cos(t +  )
Getting samples of the analog signal will result to x[n],
a discrete time signal, generally represented as

x[n] = A cos(n +  )
Let us assume that ϕ=0. To discretize x(t) or to convert x(t) to x[n]….
𝑥 𝑡 = 𝐴𝑐𝑜𝑠 𝜔𝑡 → 𝑥 𝑛 = 𝐴𝑐𝑜𝑠(𝜃𝑛)
𝑥 𝑡 = 𝐴𝑐𝑜𝑠 2𝜋𝐹𝑡 → 𝑥 𝑛 = 𝐴𝑐𝑜𝑠 2𝜋𝐹𝑇𝑆 𝑛
This means x(t) will be sampled every TS seconds. TS is called the sampling
interval. You know that the reciprocal of time is frequency. So, the reciprocal
of sampling interval is sampling frequency TS=1/FS.
𝐹
𝑥 𝑡 = 𝐴𝑐𝑜𝑠 2𝜋𝐹𝑡 → 𝑥 𝑛 = 𝐴𝑐𝑜𝑠 2𝜋 𝑛
𝐹𝑆
This is now the discretized x(t): 𝑥 𝑛 = 𝐴𝑐𝑜𝑠 2𝜋𝑓𝑛
𝑥 𝑛 = 𝐴𝑐𝑜𝑠 𝜃𝑛
We will be using the capital F for analog frequency, small 𝑓 for normalized
frequency in the discrete-time. From the derivation shown, we will be able to
write another formula for the period, N, of a periodic DT signal. Recall that
2𝜋
𝑁= 𝑘
𝜃
2𝜋 2𝜋 1 1
𝑁= 𝑘 = 𝑘 = 𝑘 = Τ 𝑘
𝜃 2𝜋𝑓 𝑓 𝐹 𝐹𝑆
𝐹
Finally we have, 𝑁 = 𝑆𝑘
𝐹
Question: If the given sinusoid (blue
graph) is sampled at 16Hz, find the

Example1: following:
a) Duration of the signal
b) Frequency of the sinusoid

Solution:
Given 𝐹𝑆 = 16 𝑠𝑎𝑚𝑝𝑙𝑒𝑠/𝑠𝑒𝑐
a)
1
Period between samples=𝑇𝑆 = 16 𝑠𝑒𝑐
𝟏
𝑫𝒖𝒓𝒂𝒕𝒊𝒐𝒏 = 𝟐𝟒𝒙 𝒔𝒆𝒄 = 𝟏. 𝟓𝒔𝒆𝒄
𝟏𝟔

b)
Up to the end of the 16th sample is the 1 second mark.
You will notice that there are 2 cycles in 1 second,
therefore the Frequency of the sinusoid is 2Hz.
Aternative Solution
Looking at any one complete cycle, we can calculate the
period, T, of the sinusoid. Since the sampling period, TS,
is 1/16 sec, then
1
𝑇 = 8 𝑠𝑎𝑚𝑝𝑙𝑒𝑠 𝑥 𝑠𝑒𝑐/𝑠𝑎𝑚𝑝𝑙𝑒
16
1
𝑇 = sec 𝑝𝑒𝑟 𝑜𝑛𝑒 𝑐𝑦𝑐𝑙𝑒
2

𝑭 = 𝟐𝒄𝒚𝒄𝒍𝒆𝒔 𝒑𝒆𝒓 𝒔𝒆𝒄𝒐𝒏𝒅 = 𝟐𝑯𝒛


Determine the following:
a) Sampling rate
Example 2 b) Frequency of the sinusoid

Solution:
a) Since there are 8 samples in 1
second, therefore, the sampling
rate is
𝑭𝑺 = 𝟖𝑯𝒛

b) There is only ½ cycle in 1 second


therefore 𝐅 = 𝟎. 𝟓𝑯𝒛
Alternative Solution:
1𝑠𝑒𝑐
𝑇 = 16𝑠𝑎𝑚𝑝𝑙𝑒𝑠 𝑥
8𝑠𝑎𝑚𝑝𝑙𝑒𝑠
𝑇 = 2𝑠𝑒𝑐
𝟏
𝑭 = 𝟐 𝑯𝒛 = 𝟎. 𝟓𝑯𝒛
Allowable Range of values
ω – Angular frequency in
−FS    FS rad/sec
F – frequency in
FS FS
− F cycles/sec or Hz
2 2 FS – sampling frequency
in samples/sec or Hz
−  f 
1 1
f - normalized frequency
2 2
−    in cycles/sample
θ – digital frequency in
rad/sample
SAMPLING THEOREM
• To avoid aliasing, Sampling Theorem states that the sampling
frequency must be greater than or equal to twice the highest
frequency present in the analog signal.
FS≥ 2Fmax
Take note of Some Terms
• Period is the time of one complete cycle of the analog signal.
• Aliasing is a phenomenon that occurs when the sampling
frequency is lower than the Nyquist Rate.
• Nyquist Rate is twice the maximum frequency component of the
analog signal. Nyquist rate is the minimum sampling frequency
to avoid aliasing. Example, if Fmax=4kHz then the Nyquist rate is
8kHz.
• Nyquist Frequency is half the sampling frequency of a discrete
signal. This is sometimes called the folding frequency of a
sampling system. Example, if Fmax=4kHz and the actual sampling
frequency used is higher than 2Fmax , say, 10kHz. Then the
Nyquist frequency is 5kHz. From this you will conclude that
Nyquist rate is different from Nyquist frequency.
• Sampling Frequency is the same as Sampling Rate
Sampling and quantization of an analog signal

Sampling is the process of converting analog signal from continuous time to discrete time

Quantization is the conversion of a discrete-time continuous-valued signal into a discrete-time discrete-


valued signal.
• The quantization error or quantization noise, eq[n], in the
quantization process is limited to the range
–Δ/2 to Δ/2, or 𝑒𝑞 [𝑛] ≤ ∆/2
Δ is the quantization step or the resolution of the quantization
process. It is computed as
𝑥𝑚𝑎𝑥 −𝑥𝑚𝑖𝑛
∆= Some books do not include
𝐿−1
anymore the minus 1.
xmax and xmin are, respectively, the maximum and
minimum amplitudes of x[n].
eq[n] = xq[n] – x[n]
• In the coding process, the ADC assigns a unique
binary number to each quantized level.
2b ≥ L or b ≥ log L/log2
bFs ≤ Bit Rate
where: b = number of bits
L= number of quantization levels
Fs= sampling frequency
Always remember to use the correct inequality sign.
Examples on ADC
Note : For the examples and all problems for the entire semester, the
time t is assumed to be in seconds if the unit is not specified. It will be
mentioned in the problem if it is in msec, µsec, etc.

If the time is in seconds, the corresponding frequency is in Hz.


If the time is in msec, the corresponding frequency is in kHz.
Example 1:
• Consider the signal
0.9𝑛 𝑛 ≥ 0
𝑥 𝑛 =ቊ
0 𝑛<0
the quantization step used is 0.1. Populate the table below and
graph x[n] and xq[n].
n x[n] Xq[n] eq[n]
n=0 to 10 only
Explanation of the problem:
❖ From the given you will see that ∆= 0.1.
❖ Since the minimum value of x[n] is 0, then the allowable amplitudes of the
quantized signal are 0, 0.1, 0.2, 0.3, … ,1 . Increment of 0.1.
❖ The maximum x[n] is 1, that is when n=0.
Solution on the next slide….
Shown are 10
samples only
• Using the same problem to explain the Coding process.
You will notice that the accepted amplitudes of x[n] for this problem are
increments of 0.1 only. Those are the quantized values. If you will be asked
how many bits are you going to use to represent all those amplitudes, then
you can compute it using the first formula on bits,b (refer to slide# 11)
𝑙𝑜𝑔𝐿 log 11
𝑏≥ 𝑏≥ = 3.45 Using this formula, round up to
𝑙𝑜𝑔2 log 2
the nearest integer.
b=4bits
You cannot use 3 bits because the amplitudes 0.8, 0.9 and 1 will not be
represented. Using 4 bits, each quantization levels will be completely
represented as follows:

Bits xq[n] Bits xq[n]


0000 0 0110 0.6
0001 0.1 0111 0.7
0010 0.2 1000 0.8
0011 0.3 1001 0.9
0100 0.4 1010 1.0
0101 0.5
Example 2:
Consider the analog signal (t is in seconds)
x(t)=3cos(50πt)+10sin(300πt)-cos(100πt)
a)What are the frequencies present in this signal?
b) What must be the sampling frequency to avoid
aliasing?
c) what is the Nyquist rate?
Solution to Example 2:
Given: x(t)=3cos(50πt)+10sin(300πt)-cos(100πt) t is in seconds
I will rewrite x(t) in the form x(t)=Acos(2𝜋Ft) so you can
understand better.
x(t)=3cos(2ℼ25t)+10sin(2ℼ150t)-cos(2ℼ50t)
a) The frequencies present in this signal are:
F1=25Hz F2=150Hz F3=50Hz
b) The sampling frequency to avoid aliasing is a range of values
FS ≥ 2Fmax but Fmax = 150Hz
Therefore, FS ≥ 300Hz
c) The Nyquist rate is the minimum sampling frequency to avoid
aliasing
Nyquist rate= FSmin = 300Hz
Example 3: Consider the analog signal x(t)=3cos(100πt).
a)If the signal is sampled at 200Hz, what is the discrete time signal after sampling?
b)If Fs=75Hz, what is x[n] after sampling? Compare your answer with (a).

Solution: Comparing (a) and (b).


a) Given: Fs=200Hz , F=50Hz For this problem, the minimum
sampling frequency must be 100Hz
Required: x[n] to avoid aliasing.
𝐹
Solution: 𝑥 𝑛 = 𝐴𝑐𝑜𝑠 2𝜋 𝑛 ➢ The signal in (a) will not
𝐹𝑆
50 experience aliasing because
= 3𝑐𝑜𝑠 2𝜋 𝑛 Fs≥100Hz, consequently the
200
normalized frequency, f, and the
Answer: 𝑥 𝑛 = 3𝑐𝑜𝑠 0.5𝜋𝑛 digital frequency,θ, are all within
range.
b) Given: Fs=75Hz , F=50Hz ➢ The signal in (b) will experience
aliasing because the sampling
Required: x[n] theorem is not satisfied.
50
Solution: x n = 3𝑐𝑜𝑠 2𝜋 𝑛
75
Answer: 𝑥 𝑛 = 3𝑐𝑜𝑠 1.33𝜋𝑛
 
Example 4) The discrete time signal x[n] = 6.35 cos n  is quantized with
 10 
a quantization step of 0.02. How many bits are required in the ADC?
Solution
Given:
∆= 0.02 , 𝜃 = 0.1𝜋 , xmax=6.35 , xmin= -6.35
Required: number of bits, b, in the ADC
Solution:
b≥log L/log 2
𝑥𝑚𝑎𝑥 −𝑥𝑚𝑖𝑛
but ∆=
𝐿−1
6.35−(−6.35)
𝐿= + 1 = 636 𝑙𝑒𝑣𝑒𝑙𝑠
0.02
log 636
𝑏≥ = 9.31 For this formula, round up to the nearest integer
log 2
Answer:
b = 10 bits (the number of bits is always integer)
Assignment: (I may be asking some of you to share
screen next meeting to show your solution)
1) An analog signal is sampled at the Nyquist rate of 8MHz
and quantized into 180 levels. Find the time duration (in
seconds) of 1 bit of the binary signal.
2) Consider a continuous time signal x(t)=3sin(100𝜋t).
The signal is sampled at rate of 600 samples per second.
a) Find the DT signal after sampling b) For uniform
quantization step of 0.5, find the number of quantization
levels and number of bits for this signal. c)Populate the
table similar to the one shown below using n from 0 to 12
only. Graph the result.
n x[n] Xq[n] eq[n]
n=0 to 12 only
Continuation of Assignment:
3) Determine the bit rate and quantization step of the ADC in the
sampling of analog signal with x[n] of 1.02 Vpp, sampling rate of
20 samples per second, and 8-bit binary code.
4) An analog television signal containing frequencies up to 4.5MHz
is to be coded by an ADC. The sampling frequency is 20% above
the Nyquist rate. If there are 1024 quantizing levels, determine
the transmission bit rate.
5) An analog signal is to be coded by an ADC. The signal contains
significant frequencies up to 6MHz. The quantization error in
any one sample value must be within ± 0.5% of the peak to peak
amplitude range of the ADC. How many binary digits must each
sample contain?
ALIASING
1) x(t) must be bandlimited to contain
frequencies up to Fmax using a lowpass filter.
2) Fs ≥ 2Fmax
If the sampling theorem is not
satisfied, the reproduction of
the true signal may be similar to
the aliased signal. In other
words, the true signal will not be
faithfully reproduced.
 The sampling frequency must be small enough so that the
signal variations that occur between samples are not lost.
This can be seen on signal 1.
 A rapidly varying signal like signal 1 must be sampled at a
high sampling rate, whereas a slowly varying signal like
signal 2 may be sampled at a lower rate.
 Signal 2, as you can see, is oversampled.

You might also like