EE3054
Signals and Systems
Sampling of Continuous
    Time Signals
                      Yao Wang
                Polytechnic University
Some slides included are extracted from lecture presentations prepared by
                         McClellan and Schafer
License Info for SPFirst Slides
 This work released under a Creative Commons License
  with the following terms:
 Attribution
             The licensor permits others to copy, distribute, display, and perform
              the work. In return, licensees must give the original authors credit.
 Non-Commercial
             The licensor permits others to copy, distribute, display, and perform
              the work. In return, licensees may not use the work for commercial
              purposes—unless they get the licensor's permission.
 Share Alike
             The licensor permits others to distribute derivative works only under
              a license identical to the one that governs the licensor's work.
   Full Text of the License
   This (hidden) page should be kept with the presentation
4/17/2008                       © 2003, JH McClellan & RW Schafer               2
LECTURE OBJECTIVES
 Concept of sampling
 Sampling using periodic impulse train
 Frequency domain analysis
   Spectrum of sampled signal
   Nyquist sampling theorem
   Sampling of sinusoids
 Two Processes in A/D
 Conversion
                     Sampling                          Quanti-
                                                       zation
      xc(t)                         x[n] = xc(nT)                    x$[ n]
                      Sampling                       Quantization
                       Period                          Interval
                         T                                Q
 Sampling: take samples at time nT
    T: sampling period;                            x[ n] = x( nT ),−∞ < n < ∞
    fs = 1/T: sampling frequency
 Quantization: map amplitude values into a set of discrete values ± pQ
    Q: quantization interval or stepsize              xˆ[ n] = Q[ x(nT )]
Analog to Digital
Conversion
      1
                           T=0.1
                           Q=0.25
    0.5
    -0.5
     -1
           0   0.2   0.4            0.6   0.8   1
                                                    A2D_plot.m
How to determine T and Q?
 T (or fs) depends on the signal frequency range
    A fast varying signal should be sampled more frequently!
    Theoretically governed by the Nyquist sampling theorem
        fs > 2 fm (fm is the maximum signal frequency)
        For speech: fs >= 8 KHz; For music: fs >= 44 KHz;
 Q depends on the dynamic range of the signal
  amplitude and perceptual sensitivity
    Q and the signal range D determine bits/sample R
        2R=D/Q
        For speech: R = 8 bits; For music: R =16 bits;
 One can trade off T (or fs) and Q (or R)
    lower R -> higher fs; higher R -> lower fs
 We only consider sampling in this class
SAMPLING x(t)
 SAMPLING PROCESS
     Convert x(t) to numbers x[n]
     “n” is an integer; x[n] is a sequence of values
     Think of “n” as the storage address in memory
 UNIFORM SAMPLING at t = nTs
     IDEAL: x[n] = x(nTs)
                x(t)            x[n]
                       C-to-D
Sampling of Sinusoid
Signals
          Sampling above
           Nyquist rate
           ωs=3ωm>ωs0
          Reconstructed
            =original
          Sampling under
            Nyquist rate
           ωs=1.5ωm<ωs0
          Reconstructed
            \= original
  Aliasing: The reconstructed sinusoid has a lower frequency than the original!
Nyquist Sampling Theorem
 Theorem:
    If x(t) is bandlimited, with maximum frequency fb(or
     ωb =2π fb)
    and if fs =1/ Ts > 2 fb or ωs =2π / Ts >2 ωb
    Then xc(t) can be reconstructed perfectly from x[n]=
     x(nTs ) by using an ideal low-pass filter, with cut-off
     frequency at fs/2
    fs0 = 2 fb is called the Nyquist Sampling Rate
 Physical interpretation:
    Must have at least two samples within each cycle!
Sampling Using Periodic Impulse
Train
                                                x[n] = x(nTs )
                                                  FOURIER
                                                  TRANSFORM
                                                  of xs(t) ???
4/17/2008   © 2003, JH McClellan & RW Schafer              10
Periodic Impulse Train
                        ∞
            p(t ) =   ∑ δ (t − nT )
                      n = −∞
                                                s
4/17/2008                   © 2003, JH McClellan & RW Schafer   11
Impulse Train Sampling
                ∞                                         ∞
   xs (t) = x(t) ∑ δ (t − nTs ) = ∑ x(t)δ (t − nTs )
               n=−∞                                 n=−∞
                        ∞
            xs (t) = ∑ x(nTs )δ(t −nTs )
4/17/2008           n=−∞
                      © 2003, JH McClellan & RW Schafer       12
Illustration of Sampling
  x(t)
                                                            t
                                                        ∞
                                          xs (t ) =    ∑ x(nTs )δ (t − nTs )
                                                      n = −∞
            x[n] = x(nTs )
                                                         n
4/17/2008    © 2003, JH McClellan & RW Schafer                        13
Sampling: Freq. Domain
                                                               How is the
                                                               spectrum of xs(t)
                                                               related to that of
                                                               x(t)?
                        ∞
                  =    ∑ ak e                 jkω s t           EXPECT
                                                                FREQUENCY
                      k = −∞                                    SHIFTING !!!
              ∞                                            ∞
  p(t ) =    ∑δ (t − nTs ) = ∑ ak e                                jkω s t
            n = −∞                                   k = −∞
4/17/2008              © 2003, JH McClellan & RW Schafer                       14
Fourier Series Representation
of Periodic Impulse Train
              ∞                                     ∞
                                                                                   2π
p (t ) =     ∑δ (t − nTs ) = ∑ ak e                                 jkω s t
                                                                              ωs =
                                                                                   Ts
            n = −∞                              k = −∞
              Ts / 2
     1                                         1                   Fourier Series
                  ∫ δ (t )e
                              − jkω s t
ak =                                      dt =
     Ts       −Ts / 2
                                               Ts
4/17/2008                      © 2003, JH McClellan & RW Schafer                    15
    FT of Impulse Train
           ∞                                                           ∞
                              1                                           2π
p(t ) =  ∑
        n = −∞
               δ (t − nTs ) =
                              Ts   ∑e
                                   k
                                          jkω s t
                                                       ↔ P ( jω ) =    ∑  T
                                                                    k = −∞ s
                                                                             δ (ω − kω s )
                                                                                2π
                                                                           ωs =
                                                                                Ts
    4/17/2008                      © 2003, JH McClellan & RW Schafer                16
Frequency-Domain Analysis:
Using Fourier Series
  x s (t ) = x(t ) p (t )
           ∞
                                1
  p(t ) = ∑
          n = −∞
                 δ (t − nTs ) =
                                Ts   ∑
                                     k
                                         e jkω s t
                       ∞                                   ∞
                         1 jkω st                    1               jkω st
 xs (t) =      x(t) ∑ e                         =          ∑ x(t)e
                                                     Ts
                   k =−∞ Ts                               k=−∞
                    1       ∞
 Xs ( jω ) =                ∑ X( j(ω − kω s ))
                    Ts
                         k =−∞                                        2π
                                                                 ωs =
                                                                      Ts
  Frequency-Domain Analysis:
  Using Multiplication-
  Convolution duality
         ∞                                                            ∞
                              1                                         2π
p(t ) = ∑
        n = −∞
               δ (t − nTs ) =
                              Ts   ∑e
                                   k
                                           jkω s t
                                                     ↔ P ( jω ) =    ∑  T
                                                                  k = −∞ s
                                                                           δ (ω − kω s )
                         1
x(t)p(t) ⇔                    X( jω )∗ P( jω )
                        2π
                                                      ∞
             1                       1                     2π
X s( jω ) =
            2π
               X ( jω ) * P( jω ) =
                                    2π               ∑     T
                                                     k = −∞ s
                                                              X ( jω ) * δ (ω − kω s )
                 ∞
          1
        =
          Ts    ∑ X ( j(ω − kω ))
               k = −∞
                                       s
Frequency-Domain
Representation of Sampling
“Typical”
bandlimited signal
                          1 ∞
            Xs ( jω ) =       ∑
                          Ts k=−∞
                                  X( j(ω                      − kω s ))
4/17/2008                 © 2003, JH McClellan & RW Schafer               19
Aliasing Distortion
“Typical”
bandlimited signal
 If ωs < 2ωb , the copies of X(jω) overlap,
  and we have aliasing distortion.
4/17/2008            © 2003, JH McClellan & RW Schafer   20
   Frequency Domain
   Interpretation of Sampling
Original signal
 Sampling
impulse train            The spectrum of the
                         sampled signal includes
                         the original spectrum and
                         its aliases (copies) shifted
Sampled signal           to k fs , k=+/- 1,2,3,…
  ωs>2 ωm                The reconstructed signal
                         from samples has the
                         frequency components
                         upto fs /2.
Sampled signal
    ωs<2 ωm              When fs< 2fm , aliasing
(Aliasing effect)        occur.
Reconstruction: Frequency-Domain
                                                 If ω s > 2ωb , the copies of
H r ( jω )                                       X ( jω ) do not overlap, so
                                                 X r ( jω ) = H r ( jω ) X s ( jω )
 4/17/2008   © 2003, JH McClellan & RW Schafer                               22
Nyquist Sampling Theorem
 Theorem:
    If x(t) is bandlimited, with maximum frequency fb(or
     ωb =2π fb)
    and if fs =1/ Ts > 2 fb or ωs =2π / Ts >2 ωb
    Then xc(t) can be reconstructed perfectly from x[n]=
     x(nTs ) by using an ideal low-pass filter, with cut-off
     frequency at fs/2
    fs0 = 2 fb is called the Nyquist Sampling Rate
 Physical interpretation:
    Must have at least two samples within each cycle!
Sampling of Sinusoid
Signals: Temporal domain
          Sampling above
           Nyquist rate
           ωs=3ωm>ωs0
          Reconstructed
            =original
          Sampling under
            Nyquist rate
           ωs=1.5ωm<ωs0
          Reconstructed
            \= original
  Aliasing: The reconstructed sinusoid has a lower frequency than the original!
Sampling of Sinusoid:
Frequency Domain
Spectrum of
cos(2πf0t)
                                                                    -f0          0                 f0
 No aliasing
 fs >2f0
 fs -f0 >f0
 Reconstructed
                          -fs -f0   -fs             -fs+f0      -f0              0                 f0          fs-f0           fs   fs+f0
 signal: f0
                                                          -fs/2                                         fs/2
With aliasing
f0<fs <2f0 (folding)                                                             0
fs -f0 <f0
Reconstructed signal: fs -f0              -fs -f0             -fs   -f0 -fs+f0       fs-f0        f0    fs             fs+f0
With aliasing
fs <f0 (aliasing)                                                     -fs
                                                                                 0           fs
f0-fs <f0
Reconstructed signal: fs -f0                        -fs -f0         -f0 -f0+fs       f0-fs        f0         fs+f0
More examples with
Sinusoids
SAMPLING GUI (con2dis)
4/17/2008   © 2003, JH McClellan & RW Schafer   27
Strobe Movie
 From SP First, Chapter 4, Demo on
  “Strobe Movie”
How to determine the necessary
sampling frequency from a signal
waveform?
 Given the waveform, find the shortest ripple, there
  should be at least two samples in the shortest ripple
 The inverse of its length is approximately the highest
  frequency of the signal
                                  Fmax=1/Tmin
                        Tmin
         Need at least two
         samples in this
         interval, in order not
         to miss the rise and
         fall pattern.
Sampling with Pre-Filtering
                Pre-Filter               Periodic
                H (f)                    Sampling
    x(t)                       x’(t)                       xd(n)
                                         Sampling
                                         period T
  • If fs < 2fb, aliasing will occur in sampled signal
  • To prevent aliasing, pre-filter the continuous signal so that fb<fs/2
  • Ideal filter is a low-pass filter with cutoff frequency at fs/2
  (corresponding to sync functions in time)
  •Common practical pre-filter: averaging within one sampling interval
Summary
 Sampling as multiplication with the periodic impulse train
 FT of sampled signal: original spectrum plus shifted
  versions (aliases) at multiples of sampling freq.
 Sampling theorem and Nyquist sampling rate
 Sampling of sinusoid signals
    Can illustrate what is happening in both temporal and freq.
     domain. Can determine the reconstructed signal from the
     sampled signal.
 Need for prefilter
 Next lecture: how to recover continuous signal from
  samples, ideal and practical approaches
Readings
 Textbook: Sec. 12.3.1-12.3.2, 4.1-4.3
 Oppenheim and Willsky, Signals and
  Systems, Chap. 7.
   Optional reading (More depth in frequency
    domain interpretation)