4/25/2016

Lesson 6: Sampling Analog Signals

ET 438b Sequential Control and Data Acquisition

Department of Technology

Lesson 6_et438b.pptx 1

Learning Objectives

After this presentation you will be able to:

 Identify the steps in sampling an analog signal

 Indentify the frequency spectrum of a sampled signal

 Determine the minimum sampling rate of an analog signal

 Determine if a sampled signal contains aliased signals.

Lesson 6_et438b.pptx 2

1 4/25/2016

Sampled Signals

Sampling Process Data Acquisition Card

Signal Sensor Conditioner Physical

parameter Amplify Multiplexer Filter Sample & Linearize ADC

Hold

Other analog Input channels To computer Data bus

Lesson 6_et438b.pptx 3

Sampled Signals-Representation of Signal Analog Signal - defined at every point of independent variable For most physical signals independent variable is time

Sampled Signal - Exists at point of measurement. Sampled

at equally spaced time points, Ts called sampling time. (1/Ts =fs), sampling frequency Analog Example s(t)  5sin(2250t  60 )  2cos(2500t 120 )

Sampled Example   s(n)  5sin(2250Ts n  60 )  2cos(2500Ts n 120 )

n=sample number Lesson 6_et438b.pptx 4

2 4/25/2016

Sampled Data Examples

Representation of analog signal

Ts

Representation of sampled analog signal

Lesson 6_et438b.pptx 5

Sample and Hold Operation Sample and Hold Circuit Operating Modes tracking = switch closed Control input operates hold= switch open solid –state switch at

sampling rate fs Sample and Hold Parameters Acquisition Time - time from

instant switch closes until Vi within defined % of input. Determined by

input time constant t = RinC 5t value = 99.3% of final value decay rate - rate of discharge of C Impedance when circuit is in hold mode

Buffer aperture time - time it takes switch to open.

Lesson 6_et438b.pptx 6

3 4/25/2016

Sample and Hold Signals Pulse generator closes switch and captures signal value

10 10

5

s(t) 0

a(t) Amplitude

5

 10 10 0 2 4 6 8 10 0 t 10 Time Sampled Signal Analog Signal

Analog and sampled signal Pulse generator output Amplitude Modulated s(t)=p(t)∙a(t)

Lesson 6_et438b.pptx 7

Sample and Hold Output

Sample must be held while digital conversion takes place. Total time to digitize

tc = ta + td Where tc = total conversion time ta = total acquisition time td = total digital conversion time Hold Time

Lesson 6_et438b.pptx 8

4 4/25/2016

Frequency Spectrum

Sampling is modulation. Shifts all signal frequency components and generates harmonics

fc=1000 Hz fI1=50 Hz fI2=25 Hz v(t) 1sin(21000t)1sin(250t) 1sin(225t)

Carrier Information

Modulation produces sums and differences of carrier and information frequencies

st fh1= fc±fI1 for the 1 information frequency nd fh2= fc±fI1 for the 2 information frequency fhi= fc±fIi for the i-th information frequency

Lesson 6_et438b.pptx 9

Frequency Spectrum Frequency Components

fh1= fc±fI1 =1000 Hz ± 50 Hz = 1050 Hz and 950 Hz fh2= fc±fI1 =1000 Hz ± 25 Hz = 1025 Hz and 975 Hz

Frequency Spectrum Plot | v | 1000 Hz 1.0

0.5

950 Hz 975 Hz 1025 Hz 1050 Hz Frequency

Lesson 6_et438b.pptx 10

5 4/25/2016

Frequency Spectrum

Complex signals usually have a frequency spectrum that is wider. Can be visualized with continuous f plot and found with an Fast (FFT)

| v |

highest frequency in signal

dc f=0 Frequency

Frequency spectrum of input signals sample & hold must be known to accurately reproduce original signal from samples

Lesson 6_et438b.pptx 11

Nyquist Frequency and Minimum Sampling Rate To accurately reproduce the analog input data with samples

the sampling rate, fs, must be twice as high as the highest frequency expected in the input signal. (Two samples per period) This is known as the .

fs(min) = 2fh

Where fh = the highest discernible f component in input signal

fs(min) = minimum sampling f

Nyquist rate is the minimum frequency and requires an ideal pulse to reconstruct the original signal into an analog value

Lesson 6_et438b.pptx 12

6 4/25/2016

Sampled Signal Frequency Spectrum

Sampling with fs >2fh

Amplitude

fs+fh fh fs-fh fs 2fs-fh 2f 2fs+fh Frequency s

Sampling at less than 2fh causes and folding of sampled signals.

Folded

Frequencies Amplitude

fs+fh fh fs-zfh fs 2fs-fh 2f 2fs+fh Frequency s

Lesson 6_et438b.pptx 13

Nyquist Frequency and Aliasing

Only signals with frequencies below Nyquist frequency will be correctly reproduced

Example: Given the following signal, determine the minimum sampling rate (Nyquist frequency) s(t)  2sin(2100t) 5sin(2250t) 1.5cos(2500t) 3sin(2400t)

Find the highest frequency component: 100 Hz, 250 Hz, 500 Hz, 400 Hz

f = 500 Hz h fs(min) = 2fh

fs(min) = 2(500 Hz)= 1000 Hz

Lesson 6_et438b.pptx 14

7 4/25/2016

Nyquist Frequency and Aliasing

Example: Given the following signal, determine the minimum sampling rate (Nyquist frequency)

s(t) 1.5sin(175t) 3sin(250t) 0.5cos(800t) 1.75sin(900t) Convert the radian frequency to frequency in Hz by dividing values by 2

175 250 800 900 f   87.5 Hz f  125 Hz f   400 Hz f   450 Hz 1 2 2 2 3 2 4 2

Find the highest frequency component: 450 Hz

fs(min) = 2fh

fs(min) = 2(450 Hz)= 900Hz

Lesson 6_et438b.pptx 15

Aliased Frequencies

Sampling analog signal below 2fh produces false frequencies. Aliased frequencies determined by:

falias  fI  n fs

0  falias  fnyquist f f  s nyquist 2

Where: fI = sampled information signal with fI>fnyquist fs = sampling frequency (Hz) n = sampling harmonic number

falias = aliased frequency fnyquist = one-half sampling frequency

Lesson 6_et438b.pptx 16

8 4/25/2016

Samples/Period and Aliasing Correct signal representation requires at least two samples/period

fs TI Ns   fI Ts

fs  fI and TI  Ts

Where Ns = number input signal samples per period of sampling frequency fs = sampling frequency (Hz) fI = highest information signal frequency (Hz) Ts = sampling period, 1/fs, (seconds) TI = period information signal’s highest frequency (1/fI)

Lesson 6_et438b.pptx 17

Sampling/Aliasing Examples

Example 1: A fs=1000 Hz sampling frequency samples an information signal of fI=100 Hz . Determine samples/period, the resulting recovered signal ,and aliased frequencies if present

Determine the number of samples/ period 1000 Hz 0.01 S N   10 samples/period Above Nyquist rate of 2 s 100 Hz 0.001 S f 1000 Hz f  s   500 Hz Signals below 500 Hz nyquist 2 2 reproduced without aliasing

View the frequency spectrum using FFT of samples

Lesson 6_et438b.pptx 18

9 4/25/2016

Sampling/Aliasing Examples 500 Hz Frequency Spectrum 100 Hz Nyquist Recovered Limit

2

100

1.5

1 Amplitude

0.5

0 0 100 200 300 400 500 600 Frequency Frequency Spectrum

Lesson 6_et438b.pptx 19

Sampling/Aliasing Examples

Example 2: A fs=60 Hz sampling frequency samples an information signal of fI=100 Hz . Determine samples/period, the resulting recovered signal ,and aliased frequencies if present

Determine the number of samples/ period

60 Hz 0.01 S N    0.6 samples/period Below Nyquist rate of 2 s 100 Hz 0.001666 S

Aliased signals will occur due to low sampling rate

f 60 Hz f  s   30 Hz Signals below 30 Hz nyquist 2 2 reproduced without aliasing

Now compute the aliased frequency for 1st sampling harmonic

Lesson 6_et438b.pptx 20

10 4/25/2016

Sampling/Aliasing Examples

Alias frequencies for 1st harmonic of sampling f (n=1)

falias  fI  n fs falias  100 Hz160 Hz  40 Hz 0  f  f 60 Hz alias nyquist f   30 Hz nyquist f 2 f  s nyquist 0  f  30 Hz 2 alias

The falias is outside range 0-30 Hz, (40 Hz > 30 Hz) No recovered signal

Find alias frequencies of 2nd sampling harmonic f (n=2)

falias  100 Hz 260 Hz  20 Hz

The falias in range 0-30 Hz, 20 Hz recovered signal

Lesson 6_et438b.pptx 21

Sampling/Aliasing Examples Frequency Spectrum 30 Hz Nyquist

3 Limit 20 Hz

2.5 Alias f

2

1.5 Amplitude

1

0.5

0 0 5 10 15 20 25 30 35

Frequency Frequency Spectrum

Lesson 6_et438b.pptx 22

11 4/25/2016

Sampling/Aliasing Examples

Example 3: A fs=80 Hz sampling frequency samples an information signal of fI=100 Hz . Determine samples/period, the resulting recovered signal ,and aliased frequencies if present

Determine the number of samples/ period

80 Hz 0.01 S N    0.8 samples/period Below Nyquist rate of 2 s 100 Hz 0.00125 S

Aliased signals will occur due to low sampling rate

f 80 Hz f  s   40 Hz Signals below 40 Hz nyquist 2 2 reproduced without aliasing

Lesson 6_et438b.pptx 23

Sampling/Aliasing Examples Alias frequencies for 1st harmonic of sampling f (n=1)

falias  fI  n fs falias  100 Hz180 Hz  20 Hz 0  f  f 60 Hz alias nyquist f   40 Hz nyquist f 2 f  s nyquist 0  f  40 Hz 2 alias

The falias is inside range 0-40 Hz 20 Hz recovered signal

Find alias frequencies of 2nd sampling harmonic f (n=2)

falias  100 Hz 280 Hz  60 Hz

The falias outside range 0-40 Hz, No recovered signal

Lesson 6_et438b.pptx 24

12 4/25/2016

Sampling/Aliasing Examples Frequency Spectrum 40 Hz Nyquist Limit 20 Hz 3 Alias f

2.5

2

1.5 Amplitude

1

0.5

0 0 10 20 30 40 50 Frequency Frequency Spectrum

Lesson 6_et438b.pptx 25

Sampling/Aliasing Examples

Example 4: A fs=100 Hz sampling frequency samples an information signal of fI=100 Hz . Determine samples/period, the resulting recovered signal ,and aliased frequencies if present

Determine the number of samples/ period

100 Hz 0.01 S N   1 samples/period Below Nyquist rate of 2 s 100 Hz 0.01 S

Aliased signals will occur due to low sampling rate

f 100 Hz f  s   50 Hz Signals below 50 Hz nyquist 2 2 reproduced without aliasing

Lesson 6_et438b.pptx 26

13 4/25/2016

Sampling and Aliasing Examples Alias frequencies for 1st harmonic of sampling f (n=1)

falias  fI  n fs falias  100 Hz1100 Hz  0 Hz 0  f  f 100 Hz alias nyquist f   50 Hz nyquist f 2 f  s nyquist 0  f  50 Hz 2 alias

The falias is inside range 0-50 Hz. 0 Hz indicates that the recovered signal is a dc level

View time and frequency plots of this example. 0 Hz is dc. Level depends on phase shift of information signal relative to sampling signal

Lesson 6_et438b.pptx 27

Sampling and Aliasing Examples Time plot

2 50 Hz Nyquist

1 Limit

0 Amplitude 3

1 2.5

2 2

0 0.02 0.04 0.06 0.08 0.1

Time 1.5

Sampled Signal Amplitude Information 1

0 Hz (dc) 0.5 Alias f 0 0 10 20 30 40 50 60 Frequency

Frequency Spectrum

Lesson 6_et438b.pptx 28

14 4/25/2016

Sampling and Aliasing Examples

Previous examples all demonstrate under-sampling. fs≤fI Folding occurs when fs>fI but less that fnyquist

Example 5: A fs=125 Hz sampling frequency samples an information signal of fI=100 Hz . Determine samples/period, the resulting recovered signal ,and aliased frequencies if present Determine the number of samples/ period

125 Hz 0.01 S N   1.25 samples/period Below Nyquist rate of 2 s 100 Hz 0.008 S

Aliased signals will occur due to low sampling rate

f 125 Hz f  s   62.5 Hz Signals below 62.5 Hz nyquist 2 2 reproduced without aliasing

Lesson 6_et438b.pptx 29

Sampling and Aliasing Examples Alias frequencies for 1st harmonic of sampling f (n=1)

falias  fI  n fs falias  100 Hz1125 Hz  25 Hz 0  f  f 125 Hz alias nyquist f   62.5 Hz nyquist f 2 f  s nyquist 0  f  62.5 Hz 2 alias

The falias is inside range 0-62.5 Hz. A 25 Hz signal is reconstructed

Find alias frequencies of 2nd sampling harmonic f (n=2)

falias  100 Hz 2125 Hz 150 Hz

The falias outside range 0-62.5 Hz, No recovered signal at this frequency

Lesson 6_et438b.pptx 30

15 4/25/2016

Sampling and Aliasing Examples

i 1 f     62.5 Hz Frequency Spectrum i  N  T  s  s Nyquist Limit 25 Hz Alias f 2.5

2

1.5

Amplitude 1

0.5

0 0 10 20 30 40 50 60 70 Frequency Frequency Spectrum

Lesson 6_et438b.pptx 31

End Lesson 6: Sampling Analog Signals ET 438b Sequential Control and Data Acquisition

Department of Technology

Lesson 6_et438b.pptx 32

16