Page 1 of 11
Lecture Notes: BS Electronics, 4th Semester, Signal and Systems
Chapter 4: Sampling and Aliasing (DSP First)
4.1 Introduction to Sampling
Analog signals: Analog signals are continuous-time signals. The real-world signals (audio, speech,
biomedical signals) are intrinsically analog in nature. Continuous time signals are mathematically
represented by function of time:
= Acosωt + φ
where t is a real number, and we assume that any value of x(t) is also a real number, i.e values on both
horizontal and vertical axis are real.
Digital Signals: Digital signals and discrete-time signals they are discrete in both time and amplitude, any
vale of the numbers is represented by a finite number of bits, i.e values on both horizontal and vertical
axis are discrete and finite. The discrete- time signals are represented mathematically by an indexed
sequence of numbers:
= − ∞ < < ∞ 4.1
= +
Where n is the integer index indicating the order of the values in the sequence. Values of x[n] are called
samples of the continuous time signals. The discrete- time signals when stored digitally, the signal values
are held in memory locations and can be indexed by memory addresses. Discretization of horizontal axis
(time axis) is called sampling and discretization of vertical axis is called Quantization.
Why Sampling is Necessary?
Computers and digital systems can only process numbers, not continuous waveforms. Therefore, real-
world signals (audio, speech, biomedical signals) which are intrinsically analog (continuous-time) signals
must be converted into discrete-time sequences (sequences of numbers / array of numbers) through a
process called sampling.
Key Definition: Sampling is the process of measuring a continuous-time signal's amplitude at discrete,
equally-spaced time instants.
Analog Signal (continuous) → C-to-D Converter → Digital Signal (discrete)
x(t) ↓ x[n]
Sampling at rate fs
Continuous-Time vs Discrete-Time Signals
Continuous-Time Signal Discrete-Time Signal
Represented as x(t) Represented as x[n]
t is a real number (seconds) n is an integer index
Defined for all t Defined only at integer n
Parentheses: x(t) Square brackets: x[n]
BS Electronics, GPGC Charsadda
Page 2 of 11
The Sampling Operation
When we sample a continuous-time signal x(t) at equally spaced time instants ! = " , The discrete-
time signal is represented mathematically by an indexed sequence of numbers:
= # − ∞ < < ∞ 4.1
Where:
Ts = sampling period (seconds between samples)
%
$ = = sampling rate (samples/second or Hz)
&'
Alternative Form:
= ()$ *
"
4.2 Sampling Sinusoidal Signals
Sampling a Cosine Wave:
Consider a continuous-time sinusoid: = 2.$
= Acosωt + φ = 2.$# , Aℎ545 → #
After sampling with period Ts: Aℎ545 8 ℎ5 instantaneous 8@5 3= # 8 ℎ5 8@5 <548=
= $
ω̂ = 2.$# = # = = 2.
$# $#
= + +
= +ω
, + 4.2
Where we define the normalized discrete-time frequency:
$
ω
, = # = = 2. 4.3
$# $#
,:
Important Properties of 0
$
1) Units, radians (dimensionless), )$ 1ℎ 345 $45675+85, +:+;5 <54 5+=
#
2) Represents frequency relative to the sampling rate
3) Time scale information is lost after sampling.
Example Calculation
Case A, where sampling frequency is 2K:
#BCDEF#
Given: = +200. ?3@<;5= A8ℎ $# = 2000
#
8. 5 = +200., Aℎ545 # = 0.5 @
Calculate analog frequency
200.
$H = = = 100 IJ
2. 2.
Calculate the normalized frequency
BS Electronics, GPGC Charsadda
Page 3 of 11
200
ω
,= = . = 0.1.
$# 2000
Write discrete-time signal
= +0.1 . Case A, where sampling frequency is 10,000 Hz:
Hz:
= cos200. R 0.0005 R +1000. ?3@<;5= A82 $# 10T
3@<;5)
= cos0.1. , Aℎ545 # = 0.5@ 8. 5 +1000., A2545 # 0.1 @
1000.
$H 500 IJ
This gives 20 samples per period of the 2. 2.
1000
original signal. ω
, . 0.1.
$# 10000
ω̂ is still 0.1. (this will be explained in Aliasing)
Case B,
B, where sampling frequency is 500 Hz:
#BCDEF#
Given: = +200. ?3@<;5= A82 $# 500
#
8. 5 +200., A2545 # 2 @
Calculate the normalized frequency
200.
̂ 0.4.
$# 500
Write discrete-time signal
+0.4 .
cos200. R 0.002 R cos0.4 . , A2545 2@
This gives 5 samples per period.
Block diagram of ideal Continuous-to-Discrete
converter. The ideal C-to-D converter is a
mathematical model. Real hardware (A-to-D
Visual Representation converters) have additional limitations like
quantization (finite bit depth) and timing jitter.
Figure 4-3 Concept
Ideal C-to-D ?
Sampling a 100 Hz sinusoid: Converter
(a) Original continuous signal, Smooth cosine wave
(b) Sampled at fs = 2000 Hz (20 samples/period)
$ 1/#
(c) Sampled at fs = 500 Hz (5 samples/period)
BS Electronics, GPGC Charsadda
Page 4 of 11
Spectrum of the figure 4-3
Frequency domain representation:
BS Electronics, GPGC Charsadda
Page 5 of 11
4-1.2 The Concept of Aliases
4.2 Aliasing
Definition of Aliasing
Alias: Two different mathematical formulas that produce the identical sequence of sample values.
Aliasing is the phenomenon that occurs when a continuous-time signal is sampled at a rate lower than the Nyquist
rate. The sampled data then appears identical to data that would have been obtained from a different, lower-
frequency signal. In the frequency domain, a high frequency is indistinguishable from a low frequency after
sampling.
In simple terms: Two different frequencies can produce exactly the same set of samples.
Mathematical Proof of Aliasing, Consider two discrete-time sinusoids derived from sampling:
Signal 1:
% = cos0.4.
Signal 2:
U = cos2.4.
We can use the trigonometric identity:
cosV + 2. = cosV
Apply this to Signal 2:
U = cos2.4. = cos0.4. + 2. = cos0.4.
Since n is an integer, 2π n represents an integer number of full periods. Therefore:
% = U $4 3;; 85W54
The frequency of U 8 ̂ = 2.4. while frequency of % 8 ̂ 0.4..
Conclusion: The frequencies 0.4. 3= 2.4. are aliases of each other. They produce identical sample sequences.
BS Electronics, GPGC Charsadda
Page 6 of 11
General Formulas for Aliases
For a discrete-time sinusoid of the form = +̂₀ + , all frequencies that produce the same samples
are given by:
Positive Frequency Aliases (Periodic Replication):
̂ = ̂₀ + 2. ℓ ℓ = 0, ±1, ±2, …
Folded Aliases (from Negative Frequencies):
̂ = 2. ℓ − ̂₀ ℓ = ±1, ±2, …
The complete set of signals identical to +̂₀ + is:
+̂₀ + 2.ℓ + 3= +2.ℓ − ̂₀ −
Important Observation: For the folded alias case, the sign of the phase φ changes. This is known as phase reversal.
Example Calculation 1: Finding Aliases
Problem: Find three frequency aliases for the principal frequency ω̂₀ = 0.3π.
Solution:
g8W ̂ = ̂₀ + 2. ℓ:
i4 ℓ = 1: ̂ = 0.3. + 2. = 2.3.
i4 ℓ = −1: ̂ = 0.3. − 2. = −1.7.
i4 ℓ = 2: ̂ = 0.3. + 4. = 4.3.
Problem: Show that j_ b = [ \]^k. lab − c. da is an alias of jd b = [ \]^c. lab − c. da in addition, find
two more frequencies that are alias of 0.4.
Solution: 8.4. = 0.4. + 8. = 0.4. + 2. R 4
% = 7 cosn0.4. + 2. R 4 − 0.2.o = 7 cos0.4. + 8. − 0.2., Aℎ545 \]^p + da q = \]^p
% = 7 cos0.4. + 8. − 0.2. = [ \]^c. lab − c. da = U
U = % $4 3;; 85W54
Find two additional aliases of ̂ 0.4.
g8W ̂ ̂₀ + 2. ℓ ℓ = 0, ±1, ±2, … U = 7 cos0.4. − 0.2. = 7 coŝ − 0.2.
i4 ℓ = 1: Using ̂ = 2. ℓ − ̂₀
̂ 0.4. + 2.1 = 2.4. For folded aliases the phase sign must be reversed.
ℎ5 8W3; [\]^d. la b − c. da 8 3 3;83. =7 cos2. − ̂₀ + 0.2.
i4 rstuvu 3;83:
= 7 cos2. − 0.4. + 0.2.
̂ = 2. ℓ − ̂₀ ℓ = 0, ±1, ±2, …
= [ \]^_. `ab + c. da 8 ℎ5 $;=5= 3;83.
i4 ℓ = 1:
̂ 2.1 − 0.4. = 1.6.
For folded aliases the phase sign must be reversed. Thus
ℎ5 8W3; [ \]^_. `a b + c. da 8 ℎ5 rstuvu 3;83 A8ℎ <ℎ35 8W +ℎ3W5=.
BS Electronics, GPGC Charsadda
Page 7 of 11
Example Calculation 2: Demonstrating Phase Reversal
Problem: Show that j₁b = [ yszc. la b − c. da {bu j₂b = [ ysz}. `a b + c. da are aliases.
Solution:
Apply the folded alias formula with ℓ = 5 8+5 2. R 5 = 10.:
₂ = 7 +9.6. + 0.2. = 7 +10. − 0.4. + 0.2.
?8+5 10. = 2. R 5 8 3 @7;8<;5 $ 2., A5 75 +V − 2.T = +V
₂ = 7 +−0.4. + 0.2. = [ yszc. la b − c. da 8+5 +85 8 55
Thus, ₂ = ₁. Note the sign of the phase changed from −0.2. + 0.2. in the process.
The Principal Alias
Although a sampled signal corresponds to an infinite number of frequencies, one is considered the primary
identifier. The Principal Alias is the unique alias frequency that lies within the range:
−. < ̂ ≤ .
When a D-to-C converter reconstructs a signal, it always reconstructs the principal alias (the lowest possible
frequency).
Spectrum of a Discrete-Time Signal
Because of aliasing, the spectrum of a discrete-time signal is periodic with period 2π.
A single sinusoid = +̂₀ + does not just have a line at ̂₀; it has lines at all aliases.
Constructing the Discrete-Time Spectrum
Rule: To plot the spectrum of a sampled signal:
1. Locate the primary frequency ±̂₀.
2. Replicate these lines by adding integer multiples of 2. 8. 5. , ℎ8$ $ 2., 4., −2., 5+. .
Figure 4-5: Spectrum with Principal Alias and Aliases
Figure Description: The spectrum plot shows the principal alias at ̂ = 0.4. and its aliases at 2.4., −1.6., 4.4.,
etc. The dashed box from −. + . highlights the region of the principal alias.
BS Electronics, GPGC Charsadda
Page 8 of 11
For figure 4-5 Complex Amplitude of the Normalized Frequency ̂ Component are:
Principal Alias (Positive) 0.4. /2 5
Principal Alias (Negative) −0.4. /2 5
;83 1: 0.4. + 2. = 2.4. /2 5
;83 2 − 0.4. + 2. = 1.6. /2 5
. . . 3= $4 3;; 85W54 ℓ ̂₀ + 2.ℓ /2 5 ±
The Shannon Sampling Theorem
Statement of the Shannon Sampling Theorem:
A continuous-time signal whose spectrum contains no frequencies higher than $CB (a bandlimited signal) can
be exactly reconstructed from its samples = # , provided that the sampling rate $# = 1/# is strictly
greater than twice the maximum frequency.
$# > 2 $CB
$CB is the highest frequency component in the massage signal.
Bandlimited signal is the massage signal confined to a limited range of frequencies. Before sampling the
massage signal is passed through a low pass filter of a known bandwidth to eliminate unwanted higher
frequency components to avoid aliasing.
• If we need to sample a voice massage limited 6 KHz, the massage signal must be passed through a
lowpass filter often referred to Anti Aliasing filter, to remove frequency components above 6 KHz
to avoid aliasing.
The Nyquist Rate
The minimum theoretical sampling rate is called the Nyquist Rate:
$# = 2 $CB
To avoid aliasing, we must sample above the Nyquist rate.
Practical Example: Audio Compact Disc (CD)
Maximum audible frequency ($CB ) 20 kHz
Nyquist Rate (2 $CB ) 40 kHz
CD Sampling Rate ($# ) 44.1 kHz
Over-sampling Margin 4.1 kHz (approx. 10%)
Spectrum View of Sampling (Over-Sampling and Under-Sampling)
When a continuous-time sinusoid = +2. $₀ + is sampled at rate $# , its analog
frequency f₀ maps to the normalized frequency:
ω̂₀ = 2π (f₀ / $# )
BS Electronics, GPGC Charsadda
Page 9 of 11
We will now analyze three distinct cases based on the relationship between f₀ and $# .
Case 1: Over-Sampling (rz > 2 f₀)
· Condition: The sampling rate is greater than the Nyquist rate.
· Result: No aliasing occurs. The principal alias is exactly the original frequency.
· Reconstruction: The D-to-C converter perfectly reconstructs the original signal y(t) = x(t).
Example Calculation:
<7: = +2. 100 + ./3 $₀ = 100 IJ
?3@<;8W 35: $# = 500 IJ
4@3;8J5= i45675+:: ̂₀ = 2. 100 / 500 = 0.4. 43=.
?8+5 |0.4.| < ., ℎ5 +=88 8 38$85=.
5+47+5= i45675+:: r = 0.4. / 2. R 500 = 100 IJ.
BS Electronics, GPGC Charsadda
Page 10 of 11
Case 2: Under-Sampling / Aliasing (rz < 2 f₀)
Condition: The sampling rate is below the Nyquist rate.
Result: Aliasing occurs. The reconstructed frequency will be a lower alias.
Reconstruction: The D-to-C converter outputs a signal with the principal alias frequency.
Formula for Alias Frequency:
rBEB# = |$₀ − @ $# |
where m is the integer that brings the result into the range [0, $# /2].
Example Calculation:
<7: = +2. 100 $₀ = 100 IJ
?3@<;8W 35: $# = 80 IJ
4@3;8J5= i45675+:: ̂₀ = 2. 100 / 80 = d. a 43=.
ℎ8 ;85 78=5 −., .. ?7143+ 2. @ = 1: 2.5. − 2. = 0.5..
48+8<3; ;83: ̂ = 0.5..
5+47+5= i45675+:: $ = 0.5. / 2. R 80 = 20 IJ 85= $ 100 IJ
+;78: ?3@<;8W 3 100 IJ 8W3; 3 80 IJ <4=7+5 3 20 IJ 5.
BS Electronics, GPGC Charsadda
Page 11 of 11
Case 3: Folding (f₀ < rz < 2 f₀)
· Condition: The sampling rate is between f₀ and 2 f₀.
· Result: Aliasing occurs with phase reversal. The negative frequency component folds over and becomes
the positive principal alias.
Example Calculation:
<7: = +2. 100 + ./3 $₀ = 100 IJ
?3@<;8W 35: $# = 125 IJ
4@3;8J5= i45675+:: ̂₀ = 2. 100 / 125 = 1.6. 43=.
5W385 i45675+:: − 1.6.. == 2. @ = 1 : − 1.6. + 2. = 0.4..
48+8<3; ;83: ̂ = 0.4. $4@ ℎ5 5W385 $45675+: +@<5.
5+47+5= i45675+:: $ = 0.4. / 2. R 125 = 25 IJ.
ℎ35 ℎ3W5: ℎ5 <ℎ35 $ ℎ5 7<7 8W3; 8 − ./3 ℎ5 5W385 $ ℎ5 8<7 <ℎ35.
BS Electronics, GPGC Charsadda