Lesson 6: Sampling Analog Signals - Engineering | SIU...Lesson 6_et438b.pptx 26 Example 4: A f s...

16
4/25/2016 1 Lesson 6: Sampling Analog Signals ET 438b Sequential Control and Data Acquisition Department of Technology 1 Lesson 6_et438b.pptx Lesson 6_et438b.pptx 2 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.

Transcript of Lesson 6: Sampling Analog Signals - Engineering | SIU...Lesson 6_et438b.pptx 26 Example 4: A f s...

  • 4/25/2016

    1

    Lesson 6: Sampling Analog Signals

    ET 438b Sequential Control and Data Acquisition

    Department of Technology

    1 Lesson 6_et438b.pptx

    Lesson 6_et438b.pptx 2

    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.

  • 4/25/2016

    2

    Data Acquisition Card

    Sampled Signals

    Lesson 6_et438b.pptx 3

    Sampling Process

    Sensor Signal

    Conditioner Physical parameter M

    ultip

    lexer

    Sample & Hold

    ADC

    Other analog Input channels To computer

    Data bus

    Amplify Filter

    Linearize

    Sampled Signals-Representation of Signal

    Lesson 6_et438b.pptx 4

    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

    )120t5002cos(2)60t2502sin(5)t(s

    Analog Example

    )120nT5002cos(2)60nT2502sin(5)n(s ss

    Sampled Example

    n=sample number

  • 4/25/2016

    3

    Sampled Data Examples

    Lesson 6_et438b.pptx 5

    Representation of analog signal

    Representation of sampled analog signal

    Ts

    Sample and Hold Operation

    Lesson 6_et438b.pptx 6

    Sample and Hold Circuit

    Control input operates solid –state switch at

    sampling rate fs

    Impedance Buffer

    Operating Modes tracking = switch closed hold= switch open

    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 when circuit is in hold mode

    aperture time - time it takes switch to open.

  • 4/25/2016

    4

    Sample and Hold Signals

    Lesson 6_et438b.pptx 7

    Pulse generator closes switch and captures signal value

    0 2 4 6 8 1010

    5

    0

    5

    10

    Sampled Signal

    Analog Signal

    Time

    Am

    pli

    tud

    e

    10

    10

    s t( )

    a t( )

    100 t

    Pulse generator output Analog and sampled signal

    Amplitude Modulated s(t)=p(t)∙a(t)

    Sample and Hold Output

    Lesson 6_et438b.pptx 8

    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

  • 4/25/2016

    5

    Frequency Spectrum

    Lesson 6_et438b.pptx 9

    )t252sin(1)t502sin(1)t10002sin(1)t(v

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

    Information Carrier

    fc=1000 Hz fI1=50 Hz fI2=25 Hz

    Modulation produces sums and differences of carrier and information frequencies

    fh1= fc±fI1 for the 1st information frequency

    fh2= fc±fI1 for the 2nd information frequency

    fhi= fc±fIi for the i-th information frequency

    Frequency Spectrum

    Lesson 6_et438b.pptx 10

    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 Components

    Frequency Spectrum Plot

    950 Hz 1050 Hz

    1000 Hz 1.0

    0.5

    1025 Hz 975 Hz

    | v |

    Frequency

  • 4/25/2016

    6

    Frequency Spectrum

    Lesson 6_et438b.pptx 11

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

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

    | v |

    Frequency dc f=0

    highest frequency in signal

    Nyquist Frequency and Minimum Sampling Rate

    Lesson 6_et438b.pptx 12

    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 Nyquist frequency.

    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

  • 4/25/2016

    7

    Sampled Signal Frequency Spectrum

    Lesson 6_et438b.pptx 13

    Sampling with fs >2fh

    Am

    plit

    ud

    e

    Frequency fh fs 2fs

    fs+fh fs-fh 2fs+fh 2fs-fh

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

    Am

    plit

    ud

    e

    Frequency fh fs 2fs

    fs+fh fs-zfh 2fs+fh 2fs-fh

    Folded Frequencies

    Nyquist Frequency and Aliasing

    Lesson 6_et438b.pptx 14

    Only signals with frequencies below Nyquist frequency will be correctly reproduced

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

    )t4002sin(3)t5002cos(5.1)t2502sin(5)t1002sin(2)t(s

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

    fs(min) = 2fh

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

    fh= 500 Hz

  • 4/25/2016

    8

    Nyquist Frequency and Aliasing

    Lesson 6_et438b.pptx 15

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

    )t900sin(75.1)t800cos(5.0)t250sin(3)t175sin(5.1)t(s

    Convert the radian frequency to frequency in Hz by dividing values by 2

    Hz 4502

    900f Hz 400

    2

    800f Hz 125

    2

    250f Hz 5.87

    2

    175f 4321

    Find the highest frequency component: 450 Hz

    fs(min) = 2fh

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

    Aliased Frequencies

    Lesson 6_et438b.pptx 16

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

    2

    ff

    ff0

    fnff

    s

    nyquistalias

    sIalias

    nyquist

    Where: fI = sampled information signal with fI>fnyquist fs = sampling frequency (Hz) n = sampling harmonic number falias = aliased frequency fnyquist = one-half sampling frequency

  • 4/25/2016

    9

    Samples/Period and Aliasing

    Lesson 6_et438b.pptx 17

    Correct signal representation requires at least two samples/period

    sIIs

    s

    I

    I

    ss

    TT and ff

    T

    T

    f

    fN

    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)

    Sampling/Aliasing Examples

    Lesson 6_et438b.pptx 18

    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

    riodsamples/pe 10S 001.0

    S 01.0

    Hz 100

    Hz 1000Ns

    Hz 5002

    Hz 1000

    2

    ff snyquist

    Above Nyquist rate of 2

    Signals below 500 Hz reproduced without aliasing

    View the frequency spectrum using FFT of samples

  • 4/25/2016

    10

    Lesson 6_et438b.pptx 19

    Sampling/Aliasing Examples

    0 100 200 300 400 500 6000

    0.5

    1

    1.5

    2

    Frequency Spectrum

    Frequency

    Am

    pli

    tud

    e

    100

    500 Hz Nyquist

    Limit

    Frequency Spectrum 100 Hz Recovered

    Lesson 6_et438b.pptx 20

    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

    riodsamples/pe 6.0S 001666.0

    S 01.0

    Hz 100

    Hz 60Ns

    Hz 302

    Hz 60

    2

    ff snyquist

    Below Nyquist rate of 2

    Signals below 30 Hz reproduced without aliasing

    Aliased signals will occur due to low sampling rate

    Now compute the aliased frequency for 1st sampling harmonic

  • 4/25/2016

    11

    Lesson 6_et438b.pptx 21

    Sampling/Aliasing Examples

    2

    ff

    ff0

    fnff

    s

    nyquistalias

    sIalias

    nyquist

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

    Hz 30f0

    Hz 302

    Hz 60f

    Hz 40Hz 601Hz 100f

    alias

    nyquist

    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)

    Hz 20Hz 602Hz 100falias

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

    Lesson 6_et438b.pptx 22

    Frequency Spectrum

    Sampling/Aliasing Examples

    0 5 10 15 20 25 30 35 0

    0.5

    1

    1.5

    2

    2.5

    3

    Frequency Spectrum

    Frequency

    Am

    pli

    tude

    30 Hz Nyquist

    Limit 20 Hz Alias f

  • 4/25/2016

    12

    Sampling/Aliasing Examples

    Lesson 6_et438b.pptx 23

    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

    riodsamples/pe 8.0S 00125.0

    S 01.0

    Hz 100

    Hz 80Ns

    Hz 402

    Hz 80

    2

    ff snyquist

    Below Nyquist rate of 2

    Signals below 40 Hz reproduced without aliasing

    Aliased signals will occur due to low sampling rate

    Sampling/Aliasing Examples

    Lesson 6_et438b.pptx 24

    2

    ff

    ff0

    fnff

    s

    nyquistalias

    sIalias

    nyquist

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

    Hz 40f0

    Hz 402

    Hz 60f

    Hz 20Hz 801Hz 100f

    alias

    nyquist

    alias

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

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

    Hz 60Hz 802Hz 100falias

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

  • 4/25/2016

    13

    Sampling/Aliasing Examples

    Lesson 6_et438b.pptx 25

    Frequency Spectrum

    0 10 20 30 40 50 0

    0.5

    1

    1.5

    2

    2.5

    3

    Frequency Spectrum

    Frequency

    Am

    pli

    tude

    40 Hz Nyquist

    Limit 20 Hz Alias f

    Sampling/Aliasing Examples

    Lesson 6_et438b.pptx 26

    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

    riodsamples/pe 1S 01.0

    S 01.0

    Hz 100

    Hz 100Ns

    Hz 502

    Hz 100

    2

    ff snyquist

    Below Nyquist rate of 2

    Signals below 50 Hz reproduced without aliasing

    Aliased signals will occur due to low sampling rate

  • 4/25/2016

    14

    Sampling and Aliasing Examples

    Lesson 6_et438b.pptx 27

    2

    ff

    ff0

    fnff

    s

    nyquistalias

    sIalias

    nyquist

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

    Hz 50f0

    Hz 502

    Hz 100f

    Hz 0Hz 1001Hz 100f

    alias

    nyquist

    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 28

    Sampling and Aliasing Examples

    0 0.02 0.04 0.06 0.08 0.1

    2

    1

    0

    1

    2

    Sampled Signal

    Information

    Time

    Am

    pli

    tude

    0 10 20 30 40 50 60 0

    0.5

    1

    1.5

    2

    2.5

    3

    Frequency Spectrum

    Frequency

    Am

    pli

    tude

    50 Hz Nyquist

    Limit

    0 Hz (dc) Alias f

    Time plot

  • 4/25/2016

    15

    Sampling and Aliasing Examples

    Lesson 6_et438b.pptx 29

    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

    riodsamples/pe 25.1S 008.0

    S 01.0

    Hz 100

    Hz 125Ns Below Nyquist rate of 2

    Hz 5.622

    Hz 125

    2

    ff snyquist

    Signals below 62.5 Hz reproduced without aliasing

    Aliased signals will occur due to low sampling rate

    Sampling and Aliasing Examples

    Lesson 6_et438b.pptx 30

    2

    ff

    ff0

    fnff

    s

    nyquistalias

    sIalias

    nyquist

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

    Hz 5.62f0

    Hz 5.622

    Hz 125f

    Hz 25Hz 1251Hz 100f

    alias

    nyquist

    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)

    Hz 150Hz 1252Hz 100falias

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

  • 4/25/2016

    16

    Lesson 6_et438b.pptx 31

    Sampling and Aliasing Examples

    Frequency Spectrum fii

    Ns

    1

    Ts

    0 10 20 30 40 50 60 700

    0.5

    1

    1.5

    2

    2.5

    Frequency Spectrum

    Frequency

    Am

    pli

    tud

    e

    62.5 Hz Nyquist

    Limit 25 Hz Alias f

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

    Department of Technology

    Lesson 6_et438b.pptx 32