2 Discrete Signals
2 Discrete Signals
2. Discrete Signals
ICE3018: Digital Signal Processing & Design
2
2.1 Discrete Signals
Definition:
A sampled or discrete signal x[n] is just an ordered
sequence of values corresponding to the integer index n.
20
10
-10
-20
-30
N0 N0
4
2.1 Discrete Signals
Signal Measures
Summation (equivalent to integration for continuous signal)
∞ ∞
Discrete sum S D = ∑ x[n],
n = −∞
Absolute sum S A = ∑ x[n]
n = −∞
n
Cummulative sum SC [n] = ∑ x[k ] (also Running sum)
k = −∞
x[n]is absolutely summable if its SA is finite.
Instantaneous power p[n] = x[n]
2
E= ∑ p[m] = ∑ x[m]
m = −∞ m = −∞
1 N −1
∑ x[m]
2
Average power : P =
N m =0
1 L
∑ x[m]
2
Average power : P = lim
L →∞ 2 L + 1
m=− L
6
2.2 Operations on Discrete Signals
Time shift
Delayed when α > 0
y[n] = x[n − α ]
Advanced when α < 0
Letting m = n − α , n = m + α . Hence, y[m + α ] = x[m]
Shift-and-reversal
x[n] → [delay (shift right) by α ] → x[n − α ] → [reversal] → x[− n − α ]
x[n] → [reversal] → x[− n] → [advance (shift left) by α ] → x[− (n + α )]
1
7
2.2 Operations on Discrete Signals
Symmetry
Even symmetric xe [n] = xe [− n]
Odd symmetric (Anti-symmetric) xo [n] = − xo [− n]
8
2.2 Operations on Discrete Signals
Decomposition of Arbitrary signal
x[n] = xe [n] + xo [n]
1
where xe [n] = {x(n ) + x(− n )} and xo [n] = 1 {x(n ) − x(− n )}
2 2
Any signal can be expressed as the sum of an even symmetric
part and an odd symmetric part
Even symmetry and odd symmetry are mutually exclusive.
9
2.2 Operations on Discrete Signals
10
2.3 Decimation and Interpolation
Decimation
Reducing the signal length by discarding signal samples
Decimation by 2: y[n] = x[2n] = {x[0], x[2], x[4], …}
Length of y[n] is reduced by a factor of 2
Decimation by N: y[n] = x[Nn] = {x[0], x[N], x[2N], x[3N], …}
Length of y[n] is reduced by a factor of N.
11
2.3 Decimation and Interpolation
Interpolation
Increasing the signal length by inserting signal samples
Interpolation by 2: y[n] = x[n/2] = {x[0], x[1/2], x[2/2], x[3/2], …}
Length of y[n] is increased by a factor of 2
Interpolation by N: y[n] = x[n/N]
Need to insert (N-1) samples between x[n] and x[n+1]
12
2.3 Decimation and Interpolation
Are decimation and interpolation inverse operations?
13
Application of Decimation and Interpolation
M
Fractional Delays y[n] = x n − where M, N are integers.
N
M Nn − M
Generating y[n] = x n − = x from x[n]
N N
n n − M
x[n] ⇒ [Interpolation by N ] ⇒ x ↑ ⇒ [Delay by M ] ⇒ x
N N
Nn − M
⇒ [Decimation by N ] ⇒ x = y[n]
N
14
2.4 Standard Discrete Signals
Unit impulse (or Unit sample) Dirac delta function
0 , n ≠ 0
δ [n] =
Unit step 1, n = 0
0 , n < 0
u[n] =
1, n ≥ 0
Unit ramp
0 , n < 0
r [n] = nu[n] =
n , n ≥ 0
15
2.4 Standard Discrete Signals
Properties of Discrete Impulse
Product of x[n] with δ[n-k]: x[n]δ [n − k ] = x[k ]δ [n − k ]
Sifting property
∞
∑ x[n]δ [n − k ] = x[k ]
n = −∞
Impulse with the
magnitude x[k]
x[n] δ[n-3]
1
1
2
x =
k=3 k=3
16
2.4 Standard Discrete Signals
Signal Representation by Impulses
Expressing x[n] as a sum of shifted impulses δ[n-k]
x[n]
∞
x[n] = ∑ x[k ]δ [n − k ]
k = −∞
∞
x[-1]×δ[n+1]
Ex: 𝑢𝑢 𝑛𝑛 = � 𝛿𝛿 𝑛𝑛 − 𝑘𝑘 and
𝑘𝑘=0
x[0]×δ[n]
𝑟𝑟 𝑛𝑛 = ∑∞
𝑘𝑘=0 𝑘𝑘 ⋅ 𝛿𝛿 𝑛𝑛 − 𝑘𝑘
x[1]×δ[n-1]
As a cumulative sum (or running sum)
n n −1
u[n] = ∑ δ [k ] and r[n] = ∑ u[k ]
k = −∞ k = −∞
17
2.4 Standard Discrete Signals
Discrete Pulse Signals
n 1, n≤N
• Discrete rectangular pulse : rect =
2 N 0 , elsewhere
n
n
• Discrete triangular pulse : tri = 1 − N , n≤N
N 0, elsewhere
Both signal has (2N+1) samples.
18
2.4 Standard Discrete Signals
19
Transform of Sinc function
Time Freq
Transformation
domain Domain
Box-car Sinc
Fourier Transform
Sinc Inverse Fourier Box-car
Transform
F.T.
20
Continuous Sinc Function
Forward FT
21
Continuous Sinc Function
Transfer function of Ideal
Bandlimited signal: Low-pass Filter
Inverse FT
22
2.4 Standard Discrete Signals
Discrete Exponentials
Real-valued exponential signal
x[n] = a nu[n] - decaying for a < 1
x[n] = (a + jb ) u[n] = re
n
( ) u[n]
jω o n
r : attenuation when r < 1
= r n e jnωo u[n] = r n [cos (nωo ) + jsin(nωo )]u[n] ωo : frequency
Sinusoidal signal
𝐴𝐴: amplitude
𝑥𝑥 𝑛𝑛 = Acos 𝜔𝜔o 𝑛𝑛 + 𝜃𝜃 �𝜔𝜔o : frequency
𝜃𝜃: phase
23
2.5 Discrete-time Harmonics and Sinusoids
𝑓𝑓
Digital: 𝑛𝑛 ⋅ → 𝐹𝐹 = 𝑓𝑓ts = cycles/sample → Ω = 2𝜋𝜋𝜋𝜋 rad/sample
𝑆𝑆
24
Example: Digital frequency
𝑓𝑓 = 100 Hz
8 samples/cycle
𝑡𝑡𝑠𝑠 =?
𝐹𝐹 = 𝑓𝑓𝑡𝑡𝑠𝑠 =?
𝑓𝑓 = 100 Hz
1 sample/cycle
𝑡𝑡𝑠𝑠 =?
𝐹𝐹 = 𝑓𝑓𝑡𝑡𝑠𝑠 =?
25
Analog vs. Digital Signals
t
0 ts 2ts 3ts
26
Sampling – How fast?
Consider a pure sine wave of frequency 100Hz:
𝑥𝑥 𝑡𝑡 = A𝑠𝑠𝑠𝑠𝑠𝑠 2π𝑓𝑓𝑓𝑓 + 𝜃𝜃
27
Sampling – Too fast ?
(1) Sampling at fs = 800Hz, i.e., 8 samples per period:
“Reasonable”
“Redundant”
28
Sampling – Too slow?
(3) Sampling at fs = 100Hz, i.e., 1 sample per period:
Signal
interpreted as
DC
Most signal
features are
missed
29
2.6 The Sampling Theorem
Sampling rate or sampling frequency, fs (Hz) : the speed
at which an ADC generates the samples.
30
Signal Frequency Range Terminology
Baseband signal:
the lowest signal frequency present is around 0 Hz :
fb : bandwidth
Bandlimited signal:
for all frequencies in the signal fl < f < fh :
31
Illustration of Sampling
Time domain Frequency domain
𝑥𝑥(𝑡𝑡) 𝑋𝑋(𝑓𝑓)
𝑡𝑡 𝑓𝑓
0 −𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 0 𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚
𝑠𝑠(𝑡𝑡) 𝑆𝑆(𝑓𝑓)
𝑡𝑡𝑠𝑠 1/𝑡𝑡𝑠𝑠 = 𝑓𝑓𝑠𝑠
⋯ ⋯ ⋯ ⋯
𝑡𝑡 𝑓𝑓
0 0
⋯ ⋯ ⋯ ⋯
𝑡𝑡 𝑓𝑓
0 −𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 0 𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 32
Illustration of Sampling
𝑋𝑋 𝑡𝑡 ∗ 𝑆𝑆 𝑓𝑓
⋯ ⋯
𝑓𝑓
−1/𝑡𝑡𝑠𝑠 = −𝑓𝑓𝑠𝑠 −𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 0 𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚 1/𝑡𝑡𝑠𝑠 = 𝑓𝑓𝑠𝑠
𝑓𝑓𝑠𝑠 − 𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚
Appropriate sampling frequency ?
f s ≥ 2 × f max
where fmax is the maximum frequency component of a
baseband, bandlimited signal.
fmax = 100Hz
36
Nyquist Sampling Rate
If we require to sample the signal and retain all
information, then the sampling rate, fs must be chosen as:
fs > fN = 2fb
37
Aliasing
What if fs < 2fb ?
𝑋𝑋 𝑡𝑡 ∗ 𝑆𝑆 𝑓𝑓
⋯ ⋯
𝑓𝑓
−𝑓𝑓𝑠𝑠 − 𝑓𝑓𝑏𝑏 −𝑓𝑓𝑠𝑠 −𝑓𝑓𝑠𝑠 + 𝑓𝑓𝑏𝑏 −𝑓𝑓𝑏𝑏 0 𝑓𝑓𝑏𝑏 𝑓𝑓𝑠𝑠 − 𝑓𝑓𝑏𝑏 𝑓𝑓𝑠𝑠 𝑓𝑓𝑠𝑠 + 𝑓𝑓𝑏𝑏
⋯ ⋯
𝑓𝑓
−𝑓𝑓𝑠𝑠 −𝑓𝑓𝑏𝑏 0 𝑓𝑓𝑏𝑏 𝑓𝑓𝑠𝑠
38
Aliasing
When a (baseband) signal is sampled at a frequency
below the Nyquist rate, then we “lose” the signal
frequency information and aliasing is said to have
occurred.
fb = 100Hz
fs = 80Hz
fa = 20Hz
fb = 9000Hz
fs = 10000Hz
fa = 1000Hz
39
Aliased Spectra
40
Quantization
48
Anti-aliasing Filter
Prior to ADC, all frequencies above fs/2 must be blocked
or they will be interpreted as lower frequencies, i.e.,
aliasing:
Frequencies of the music and speech above 4kHz alias down to the
0-4kHz baseband and manifest as (correlated) noise.
50
Reconstruction Filter
Analog reconstruction filter at the output of a DAC
removes the baseband image high frequencies present
in the signal:
Staircase output
Analog voltage
from DAC
51
Real World Sampling Frequency
To sample a real-world signal, an appropriate sampling rate is
chosen according to quantitative and qualitative constraints.
Quantitative constraints will be specified by a domain expert, usually
in terms of the Nyquist rate.
Qualitative constraints usually refer to acceptable quality.
When digital signal sampled at fs is reconstructed, no frequency
components above fs /2 exist.
CD Audio: 44,100Hz
Professional Digital Audio: 48,000Hz
Teleconferencing: 16,000Hz
Telephone Speech: 8,000Hz
Biomedical: 1,000Hz
Control Systems: 100Hz
52
Real World Bit Rates
To sample a real-world signal, a suitable data wordlength, is also
chosen according to quantitative and qualitative constraints.
Quantitative constraints will be specified by a domain expert, usually
in terms of required SNR.
Qualitative constraints usually refer to acceptable quality.
When digital signal is sampled, quantized, and then reproduced, the
signal will have quantization noise present.
CD Audio: 16 bits
Professional Digital Audio: 24 bits
Teleconferencing: 12-16 bits
Telephone Speech: 8-13 bits
Biomedical: 16-24 bits
Control Systems: 4-10 bits
53
Summary of Ch 2.
59