0% found this document useful (0 votes)
83 views5 pages

Sampling Rate and Aliasing On A Virtual Laboratory

This document discusses sampling rate and aliasing, important concepts in signal processing. It explains that the sampling frequency must be at least twice the maximum frequency of the analog signal to avoid aliasing. Aliasing occurs when a signal is sampled at too low of a rate, making high frequencies appear as lower frequencies. An example shows aliasing where a high frequency signal appears to have a lower frequency after sampling. Anti-alias filters are also discussed, which filter out high frequencies before sampling to prevent aliasing.

Uploaded by

Jaweria Amjad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views5 pages

Sampling Rate and Aliasing On A Virtual Laboratory

This document discusses sampling rate and aliasing, important concepts in signal processing. It explains that the sampling frequency must be at least twice the maximum frequency of the analog signal to avoid aliasing. Aliasing occurs when a signal is sampled at too low of a rate, making high frequencies appear as lower frequencies. An example shows aliasing where a high frequency signal appears to have a lower frequency after sampling. Anti-alias filters are also discussed, which filter out high frequencies before sampling to prevent aliasing.

Uploaded by

Jaweria Amjad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/40422576

Sampling rate and aliasing on a virtual laboratory

Article  in  Journal of Electrical and Electronics Engineering · October 2009


Source: DOAJ

CITATIONS READS

7 174

1 author:

Bogdan Mihai
Lucian Blaga University of Sibiu
18 PUBLICATIONS   25 CITATIONS   

SEE PROFILE

Some of the authors of this publication are also working on these related projects:

CityPulse View project

All content following this page was uploaded by Bogdan Mihai on 03 March 2015.

The user has requested enhancement of the downloaded file.


Sampling rate and aliasing on a virtual laboratory
Mihai Bogdan
University of Lucian Blaga Sibiu, Faculty of Engeneering,
Str. Emil Cioran, no.4, 550025 Sibiu, Romania, E-Mail: [email protected]

Abstract – The sampling frequency determines the low sampling rate. The dotted line illustrates the
quality of the analog signal that is converted. Higher apparent frequency of the sampled waveform,
sampling frequency achieves better conversion of the completing about two cycles in the period that the
analog signals. The minimum sampling frequency original signal completed 20 cycles.
required to represent the signal should at least be twice
the maximum frequency of the analog signal under
test (this is called the Nyquist rate). In the following
virtual instrument, an example of sampling is shown.
If the sampling frequency is equal or less then twice
the frequency of the input signal, a signal of lower
frequency is generated from such a process (this is
called aliasing).
The goal of this paper is to teach students basic
concepts of sampling rate and aliasing, to become
familiar with this concepts.

Keywords: sampling, aliasing, virtual


instrument.

Figure 1. Aliasing occur when the sampling rate is much too


I. INTRODUCTION
low for the frequency of an input signal
The analysis of real world signals is a fundamental
problem for many engineers and scientists, especially For a given input signal of bandwidth f 0 , the
for electrical engineers since almost every real world sampling frequency f s should be strictly greater
signal is changed into electrical signals [1].
Sampling is the process of converting an input from than 2 f 0 , to ensure perfect reconstruction of the signal
a continuous form to a discrete form. In reference to from the samples. If f s = 2 f 0 , then f s is said to be the
instrumentation this generally means converting analog
input (which is continuous in nature) and converting it to Nyquist frequency. It is important to note that
digital form (which is discrete in nature). But adequate information may be lost if a signal is sampled exactly at
number of samples must be taken from a given analog the Nyquist frequency. For example, the sine wave in
signal in order to effectively reconstruct it back from its Figure 2 has a frequency of 1/2 Hz. The Nyquist
samples. The ‘adequate’ number of samples needed is frequency is therefore 1 Hz. If we sample the sine wave
determined by the Nyquist-Shannon theorem. The at a rate of 1 Hz, say at t=0, t=1, t=2, and so on, all the
theorem states that the perfect reconstruction of an sample values selected will be 0. The signal will look as
analog signal is possible when the sampling frequency is if it were identically 0, and no reconstruction method
greater than twice the maximum frequency of the signal will be able to recreate the 1/2 Hz sine wave. This
being sampled [2]. indicates that f s > 2 f 0 is a strict condition to be met.
Aliasing is the appearance of phantom frequencies
when a signal is not sampled at a high enough rate. In
films (which are normally sampled at 24 frames per
second) you can often see the wheels of cars or
stagecoaches slow down, stand still, or even appear to
rotate backwards. This is aliasing [4].
The next figure illustrates how aliasing would occur
when the sampling rate is much too low for the
frequency of an input signal. The solid curve represents
the analog signal at a comparatively high frequency.
Circles show where samples were taken at a relatively Figure 2. Sampling a sinusoid at Nyquist frequency (Aliased)

121
As seen in Figure 3, when the sampling frequency is
less than the Nyquist rate, the signal is aliased to a
frequency less than the original frequency. Perfect
reconstruction is observed in Figure 4 where the Nyquist
criterion is met. But when sampling frequency is exactly
equal to the Nyquist rate the reconstructed waveform
appears as an alias at DC.

Use the following equation to calculate the alias


frequency:
Alias Freq. = ABS (Closest Int. Mult. of Sampling Freq.
– Input Freq.)
where ABS means the absolute value. For example,
Alias F2 = |100 – 70| = 30 Hz
Alias F3 = |(2)100 – 160| = 40 Hz
Figure 3. Sampling at fs < 2f Alias F4 = |(5)100 – 510| = 10 Hz
To be completely sure that the frequency content of the
input signal is limited, a lowpass filter (a filter that
passes low frequencies but attenuates the high
frequencies) is added before the ADC. This filter is
called an anti-alias filter because it prevents the aliasing
components from being sampled by attenuating the
higher frequencies (greater than Nyquist).
Anti-aliasing filters are analog filters. The following
illustration shows an ideal anti-alias filter.

Figure 4. Sampling at fs > 2f

The alias frequency is the absolute value of the


difference between the frequency of the input signal and
the closest integer multiple of the sampling rate.
For example, assume the sampling frequency, fs, is 100
Hz. Also assume that the input signal contains the
following frequencies: 25 Hz, 70 Hz, 160 Hz, and 510
Hz, as shown in the following illustration. Figure 5. Ideal Anti-alias Filter

Figure 6. Practical Anti-alias Filter


Frequencies below the Nyquist frequency (fs/2 = 50 Hz)
are sampled correctly, as shown in the following An ideal anti-aliasing filter passes all the desired input
illustration. Frequencies above the Nyquist frequency frequencies (below f1) and cuts off all the undesired
appear as aliases. For example, F1 (25 Hz) appears at frequencies (above f1). However, an ideal anti-aliasing
the correct frequency, but F2 (70 Hz), F3 (160 Hz), and filter is not physically possible. In practice, filters look
F4 (510 Hz) have aliases at 30 Hz, 40 Hz, and 10 Hz, as shown in illustration (Figure 6) above. Practical anti-
respectively. aliasing filters pass all frequencies < f1 and cut off all
frequencies > f2. The region between f1 and f2 is known
as the transition band, which contains a gradual
attenuation of the input frequencies. Although you want

122
to pass only signals with frequencies < f1, the signals in simply connecting the sample points. However, the
the transition band could still cause aliasing. samples actually correspond to only one analog signal
Therefore, in practice, you should use a sampling since no other sinusoid or combination of sinusoids will
frequency greater than two times the highest frequency produce this pattern. Therefore, the signal in Figure 10
in the transition band. Because this sampling frequency can be said to have proper sampling. In Figure 11, the
turns out to be more than two times the maximum input sampling frequency is 1,25 times the analog frequency.
frequency (f1), you might see that the sampling rate is In this example, not only do we have difficulty
more than twice the maximum input frequency. reconstructing the analog signal, but we have also
constructed a different sine wave from the original
II. THE VIRTUAL INSTRUMENT analog signal. This phenomenon of signals changing
frequency after sampling is called aliasing. This signal
This section presents the virtual instrument has most certainly been improperly sampled.
programs that were developed to help students for
demonstrate the concept of proper and improper
sampling, as discussed above.
Figure 7 and 8 present the Front Panel and the
Block Diagram of the VI.

Figure 9. Reconstructing an Analog Signal of 5 Hz.


(Sample Frequency = 10 times analog frequency)

Figure 7.The Front Panel of VI

Figure 8. The Block Diagram of VI

The next figures shows examples of a 5 Hz sinusoid


sampled at various frequencies. In Figure 9, the
sampling frequency is 10 times the analog signal
frequency, or 50 Hz. It can be seen that the original
signal can be exactly reconstructed from the samples.
The signal in Figure 9 has been properly sampled. In,
Figure 10 the sampling frequency is 2,5 times the analog Figure 10. Reconstructing an Analog Signal of 5 Hz.
signal frequency. This example is more complicated (Sample Frequency = 2,5 times analog frequency)
since the signal cannot be exactly reconstructed by

123
If data is taken at a certain sampling rate and the
continuous signal frequency is below the Nyquist
frequency, the signal can be properly reconstructed from
the samples and the frequency of the digitized signal
will match the frequency of the continuous signal.
However, when the continuous signal frequency is
above the Nyquist rate, aliasing changes the frequency
into something that can be represented in the sampled
data.
Whenever you are sampling, always make sure that:
•The sampling frequency is high enough so that the
sampled signal in the computer will be sufficiently true
to the original.
•Frequencies at least above theNyquist frequency will be
eliminate before sampling, in order to avoid aliasing.

REFERENCES

[1] M. Bogdan, M. Panu, A. Viorel, Teaching data


acquisition on a virtual laboratory, the 4th Balkan Region
Figure 11. Reconstructing an Analog Signal of 5 Hz. Conference on Engineering Education, ISSN 1843-6730,
(Sample Frequency = 1,25 times analog frequency) 12-14 Iulie, Sibiu, 2007.
[2] National Instruments “LabVIEW Graphical Progra-
mming Course”, 2007.
IV. CONCLUSIONS [3] M. Bogdan, M. Panu, On the quantization of analogue
signals, Acta Universitatiss Cibiniensis, Vol. XXXII, ISSN
As a result of the sampling theorem, a digital signal 1221-4930, Sibiu, 1999.
cannot contain frequencies above one-half the sampling [4] Analog Sampling Basics, available at: http://
rate or Nyquist frequency. If you are using a sine wave, zone.ni.com/devzone/cda/tut/p/id/3016.
this is easy, because a sine wave only contains one
frequency. However, a square wave contains many
higher frequency components in addition to its
fundamental repetition frequency. You can see this on
the Frequency Spectrum.

124

View publication stats

You might also like