4.5: Nyquist-Shannon Sample Theorem, Sample Aliasing, and Anti-Aliasing Filters

Mechatronics: Fundamentals, Design, Integration, and Validation · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    4.5: Nyquist-Shannon Sample Theorem, Sample Aliasing, and Anti-Aliasing Filters
    Learning Objectives

    After completing this section, you will be able to:

    1. Utilize the Nyquist-Shannon sample theory.
    2. Calculate the aliasing frequencies generated due to not satisfying the Nyquist-Shannon sample condition.
    3. Select the corner frequency of the analog anti-aliasing filter.

    This section discusses how to retain the analog signal information (physical domain) inside the sampled digital signal (information domain) and how to avoid sampling aliasing frequencies. When an analog signal is sampled by an A/D converter, the intension is to use a digital signal to represent the analog one with full information contained in the analog signal. However, the sampled digital signal has only the analog signal information at these sample points; the information between the sampled points is lost during the sampling process. The question now is how to make sure that the sampled digital signal contains the required (or necessary) information to be processed in the information domain. Intuitively, the sample rate (frequency) should be large enough to extract information rich enough from the analog signal. A slow sample rate cannot represent analog signal well. We will use an example to demonstrate the importance of selecting a proper sample rate.

    Example 4.16

    Consider the analog signal shown in equation \ref{4.93} and in a solid line in the top-right plot in Figure 4.50.

    \[ f\left(t\right)=1.5 \sin 2πt +0.6t + 1 \label{4.93}\]

    The two left plots in Figure 4.50 show the two signal sampling schemes with one at 20 Hz (top left plot with \(T=0.05\) second) and the other at 2 Hz (bottom left plot with \(T=0.5\) second). We can see that with 0.05 second sample period, the top-left plot shows that the sampled digital signal (red dots) represents the original analog signal well. However, with sample period of 0.5 second, the bottom-left plot shows that the sampled signal (red dots) is a straight line if these dots are connected, indicating that the analog signal is as below.

    \[f\left(t\right)=0.6t+1 \label{4.94}\]

    This indicates that with an improperly selected sample period, the sampled digital signal may not represent the original analog signal, making selecting the sample rate extremely important.

    Four MATLAB plots showing the effect of under-sampling an analog signal resulting in missing information.
    Figure 4.50: Effect of under-sampling a signal with missing information.

    Now, let’s look into the right two plots in Figure 4.50. The top-right plot indicates that with a sample rate of 20 Hz, the digital signal (red dots) is very close to the analog one (blue line). For the bottom-right plot, we can see that many different signals can have the same sampled digital signal such as \(f_1(t)\) (red-dashed line) and \(f_2(t)\) (green dash-dot line) shown below.

    \[ \begin{align} f_1\left(t\right) &=1.5{\sin 4πt\ }+0.6t+1 \\[4pt] f_2\left(t\right) &=1.5{\sin 6πt\ }+0.6t+1 \end{align} \label{4.95}\]

    As a summary, because the analog signal between the sample points is missing, a digital signal obtained by sampling an analog signal could represent an infinite number of analog signals.

    Now the question is what the proper sample rate (or condition) is so that the analog signal can be represented by sampled digital (quantized) signal in the information domain. The following Nyquist-Shannon sample theorem provides such information.

    Theorem 4.1

    The Nyquist-Shannon sample theorem indicates that signal sampling frequency (\(f_s\)) should be at least more than twice the highest frequency (\(f_h\)) component contained in the signal \(f(t)\), or in mathematical term below,

    \[f_s>2f_h \label{4.96}\]

    Remark 4.2

    In most of engineering applications, the sampling frequency (\(f_s\)) is often selected to be at least ten times of the highest frequency (\(f_h\)) contained in the signal, that is,

    \[f_s\ge 10f_h \label{4.97}\]

    Remark 4.3

    The Nyquist-Shannon sample theorem indicates that the sampled digital signal is able to recover the frequency components of an analog signal up to half of the sample frequency.

    Example 4.17

    This is an example about the telephone audio system. The maximum frequency (bandwidth) of the human voice is around 3.6 kHz. The human ear can detect a sound signal up to 15 kHz. At the phone microphone, the human voice is filtered by an anti-aliasing analog filter to substantially reduce signal magnitude at frequencies beyond 3.6 kHz. The filtered microphone signal is then sampled at 8 kHz to meet the Nyquist-Shannon sample theorem required to avoid sample aliasing. The human ear can detect sound up to 15 kHz. Because the voice signal frequency is limited to 3.6 kHz by the anti-aliasing low-pass filter, the sampled sound signal could be different from the original voice, making the sound from a telephone different from the actual sound.

    Theorem 4.1 provides a guideline for selecting a proper sample rate so that the sampled analog signal characteristics can be recovered from the digital signal. As discussed in Remark 4.2, for practical applications, we recommend having the sample rate be 10 times greater than or equal to the highest frequency component contained in the sampled analog signal, even though the Nyquist-Shannon sample theorem only requires it to be two times greater than the highest frequency component. Now we will discuss what happens if the Nyquist-Shannon sample condition is not satisfied.

    A MATLAB plot showing a 72 Hz sinusoidal signal sampled at 66 Hz resulting in a 6 Hz signal.
    Figure 4.51: A 72 Hz \(f\left(t\right)=1.5\sin (2π\times 72t+0.1) \) sampled at 66 Hz.

    Figure 4.51 shows the plot of 72 Hz sinusoidal signal with a phase delay of 0.1 second in the solid-blue line and the sampled signal at 66 Hz in the red dots. We can see that the sampled analog signal has a frequency of 6 Hz that is not included in the original analog signal. That is, with the sample frequency (66 Hz) below the Nyquist-Shannon required frequency of greater than \(2\times 72=144\) Hz, the sampled signal shifted the signal frequency to be below the analog one. This phenomenon is called sample aliasing and the shifted frequency is called aliasing frequency. Let’s look further how this happens. Consider a continuous-time sinusoidal signal.

    \[f\left(t\right)=A{\sin \left(2πf_0t+φ\right)\ } \label{4.98}\]

    Let the sample frequency to be \(f_s=1/T_s\) such that

    \[f\left(n\right)=A{\sin \left(2πf_0nT_s+φ\right)\ },\ t=0,T_s,2T_s,\cdots \label{4.99}\]

    Note that

    \[f\left(n\right)=A{\sin \left(2πf_0nT_s+φ\right)\ }\mathrm{=}A \sin \left(2π(f_0\pm lf_s)nT_s+φ\right) \label{4.100}\]

    for \(l=0,1,2,\cdots\). Furthermore, \(\pm 2πlf_snT_s=\pm \ln\{2π\}\) because \(f_sT_s=1\). This means that the sampled signal \(A \sin \left(2π(f_0\pm lf_s)nT_s+φ\right) \) with \(l=0,1,2,\dots ,\ \infty\) results in equivalent sequences for any integer \(l\).

    Remark 4.4

    Based upon the discussion above, if the Nyquist-Shannon sampling condition is not satisfied, the aliasing frequencies of a signal sampling system can be calculated using the following formula.

    \[f_a=\left|f_0\pm lf_s\right|, l=1,\ 2,\ \dots \label{4.101}\]

    Note that there could be more than one aliasing frequency such that \(|f_0 \pm lf_s | <f_0\).

    The next example demonstrates the case with more than one aliasing frequency.

    Example 4.18

    For this example, we will use three sinusoidal signals, as shown in equation \ref{4.102}, with their frequencies at 30, 170, 230 Hz. Our plan is to study the digital signal characteristics when these signals are sampled at 200 Hz. Figure 4.52 shows the analog signals plotted using blue lines.

    \[\begin{array}{ccc} f_1\left(t\right) & = & {\sin \left(2π30t+0.1\right)\ } \\ f_2\left(t\right) & = & -{\sin \left(2π170t-0.1\right)\ } \\ f_3\left(t\right) & = & {\sin \left(2π230t+0.1\right)\ } \end{array} \label{4.102}\]

    The digital signals sampled at \(T_s=0.005\) second (200 Hz) are shown in equation \ref{4.103}, with sampled points marked with red dots in Figure 4.52.

    \[\begin{array}{ccc} f_1\left(k\right) & = & {\sin \left(2π\left(30\right)kT_s+0.1\right)\ } \\ f_2\left(k\right) & = & -{\sin \left(2π\left(170\right)kT_s-0.1\right)\ } \\ f_3\left(k\right) & = & {\sin \left(2π(230)kT_s+0.1\right)\ } \end{array} \label{4.103}\]

    Let’s check analytically if any aliasing frequencies are generated during the sampling process. First, consider 30 Hz analog signal \(f_1(t)\) sampled at 200 Hz. Because the sample frequency \(f_s=200\) Hz is greater than two times of the highest signal frequency (2\(f_h=2\times 30=60\) Hz), there is no aliasing frequency. Second, consider 170 Hz analog signal \(f_2(t)\) sampled at 200 Hz. Because the sample frequency \(f_s=200\) Hz is smaller than two times of the highest signal frequency (2\(f_h=2\times 170=340\) Hz), there is at least one aliasing frequency. Using the formula in equation \ref{4.101}, we can calculate the aliasing frequency as below.

    \[f_a=\left|f_0\pm lf_s\right|=\left|170\pm l\times 200\right|, l=1,\ 2,\ \dots \label{4.104}\]

    The only aliasing frequency below the signal frequency \(f_0=170\) Hz occurs when \(l=-1\), yielding \(f_a=30\) Hz. From the middle graph of Figure 4.52, we can see that the sampled signal does have a frequency of 30 Hz. Last, consider 230 Hz analog signal \(f_3(t)\) sampled at 200 Hz. Because the sample frequency \(f_s=200\) Hz is again smaller than two times of the highest signal frequency (2\(f_h=2\times 230=460\) Hz), there is at least one aliasing frequency. Again, using the formula in equation \ref{4.101}, we can calculate the aliasing frequency as below.

    \[f_a=\left|f_0\pm lf_s\right|=\left|230\pm l\times 200\right|, l=1,\ 2,\ \dots \label{4.105}\]

    Three MATLAB plots of three sinusoidal signals of 30, 170, and 230 Hz sampled at 200 Hz resulting in the same discrete-time signal with a frequency of 30 Hz.
    Figure 4.52: Three sinusoidal signals sampled at 200 Hz resulting signals with the same frequency.

    The aliasing frequencies below the signal frequency \(f_0=230\) Hz occur when \(l=-1,\ -2\), leading to \(f_a=30,\ 170\) Hz. From the bottom graph of Figure 4.52, we can see that the sampled signal does have a frequency of 30 Hz. As a summary, for the three analog signals (\(f_1\left(t\right),\ f_2(t)\), and \(f_3(t)\)) sampled at 200 Hz, all of the resulting digital signals have a frequency at 30 Hz. This study indicates that for a \(170\) or \(230\) Hz sinusoidal function sampled at \(200\) Hz sample rate will result in a 30 \(\mathrm{Hz}\) sinusoidal signal due to aliasing because the Nyquist-Shannon sample condition is not satisfied. Note that for \(f_3(t)\) sampled at 200 Hz, the highest recoverable frequency is less than 100 Hz. As a result, the 170 Hz aliasing frequency cannot be seen from the simulation result shown in Figure 4.52.

    Example 4.19

    For this example, imagine a spinning wheel (with a fixed-dot on its edge) rotating counterclockwise (CCW) at a speed of 1, 2, 4, 6, 7, and 8 rotations per second. In other words, it rotates at 1, 2, 4, 6, 7, and 8 Hz. A strobe light is used to shine the dot on the wheel to find the wheel position; see Figure 4.53 for an illustration. The strobe light flashes at a fixed frequency of \(f_s=8\) Hz.

    For the cases with a rotation speed of \(f_h=1\) or \(2\) Hz (top to rows), and because the Nyquist-Shannon sample condition is satisfied (\(2f_h<f_s)\), there is no aliasing frequency. The sampled images can be used to identify the correct rotational direction.

    For the cases with rotation speed of \(f_s=\) \(4\) Hz (third row in Figure 4.53), because the Nyquist-Shannon sample condition is not satisfied (\(2f_h=f_s)\), there is a zero Hz aliasing frequency. As a result, the rotational direction cannot be identified. That is, the Nyquist-Shannon condition needs to be satisfied to recover sampled signal information (in this case, the rotational direction).

    A drawing showing wheel rotation positions indicated by a dot on its edge shined by a strobe light at 8 Hz for rational frequency of 1, 2, 4, 6, 7, and 8 Hz.
    Figure 4.53: Rotational wheel position sampled by a strobe light.

    For the cases with rotation speed of \(f_s=\) \(6,\ 7,\) and \(8\) Hz (fourth, fifth and sixth rows), and because the Nyquist-Shannon sample condition is not satisfied (\(2f_h>f_s)\), there are aliasing frequencies of 2, 1, and 0 Hz, respectively. Especially for \(f_s=8\) , the rotational direction cannot be identified. Note that 0 Hz aliasing frequency indicates that the sampled signal (in this case, wheel position) remains unchanged; see Figure 4.53.

    Remark 4.5

    The Nyquist-Shannon sample theorem states that to avoid aliasing frequency, the sample frequency \(f_s\) should be more than twice that of the highest frequency \(f_h\) contained in the analog signal \(f(t)\), or \(f_s>2f_h\). To avoid aliasing in the sampling process, an anti-aliasing analog filter should be used (see Figure 4.54).

    A block diagram showing the proper implementation location of an anti-aliasing filter.
    Figure 4.54: Anti-aliasing analog filter to eliminate aliasing frequency.

    In practice, the anti-aliasing filter corner frequency should be at least 5 times smaller than the sample frequency.

    Remark 4.6

    The low-pass anti-aliasing filter must be an analog filter located before the A/D converter. A digital filter located after the A/D converter cannot eliminate any aliasing frequency.

    Section Summary

    This section discusses how to use analog-to-digital (A/D) converters for the sampled digital signal to retain the information contained in the original analog signal. It is both desired and important that the information contained in the analog signal from the physical domain is retained in the sampled digital signal in the information domain. Otherwise, the sampled signals will not be useful in the information domain due to missing information. In addition, if the sample frequency is too low, the digital signal may contain the information in those frequencies (called aliasing frequencies) that are not contained in the original analog signals. This difference can lead to errors in the sampled digital signals and, as a result, in the control signals generated by the microcontroller. The Nyquist-Shannon sample theorem provides the sample frequency condition to avoid sample aliasing [12], [13]. This sample frequency should be at least two times higher than the highest frequency component contained in the analog signal. In order to avoid sample aliasing, once the sample frequency has been selected, an analog anti-aliasing filter should be designed and placed before the A/D converter, where the low-pass anti-aliasing filter has a corner frequency, at least, below one half of the sample frequency [14].

    Section Keywords

    Aliasing: This effect occurs when a sampled signal appears to have a lower frequency than its true value, causing a misrepresentation of the original signal. More specifically, it occurs when a signal is sampled at a rate lower than twice of its highest frequency, as described by the Nyquist-Shannon sampling theorem.

    Anti-aliasing filter (AAF): This analog filter is used before a signal sampler (such as A/D converter) to restrict the bandwidth of the sampled signal so that the Nyquist-Shannon sampling theorem is satisfied over the band of interest.

    Nyquist–Shannon sample theorem: This theorem is an essential principle for digital signal processing; it links the frequency range of a signal and the sample rate required to avoid a type of distortion called aliasing. The theorem states that the sample rate must be more than twice the bandwidth of the signal in order to avoid aliasing. In practice, it is used to select band-limiting filters that keep aliasing below an acceptable amount when an analog signal is sampled.

    Practice Problems

    1. If the highest frequency component of an analog signal is \(f_h=50\) Hz, justify whether the Nyquist-Shannon sample condition is satisfied or not for the following sample frequencies.
      1. \(f_s=100\) Hz
      2. \(f_s=80\) Hz
      3. \(f_s=120\mathrm{\ Hz}\)
    2. Repeat Example 4.19 for the rotation speed with clockwise (CW) rotational direction at a speed of 2 rotation per second (\(f_h=2\) Hz). With the same sample frequency of \(f_s=\mathrm{8}\) Hz, determine if the Nyquist-Shannon sample condition is satisfied and if the wheel rotational direction can be determined.
    3. Considering a continuous-time signal \(f\left(t\right)={\cos \left(2π\times 400t-π\right)\ }\), if it is sampled at a frequency of \(f_s=250\ Hz\), answer the following questions.
      1. Will \(250\ Hz\) sample frequency cause aliasing and why?
      2. If aliasing exists, find all aliasing frequencies below the signal frequency (400 Hz).

    This page titled 4.5: Nyquist-Shannon Sample Theorem, Sample Aliasing, and Anti-Aliasing Filters was last modified on Sun, 23 Aug 2026 22:53:20 GMT and is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Guoming Zhu (Co-DREAM OER) .