You are on page 1of 14

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

Sampling:

To use a computer in a control application it is necessary to transform analog


signals into digital signals so that they can be inputted into the computer, while it is
also necessary that the output of the computer be converted into an analog signal to
drive an actuator (e.g., an electrical motor) to provide an action capable of
changing the state of the plant. This can be done by means of ADCs and DACs.
The sensor should also be able to act as a transducer whenever the output of the
plant is of a different type than the reference. Such would be the case, for instance,
if the plant output is a temperature while the reference signal is a voltage

FIGURE Computer-controlled system for an analog plant (e.g., cruise control for a
car). The reference signal is r(t) (e.g., desired speed) and the output is y(t) (e.g., car
speed). The analog signals are converted to digital signals by an ADC, while the
digital signal from the computer is converted into an analog signal (an actuator is
probably needed to control the car) by a DAC. The signals w(t) and v(t) are
disturbances or noise in the plant and the sensor (e.g., electronic noise in the sensor
and undesirable vibration in the car).

The difference between continues and discrete signals is that we can represent the
discrete signal by samples given at the output from A/D and the resolution is given

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 1


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

by the number of samples as we increases the number of samples each signal


period we get the signal near similar to analog.

We think about the periodic sample, here the periodic sample discrete obtained
from continues

𝑥[𝑛] = 𝑥𝑐 [𝑛𝑇]𝑥 n is an integer. And T is the sampling time.


2𝜋
𝜔𝑠 = Sampling frequency measured in radians.
𝑇

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 2


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

May not have ideal, instead after reconstruction we may have noise i.e. instead of
getting this value we may have another value

𝑥[𝑛] = 𝑦[𝑛𝑇] + 𝑍[𝑛] where 𝑍[𝑛] is the noise cr.eated from sampling and
quantization.

Analog
Signal
A/D output

Zero order hold type

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 3


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

First order hold type

This process can be viewed as taking one sample and convolving it with another
function.

Let us take zero order hold

1T 7T
∗ T

Function (3) Function (1) Function (2)

Zero order holds process reconstructed by convolving each pulse function (2) with
function (3)

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 4


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

‫ﻋﻣﻠﯾﺔ ﺿرب اﺷﺎرة اﻟﺑﻠص ﻣﻊ اﺷﺎرة اﻟﯾوﻧت ﺳﺗﯾب‬

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 5


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 6


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

Bad case because we zero output from samling.

Bad case because we have DC output from sampling

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 7


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

…. 1 ‫ و ﻣرة ﯾﺳﺎوي‬0.1 ‫ ﯾﺳﺎوي‬sampling period ‫ ﻣﻧﻣذﺟﺔ ﻣرة ب‬cos ‫اﺷﺎرة‬


‫ﻧﻼﺣظ ﺑﺎﻟﺣﺎﻟﺔ اﻻوﻟﻰ اﻛو ﺗﻘﺎرب ﺑﯾن اﻟﻣوﺟﺔ اﻟﻣﺳﺗﻣرة و اﻟﻣوﺟﺔ اﻟﻣﺗﻘطﻌﺔ ﺑﯾﻧﻣﺎ ﺑﺎﻟﺣﺎﻟﺔ اﻟﺛﺎﻧﯾﺔ‬
‫اﻛو اﺧﺗﻼف ﻛﺑﯾر ﺑﯾﻧﮭم‬

Sampling an analog sinusoid x(t) = 2 cos(2πt), 0 ≤ t ≤ 10, with two different


sampling periods, (a) Ts1 = 0.1 sec and (b) Ts2 = 1 sec, giving x1(0.1n) and x2(n).
The sinusoid is shown by dashed lines. Notice the similarity between the discrete-
time signal and the analog signal when Ts1 = 0.1 sec, while they are very different
when Ts2 = 1 sec, indicating loss of information.

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 8


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

Bad case undersampling the output can not be reconstructed and uncorrectr output
from sampler.

Good case

Asignal is band limitted , if there is some frequency 𝜔𝐵 such that

𝑋𝑐 (𝜔) = 0 for |𝜔| > 𝜔𝐵 WB ‫اي ﻻ ﯾوﺟد اﺷﺎرة ﻓﻲ ﺗردد اﻛﺑر ﻣن ﺗردد‬

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 9


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

|𝑋𝑐 (𝜔)|

𝜔
𝜔𝐵
- 𝜔𝐵

Here we have a real signal, therefor it should be symetrical .

‫ إذا وﻓﻘط إذاﻛﺎﻧت‬WB ‫ﯾﻣﻛن إﻋﺎدة ﺗﺷﻛﯾل إﺷﺎرة ﻣﺣدودة اﻟﻧطﺎق ﻣﻊ ﺗردد‬
WS>2WB

Sampling Theorm:

A band limitted signal with frequency 𝜔𝐵 can be reconstructed if and only if

𝜔𝑠 > 2𝜔𝐵 , where 2𝜔𝐵 is called Nyquist rate.

We have to sample more than nyquist rate because it is some times good and some
times not good.

The key idea, if we have a continous time signal

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 10


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

we have copies of the spectrum that occirs at multiple of 𝜔𝑠 , it means that if we


have this sampled signal with this multiple copies of spectrum, we can get the
original signal by using lowpass filter with region of spectrum from −𝜔𝐵 𝑡𝑜 +𝜔𝐵

we to work such that ( 𝜔𝐵 ) will not overlap with (𝜔𝑠 − 𝜔𝐵 )

Note good case when 𝜔𝑠 − 𝜔𝐵 > 𝜔𝐵

i.e. 𝜔𝑠 > 2𝜔𝐵 will not overlap in this case.

i.e. we sample at low frequency , the result appear at high frequency and high
frequency appear at low frequency and so on. We can not isolate them.

Xs(nT)=x(t) P(t)

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 11


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

where p(t) is the pulse train with a period T =1/fs. From spectral analysis, the
original spectrum (frequency components) X( f) and the sampled signal spectrum
Xs(f) in terms of Hz are related as


1
𝑋𝑠 (𝑓) = ∑ 𝑋(𝑓 − 𝑛𝑓𝑠 )
𝑇
𝑛=−∞

Therefore we have
1 1 1
𝑋𝑠 (𝑓) = ⋯ . . + 𝑋(𝑓 + 𝑓𝑠 ) + 𝑋(𝑓) + 𝑋(𝑓 − 𝑓𝑠 )
𝑇 𝑇 𝑇

EX:

Suppose that an analog signal is given as

𝒙(𝒕) = 𝟓𝐜𝐨𝐬(𝟐𝝅 ∗ 𝟏𝟎𝟎𝟎𝒕) for 𝒕 ≥ 0 where (𝟐𝝅 ∗ 𝟏𝟎𝟎𝟎𝒕 = 𝜔𝐵 )

and sampled at the rate of 8,000 Hz.

a. Sketch the spectrum for the original signal.

b. Sketch the spectrum for the sampled signal from 0 to 20 kHz.

Solution:

a. Since the analog signal is sinusoid with a peak value of 5 and frequency of
1,000 Hz, we can write the sine wave using Euler’s identity:
𝑒 𝑗2𝜋𝑥1000𝑡 + 𝑒 −𝑗2𝜋𝑥1000𝑡
5 cos(2𝜋 ∗ 1000𝑡) = 5 ( )
2
= 2.5𝑒 𝑗2𝜋𝑥1000𝑡 + 2.5𝑒 −𝑗2𝜋𝑥1000𝑡
Fourier series expansioinof periodic signal

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 12


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

Spectrum of the analog signal

b. After the analog signal is sampled at the rate of 8,000 Hz, the sampled signal
spectrum and its replicas centered at the frequencies ±𝑛𝜔𝑠 , each with the
scaled amplitude being 2.5/T, are as shown in Figure below.

Example:
Assuming that an analog signal is given by
𝑥(𝑡) = 5 cos(2𝜋. 2000𝑡) + 3cos(2𝜋. 3000) for 𝑡 ≥ 0
and it is sampled at the rate of 8,000 Hz.
a- Sketch the spectrum of the sampled signal up to 20 kHz.
b- Sketch the recovered analog signal spectrum if an ideal lowpass filter
with a cutoff frequency of 4 kHz is used to filter the sampled signal (yn =
x(n) in this case) to recover the original signal.

Solution: Using Euler’s identity, we get

3 5 5 3
𝑥(𝑡) = 𝑒 −𝑗2𝜋.3000𝑡 + 𝑒 −𝑗2𝜋.2000𝑡 + 𝑒 −𝑗2𝜋.2000𝑡 + 𝑒 −𝑗2𝜋.3000𝑡
2 2 2 2

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 13


Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬

Based on the spectrum in (a), the sampling theorem condition is satisfied; hence,
we can recover the original spectrum using a reconstruction lowpass filter. The
recovered spectrum is shown in figure below

Mosul University COE Department of Electrical Engineering ‫د محمود جاسم‬ Page 14

You might also like