Skip to content Skip to navigation Skip to collection information

OpenStax-CNX

You are here: Home » Content » Analog-to-Digital Conversion » The Sampling Theorem

Navigation

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Endorsed by Endorsed (What does "Endorsed by" mean?)

This content has been endorsed by the organizations listed. Click each link for a list of all content endorsed by the organization.
  • IEEE-SPS display tagshide tags

    This collection is included inLens: IEEE Signal Processing Society Lens
    By: IEEE Signal Processing Society

    Comments:

    "Language: en"

    Click the "IEEE-SPS" link to see all content they endorse.

    Click the tag icon tag icon to display tags associated with this content.

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • OrangeGrove display tagshide tags

    This module is included inLens: Florida Orange Grove Textbooks
    By: Florida Orange GroveAs a part of collection: "Fundamentals of Electrical Engineering I"

    Click the "OrangeGrove" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Rice DSS - Braille display tagshide tags

    This module is included inLens: Rice University Disability Support Services's Lens
    By: Rice University Disability Support ServicesAs a part of collection: "Fundamentals of Electrical Engineering I"

    Comments:

    "Electrical Engineering Digital Processing Systems in Braille."

    Click the "Rice DSS - Braille" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Rice Digital Scholarship display tagshide tags

    This collection is included in aLens by: Digital Scholarship at Rice University

    Click the "Rice Digital Scholarship" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

  • Bookshare

    This module is included inLens: Bookshare's Lens
    By: Bookshare - A Benetech InitiativeAs a part of collection: "Fundamentals of Electrical Engineering I"

    Comments:

    "Accessible versions of this collection are available at Bookshare. DAISY and BRF provided."

    Click the "Bookshare" link to see all content affiliated with them.

  • Featured Content display tagshide tags

    This module is included inLens: Connexions Featured Content
    By: ConnexionsAs a part of collection: "Fundamentals of Electrical Engineering I"

    Comments:

    "The course focuses on the creation, manipulation, transmission, and reception of information by electronic means. It covers elementary signal theory, time- and frequency-domain analysis, the […]"

    Click the "Featured Content" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Also in these lenses

  • Evowl

    This collection is included inLens: Rice LMS's Lens
    By: Rice LMS

    Comments:

    "Language: en"

    Click the "Evowl" link to see all content selected in this lens.

  • Lens for Engineering

    This module and collection are included inLens: Lens for Engineering
    By: Sidney Burrus

    Click the "Lens for Engineering" link to see all content selected in this lens.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.
 

The Sampling Theorem

Module by: Don Johnson. E-mail the author

Summary: Converting between a signal and numbers.

Analog-to-Digital Conversion

Because of the way computers are organized, signal must be represented by a finite number of bytes. This restriction means that both the time axis and the amplitude axis must be quantized: They must each be a multiple of the integers. 1 Quite surprisingly, the Sampling Theorem allows us to quantize the time axis without error for some signals. The signals that can be sampled without introducing error are interesting, and as described in the next section, we can make a signal "samplable" by filtering. In contrast, no one has found a way of performing the amplitude quantization step without introducing an unrecoverable error. Thus, a signal's value can no longer be any real number. Signals processed by digital computers must be discrete-valued: their values must be proportional to the integers. Consequently, analog-to-digital conversion introduces error.

The Sampling Theorem

Digital transmission of information and digital signal processing all require signals to first be "acquired" by a computer. One of the most amazing and useful results in electrical engineering is that signals can be converted from a function of time into a sequence of numbers without error: We can convert the numbers back into the signal with (theoretically) no error. Harold Nyquist, a Bell Laboratories engineer, first derived this result, known as the Sampling Theorem, in the 1920s. It found no real application back then. Claude Shannon, also at Bell Laboratories, revived the result once computers were made public after World War II.

The sampled version of the analog signal st s t is sn T s s n T s , with T s T s known as the sampling interval. Clearly, the value of the original signal at the sampling times is preserved; the issue is how the signal values between the samples can be reconstructed since they are lost in the sampling process. To characterize sampling, we approximate it as the product xt=st P T s t x t s t P T s t , with P T s t P T s t being the periodic pulse signal. The resulting signal, as shown in Figure 1, has nonzero values only during the time intervals n T s Δ2 n T s +Δ2 n T s Δ 2 n T s Δ 2 , n-101 n -1 0 1 .

Figure 1: The waveform of an example signal is shown in the top plot and its sampled version in the bottom.
Sampled Signal
Sampled Signal (sig17.png)
For our purposes here, we center the periodic pulse signal about the origin so that its Fourier series coefficients are real (the signal is even).
p T s t=k= c k ei2πkt T s p T s t k c k 2 k t T s
(1)
c k =sinπkΔ T s πk c k k Δ T s k
(2)
If the properties of st s t and the periodic pulse signal are chosen properly, we can recover st s t from xt x t by filtering.

To understand how signal values between the samples can be "filled" in, we need to calculate the sampled signal's spectrum. Using the Fourier series representation of the periodic sampling signal,

xt= k = c k ei2πkt T s st x t k c k 2 k t T s s t
(3)
Considering each term in the sum separately, we need to know the spectrum of the product of the complex exponential and the signal. Evaluating this transform directly is quite easy.
stei2πkt T s e(i2πft)d t =ste(i2π(fk T s )t)d t =S(fk T s ) t s t 2 k t T s 2 f t t s t 2 f k T s t S f k T s
(4)
Thus, the spectrum of the sampled signal consists of weighted (by the coefficients c k c k ) and delayed versions of the signal's spectrum (Figure 2).
Xf= k = c k S(fk T s ) X f k c k S f k T s
(5)
In general, the terms in this sum overlap each other in the frequency domain, rendering recovery of the original signal impossible. This unpleasant phenomenon is known as aliasing.
Figure 2: The spectrum of some bandlimited (to W W Hz) signal is shown in the top plot. If the sampling interval T s T s is chosen too large relative to the bandwidth W W, aliasing will occur. In the bottom plot, the sampling interval is chosen sufficiently small to avoid aliasing. Note that if the signal were not bandlimited, the component spectra would always overlap.
aliasing
aliasing (spectrum9.png)
If, however, we satisfy two conditions:
  • The signal st s t is bandlimited—has power in a restricted frequency range—to W W Hz, and
  • the sampling interval T s T s is small enough so that the individual components in the sum do not overlap— T s <1/2W T s 12 W ,
aliasing will not occur. In this delightful case, we can recover the original signal by lowpass filtering xt x t with a filter having a cutoff frequency equal to W W Hz. These two conditions ensure the ability to recover a bandlimited signal from its sampled version: We thus have the Sampling Theorem.

Exercise 1

The Sampling Theorem (as stated) does not mention the pulse width Δ Δ. What is the effect of this parameter on our ability to recover a signal from its samples (assuming the Sampling Theorem's two conditions are met)?

Solution

The only effect of pulse duration is to unequally weight the spectral repetitions. Because we are only concerned with the repetition centered about the origin, the pulse duration has no significant effect on recovering a signal from its samples.

The frequency 12 T s 1 2 T s , known today as the Nyquist frequency and the Shannon sampling frequency, corresponds to the highest frequency at which a signal can contain energy and remain compatible with the Sampling Theorem. High-quality sampling systems ensure that no aliasing occurs by unceremoniously lowpass filtering the signal (cutoff frequency being slightly lower than the Nyquist frequency) before sampling. Such systems therefore vary the anti-aliasing filter's cutoff frequency as the sampling rate varies. Because such quality features cost money, many sound cards do not have anti-aliasing filters or, for that matter, post-sampling filters. They sample at high frequencies, 44.1 kHz for example, and hope the signal contains no frequencies above the Nyquist frequency (22.05 kHz in our example). If, however, the signal contains frequencies beyond the sound card's Nyquist frequency, the resulting aliasing can be impossible to remove.

Exercise 2

To gain a better appreciation of aliasing, sketch the spectrum of a sampled square wave. For simplicity consider only the spectral repetitions centered at 1 T s 1 T s , 0 0, 1 T s 1 T s . Let the sampling interval T s T s be 1; consider two values for the square wave's period: 3.5 and 4. Note in particular where the spectral lines go as the period decreases; some will move to the left and some to the right. What property characterizes the ones going the same direction?

Solution

Figure 3
Figure 3 (spectrum16.png)

The square wave's spectrum is shown by the bolder set of lines centered about the origin. The dashed lines correspond to the frequencies about which the spectral repetitions (due to sampling with T s =1 T s 1 ) occur. As the square wave's period decreases, the negative frequency lines move to the left and the positive frequency ones to the right.

If we satisfy the Sampling Theorem's conditions, the signal will change only slightly during each pulse. As we narrow the pulse, making Δ Δ smaller and smaller, the nonzero values of the signal st p T s t s t p T s t will simply be sn T s s n T s , the signal's samples. If indeed the Nyquist frequency equals the signal's highest frequency, at least two samples will occur within the period of the signal's highest frequency sinusoid. In these ways, the sampling signal captures the sampled signal's temporal variations in a way that leaves all the original signal's structure intact.

Exercise 3

What is the simplest bandlimited signal? Using this signal, convince yourself that less than two samples/period will not suffice to specify it. If the sampling rate 1 T s 1 T s is not high enough, what signal would your resulting undersampled signal become?

Solution

The simplest bandlimited signal is the sine wave. At the Nyquist frequency, exactly two samples/period would occur. Reducing the sampling rate would result in fewer samples/period, and these samples would appear to have arisen from a lower frequency sinusoid.

Footnotes

  1. We assume that we do not use floating-point A/D converters.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks