MATLAB(02)
The Discrete-time Fourier
Analysis
Assist. Prof. Amr E. Mohamed
Introduction
 A linear and time-invariant system can be represented using its response
to the unit sample sequence. This response, called the unit impulse
response h(n), allows us to compute the system response to any
arbitrary input x(n) using the linear convolution:
 This convolution representation is based on the fact that any signal can
be represented by a linear combination of scaled and delayed unit
samples.
2
THE DISCRETE-TIME FOURIER TRANSFORM (DTFT)
 If x(n) is absolutely summable, that is, −∞
∞
𝑥 𝑛 < ∞, then its discrete-
time Fourier transform is given by
𝑋 𝑒 𝑗𝜔
≜ ℱ 𝑥 𝑛 =
𝑛=−∞
∞
𝑥 𝑛 𝑒−𝑗𝜔𝑛
 The inverse discrete-time Fourier transform (IDTFT) of X(e jω ) is given
by
𝑥 𝑛 ≜ ℱ−1 𝑒 𝑗𝜔 =
1
2𝜋 −𝜋
𝜋
𝑋 𝑒 𝑗𝜔 𝑒 𝑗𝜔𝑛 𝑑𝜔
 The operator ℱ . transforms a discrete signal x(n) into a complex-
valued continuous function 𝑋 𝑒𝑗𝜔 of real variable 𝜔, called a digital
frequency, which is measured in radians/sample.
3
EXAMPLE #1
 Determine the discrete-time Fourier transform of 𝑥 𝑛 = 0.5 𝑛
𝑢(𝑛).
 Solution:
 The sequence x(n) is absolutely summable; therefore its discrete-time
Fourier transform exists.
𝑋 𝑒 𝑗𝜔 =
𝑛=−∞
∞
𝑥 𝑛 𝑒−𝑗𝜔𝑛 =
𝑛=0
∞
0.5 𝑛 𝑒−𝑗𝜔𝑛
𝑋 𝑒 𝑗𝜔 =
𝑛=0
∞
0.5𝑒−𝑗𝜔 𝑛
=
1
1 − 0.5𝑒−𝑗𝜔
=
𝑒 𝑗𝜔
𝑒 𝑗𝜔 − 0.5
4
EXAMPLE #2
 Determine the discrete-time Fourier transform of the following finite-
duration sequence:
𝑥(𝑛) = { 1, 2, 3, 4, 5 }
 Solution:
𝑋 𝑒 𝑗𝜔 =
𝑛=−∞
∞
𝑥 𝑛 𝑒−𝑗𝜔𝑛 = 𝑒 𝑗𝜔 + 2 + 3𝑒−𝑗𝜔 + 4𝑒−2𝑗𝜔+ . . +5𝑒−5𝑗𝜔
5
↑
DTFT Spectrum Properties
1. Periodicity:
 The discrete-time Fourier transform 𝑋 𝑒 𝑗𝜔
is periodic in ω with period 2π.
𝑋 𝑒 𝑗𝜔 = 𝑋 𝑒 𝑗[𝜔+2𝜋
 Implication: We need only one period of 𝑋 𝑒 𝑗𝜔
(i.e., 𝜔 ∈ [0, 2𝜋], 𝑜𝑟 [− 𝜋, 𝜋],
etc.) for analysis and not the whole domain −∞ < 𝜔 < ∞ .
 2. Symmetry:
 For real-valued x(n), X(e jω ) is conjugate symmetric.
𝑅𝑒 𝑋 𝑒−𝑗𝜔 = 𝑅𝑒 𝑋 𝑒 𝑗𝜔 (𝑒𝑣𝑒𝑛 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦)
𝐼𝑚 𝑋 𝑒−𝑗𝜔
= −𝐼𝑚 𝑋 𝑒 𝑗𝜔
(𝑂𝑑𝑑 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦)
𝑋 𝑒−𝑗𝜔
= 𝑋 𝑒 𝑗𝜔
(𝑒𝑣𝑒𝑛 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦)
∠𝑋 𝑒−𝑗𝜔
= −∠𝑋 𝑒 𝑗𝜔
(𝑂𝑑𝑑 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦)
 Implication: To plot 𝑋 𝑒 𝑗𝜔 , we now need to consider only a half period of
𝑋 𝑒 𝑗𝜔
. Generally, in practice this period is chosen to be 𝜔 ∈ 0, 𝜋 .
6
DTFT - MATLAB Implementation
 If 𝑥(𝑛) is of infinite duration, then MATLAB cannot be used directly to
compute 𝑋 𝑒𝑗𝜔
from 𝑥(𝑛). However, we can use it to evaluate the
expression 𝑋 𝑒𝑗𝜔 over [0, 𝜋] frequencies and then plot its magnitude
and angle (or real and imaginary parts).
 EXAMPLE #3:
 Determine the discrete-time Fourier transform of 𝑥 𝑛 = 0.5 𝑛
𝑢(𝑛) .
Evaluate 𝑋 𝑒 𝑗𝜔 at 501 equispaced points between [0, π] and plot its
magnitude, angle, real, and imaginary parts.
7
EXAMPLE #3- Solution
 The discrete-time Fourier transform is.
𝑋 𝑒 𝑗𝜔 =
𝑛=−∞
∞
𝑥 𝑛 𝑒−𝑗𝜔𝑛 =
𝑛=0
∞
0.5 𝑛 𝑒−𝑗𝜔𝑛
𝑋 𝑒 𝑗𝜔 =
𝑛=0
∞
0.5𝑒−𝑗𝜔 𝑛
=
1
1 − 0.5𝑒−𝑗𝜔
=
𝑒 𝑗𝜔
𝑒 𝑗𝜔 − 0.5
 MATLAB script:
8
EXAMPLE #3- Solution (Cont.)
9
DTFT – Matrix Form
 If x(n) is of finite duration, then MATLAB can be used to compute 𝑋 𝑒 𝑗𝜔
numerically at any frequency ω.
 we evaluate X(e jω ) at equispaced frequencies between [0, π],
 then DTFT can be implemented as a matrix-vector multiplication operation.
 To understand this, let us assume that the sequence 𝑥(𝑛) has 𝑁 samples
between 𝑛1 ≤ 𝑛 ≤ 𝑛 𝑁 (i.e., not necessarily between [0, 𝑁 − 1]) and
that we want to evaluate 𝑋 𝑒 𝑗𝜔
at
𝜔 𝐾 ≜
𝜋
𝑀
𝑘, 𝑘 = 0, 1, . . . , 𝑀
 which are (M + 1) equispaced frequencies between [0, π]. Then (3.1)
can be written as
𝑋 𝑒 𝑗𝜔 𝐾 =
ℓ=1
𝑁
𝑥 𝑛ℓ 𝑒
−𝑗
𝜋
𝑀 𝐾𝑛ℓ
, 𝑘 = 0, 1, . . . , 𝑀
10
DTFT – Matrix Form (Cont.)
 When {𝑥 𝑛ℓ } and {𝑋 𝑒𝑗𝜔 𝐾 } are arranged as 𝑐𝑜𝑙𝑢𝑚𝑛 vectors 𝑥 and 𝑋, respectively, we
have
𝑿 = 𝑾𝒙
 where 𝑾 is an (𝑀 + 1) × 𝑁 matrix given by
𝑾 ≜ 𝑒
−𝑗
𝜋
𝑀 𝐾𝑛ℓ
; 𝑛1 ≤ 𝑛 ≤ 𝑛 𝑁, 𝐾 = 0,1, … , 𝑀
 In addition, if we arrange { k } and { n } as row vectors k and n respectively, then
𝑾 = exp(−𝑗
𝜋
𝑀
𝑲 𝑇 𝒏)
 In MATLAB we represent sequences and indices as row vectors; therefore taking the
transpose of 𝑿 = 𝑾𝒙, we obtain
𝑿 𝑇 = 𝒙 𝑇 exp(−𝑗
𝜋
𝑀
𝑲 𝑇 𝒏)
 Note that 𝐧 𝑇
𝐊 is an 𝑁 × (𝑀 + 1) matrix. Now we can be implemented in MATLAB as
follows.
11
Example #4
 Numerically compute the discrete-time Fourier transform of the sequence
𝑥(𝑛) given in Example #2 at 501 equispaced frequencies between [0, 𝜋].
 Solution:
 MATLAB script:
12
Example #5
 Let 𝑥(𝑛) = (0.9 exp(𝑗𝜋/3)) 𝑛 , 0 ≤ n ≤ 10. Determine 𝑋 𝑒 𝑗𝜔 and
investigate its periodicity.
 Solution:
 MATLAB script:
13
Example #5 – Solution (Cont.)
 However, we will evaluate and plot it at 401 frequencies over two periods
between [ − 2π, 2π] to observe its periodicity.
14
Some common DTFT pairs
15
THE PROPERTIES OF THE DTFT
 DSP Lecture Notes No. 5
16
The Frequency Domain Representation Of LTI Systems
 the Fourier transform representation is the most useful signal
representation for LTI systems.
 Response To A Complex Exponential 𝑒 𝑗𝜔0 𝑛
 RESPONSE TO SINUSOIDAL SEQUENCES
17
RESPONSE TO ARBITRARY SEQUENCES
 Finally, we can be generalized to arbitrary absolutely summable
sequences. Let 𝑋 𝑒 𝑗𝜔 = ℱ[𝑥(𝑛)] and Y 𝑒 𝑗𝜔 = ℱ[𝑦(𝑛)]; then using the
convolution property, we have
Y 𝑒 𝑗𝜔
= H 𝑒 𝑗𝜔
X 𝑒 𝑗𝜔
 Therefore an LTI system can be represented in the frequency domain by
18
Example #13
 Determine the frequency response H 𝑒 𝑗𝜔 of a system characterized by
h(𝑛) = (0.9) 𝑛 𝑢(𝑛). Plot the magnitude and the phase responses.
 Solution:
𝐻 𝑒 𝑗𝜔 =
𝑛=−∞
∞
ℎ 𝑛 𝑒−𝑗𝜔𝑛 =
𝑛=0
∞
0.9 𝑛 𝑒−𝑗𝜔𝑛 =
1
1 − 0.9𝑒−𝑗𝜔
 Hence, the magnitude and the phase are
19
Example #13 – Solution (Cont.)
 MATLAB Script:
20
Example #14
 Let an input to the system in Example #13 be x n = 0.1𝑢(𝑛). Determine
the steady-state response y ss (n).
 Solution:
 Since the input is not absolutely summable, the discrete-time Fourier
transform is not particularly useful in computing the complete response.
However, it can be used to compute the steady-state response. In the steady
state (i.e., 𝑛 → ∞ ), the input is a constant sequence (or a sinusoid with
𝜔0 = 𝜃0 = 0). Then the output is
𝑦𝑠𝑠(𝑛) = 0.1 × H 𝑒 𝑗0
= 0.1 × 10 = 1
 where the gain of the system at ω = 0 (also called the DC gain) is H 𝑒𝑗0 = 10.
21
Frequency Response Function From Difference Equations
 When an LTI system is represented by the difference equation
𝑦 𝑛 +
ℓ=1
𝑁
𝑎ℓ 𝑦 𝑛 − ℓ =
𝑚=0
𝑀
𝑏 𝑚 𝑥 𝑛 − 𝑚
 then to evaluate its frequency response, we would need the impulse
response ℎ(𝑛). However, we can easily obtain H 𝑒 𝑗𝜔
. We know that
when x(n) = 𝑒 𝑗𝜔𝑛, then y(n) must be H 𝑒 𝑗𝜔 𝑒 𝑗𝜔n. Then we have
22
EXAMPLE #15
 An LTI system is specified by the difference equation
𝑦(𝑛) = 0.8𝑦(𝑛 − 1) + 𝑥(𝑛)
a. Determine H 𝑒 𝑗𝜔 .
b. Calculate and plot the steady-state response 𝑦𝑠𝑠(𝑛) to 𝑥(𝑛) = cos(0.05𝜋𝑛)𝑢(𝑛)
23
EXAMPLE #15 - Solution
 Rewrite the difference equation as 𝑦(𝑛) − 0.8𝑦(𝑛 − 1) = 𝑥(𝑛).
 a. The H 𝑒 𝑗𝜔
is
𝐻 𝑒 𝑗𝜔 =
1
1 − 0.8𝑒−𝑗𝜔
 b. In the steady state the input is 𝑥(𝑛) = cos(0.05𝜋𝑛) with frequency 𝜔0
= 0.05𝜋 and 𝜃0 = 0◦. The response of the system is
𝐻 𝑒 𝑗0.05𝜋 =
1
1 − 0.8𝑒−𝑗0.05𝜋
= 4.0928𝑒− 𝑗0.5377
 Therefore
𝑦𝑠𝑠(𝑛) = 4.0928 cos(0.05𝜋𝑛 − 0.5377) = 4.0928 cos[0.05𝜋(𝑛 − 3.42)]
 This means that at the output the sinusoid is scaled by 4.0928 and shifted by
3.42 samples. This can be verified using MATLAB.
24
EXAMPLE #15 – Solution (Cont.)
 The MATLAB Script
25
EXAMPLE #15 – Solution (Cont.)
 we note that the
amplitude of y ss (n) is
approximately 4. To
determine the shift in the
output sinusoid, we can
compare zero crossings of
the input and the output.
26
EXAMPLE #16
 A 3rd -order lowpass filter is described by the difference equation
𝑦(𝑛) = 0.0181𝑥(𝑛) + 0.0543𝑥(𝑛 − 1) + 0.0543𝑥(𝑛 − 2) + 0.0181𝑥(𝑛 − 3)
+1.76𝑦(𝑛 − 1) − 1.1829𝑦(𝑛 − 2) + 0.2781𝑦(𝑛 − 3)
 Plot the magnitude and the phase response of this filter, and verify that it is a
lowpass filter.
27
EXAMPLE #16 – Solution (Cont.)
 We will implement this procedure in MATLAB and then plot the filter
responses.
28
EXAMPLE #16 – Solution (Cont.)
 From the plots in the Figure we see that the filter is indeed a lowpass
filter.
29
SAMPLING AND RECONSTRUCTION
OF ANALOG SIGNALS
30
Sampling And Reconstruction Of Analog Signals
 In many applications—for example, in digital communications—real-
world analog signals are converted into discrete signals using sampling
and quantization operations (collectively called analog-to-digital
conversion, or ADC). These discrete signals are processed by digital
signal processors, and the processed signals are converted into analog
signals using a reconstruction operation (called digital-to-analog
conversion or DAC).
 Using Fourier analysis, we can describe the sampling operation from the
frequency-domain viewpoint, analyze its effects, and then address the
reconstruction operation. We will also assume that the number of
quantization levels is sufficiently large that the effect of quantization on
discrete signals is negligible.
 We will study the effects of quantization later.
31
Sampling And Reconstruction Of Analog Signals
 DSP Lecture Notes No. 2
32
Review
 Band-limited Signal:
 A signal is band-limited if there exists a finite radian frequency Ω0such that
𝑋 𝑎(𝑗Ω) is zero for |Ω| > Ω0. The frequency 𝐹0 = Ω0/2𝜋 is called the signal
bandwidth in Hz.
 Sampling Principle:
 A band-limited signal 𝑥 𝑎(𝑡) with bandwidth 𝐹0 can be reconstructed from its
sample values 𝑥(𝑛) = 𝑥 𝑎(𝑛𝑇𝑠) if the sampling frequency 𝐹𝑠 = 1/𝑇𝑠 is greater
than twice the bandwidth 𝐹0 of 𝑥 𝑎(𝑡).
𝐹𝑠 > 2𝐹0
 Otherwise aliasing would result in x(n). The sampling rate of 2𝐹0for an
analog band-limited signal is called the Nyquist rate.
33
Review
34
EXAMPLE #19
 Let 𝑥 𝑎 𝑡 = 𝑒−1000 𝑡
.
a. Determine and plot its Fourier transform.
b. Sample 𝑥 𝑎(𝑡) at 𝐹𝑠 = 5000 𝑠𝑎𝑚𝑝𝑙𝑒/sec to obtain 𝑥1(𝑛). Determine and
plot 𝑋1 𝑒 𝑗𝜔 .
c. Sample 𝑥 𝑎(𝑡) at 𝐹𝑠 = 1000 𝑠𝑎𝑚𝑝𝑙𝑒/sec to obtain 𝑥2(𝑛). Determine and
plot 𝑋2 𝑒 𝑗𝜔 .
35
EXAMPLE #19 - Solution
a. The Fourier transform is
 which is a real-valued function since 𝑥 𝑎 𝑡 is a real and even signal. To evaluate
𝑋 𝑎(𝑗Ω) numerically, we have to first approximate 𝑥 𝑎 𝑡 by a finite-duration grid
sequence 𝑥 𝐺 𝑚 .
 Using the approximation 𝑒−5 ≈ 0, we note that 𝑥 𝑎 𝑡 can be approximated by a
finite-duration signal over − 0.005 ≤ 𝑡 ≤ 0.005 (or equivalently, over [− 5, 5]
msec).
 Then, 𝑋 𝑎(𝑗Ω) ≈ 0 for Ω ≥ 2𝜋(2000). Hence choosing
36
EXAMPLE #19 – Solution (Cont.)
37
EXAMPLE #19 – Solution (Cont.)
b. Since the bandwidth of 𝑥 𝑎(𝑡) is 2𝐾𝐻𝑧, the Nyquist rate is 4000 𝑠𝑎𝑚𝑝𝑙𝑒/sec,
which is less than the given 𝐹 𝑠. Therefore aliasing will be (almost) nonexistent.
 MATLAB script:
38
EXAMPLE #19 – Solution (Cont.)
39
EXAMPLE #19 – Solution (Cont.)
c. Here 𝐹𝑠 = 1000 < 4000.
Hence there will be a
considerable amount of
aliasing. This is evident
from the shown Figure, in
which the shape of
𝑋2 𝑒 𝑗𝜔
is different from
that of 𝑋 𝑎(𝑗Ω) and can be
seen to be a result of
adding overlapping
replicas of 𝑋 𝑎(𝑗Ω).
40
Reconstruction
 From the sampling theorem and the preceding examples, it is clear that
if we sample band-limited 𝑥 𝑎(𝑡) above its Nyquist rate, then we can
reconstruct 𝑥 𝑎(𝑡) from its samples 𝑥(𝑛). This reconstruction can be
thought of as a 2-step process:
1) First the samples are converted into a weighted impulse train.
2) Then the impulse train is filtered through an ideal analog lowpass filter
band-limited to the [ −𝐹𝑠/2, 𝐹𝑠/2] band.
41
Reconstruction
 This two-step procedure can be described mathematically using an
interpolating formula
 where 𝑠𝑖𝑛𝑐(𝑥) =
sin 𝜋𝑥
𝜋𝑥
is an interpolating function. The physical
interpretation of the above reconstruction formula is given in the shown
Figure, from which we observe that this ideal interpolation is not practically
feasible because the entire system is noncausal and hence not realizable.
42
43
Practical D/A converters
 In practice we need a different approach than reconstruction formula.
The two-step procedure is still feasible, but now we replace the ideal
lowpass filter by a practical analog lowpass filter.
 Another interpretation of reconstruction formula is that it is an infinite-
order interpolation. We want finite-order (and in fact low-order)
interpolations. There are several approaches to do this.
1) Zero-order-hold (ZOH) interpolation
2) 1st-order-hold (FOH) interpolation
3) Cubic spline interpolation
44
Zero-order-hold (ZOH) interpolation
 In this interpolation a given sample value is held for the sample interval until
the next sample is received.
 which can be obtained by filtering the impulse train through an interpolating
filter of the form
 which is a rectangular pulse. The resulting signal is a piecewise-constant
(staircase) waveform which requires an appropriately designed analog
postfilter for accurate waveform reconstruction.
45
1st -order-hold (FOH) interpolation
 In this case the adjacent samples are joined by straight lines. This can
be obtained by filtering the impulse train through
 Once again, an appropriately designed analog postfilter is required for
accurate reconstruction. These interpolations can be extended to
higher orders.
46
Cubic spline interpolation
 This approach uses spline interpolants for a smoother, but not
necessarily more accurate, estimate of the analog signals between
samples. Hence this interpolation does not require an analog postfilter.
The smoother reconstruction is obtained by using a set of piecewise
continuous third-order polynomials called 𝑐𝑢𝑏𝑖𝑐 𝑠𝑝𝑙𝑖𝑛𝑒𝑠, given by
 where {𝛼𝑖(𝑛), 0 ≤ 𝑖 ≤ 3 } are the polynomial coefficients, which are
determined by using least-squares analysis on the sample values.
(Strictly speaking, this is not a causal operation but is a convenient one
in MATLAB.)
47
EXAMPLE #23
 Plot the reconstructed signal from the samples 𝑥 𝑎(𝑡) in Example #19
using the ZOH and the FOH interpolations. Comment on the plots.
 Solution:
48
EXAMPLE #23 - Solution
 The plots are shown in the
Figure, from which we observe
that the ZOH reconstruction is a
crude one and that the further
processing of analog signal is
necessary.
 The FOH reconstruction appears
to be a good one, but a careful
observation near t = 0 reveals
that the peak of the signal is not
correctly reproduced.
 In general, if the sampling
frequency is much higher than
the Nyquist rate, then the FOH
interpolation provides an
acceptable reconstruction.
49
50

More Related Content

PDF
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
PDF
DSP_FOEHU - Lec 10 - FIR Filter Design
PDF
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
PDF
Modern Control - Lec07 - State Space Modeling of LTI Systems
PDF
DSP_2018_FOEHU - Lec 1 - Introduction to Digital Signal Processing
PDF
DSP_2018_FOEHU - Lec 03 - Discrete-Time Signals and Systems
PDF
DSP_2018_FOEHU - Lec 04 - The z-Transform
PDF
Modern Control - Lec 06 - PID Tuning
DSP_FOEHU - MATLAB 04 - The Discrete Fourier Transform (DFT)
DSP_FOEHU - Lec 10 - FIR Filter Design
DSP_2018_FOEHU - Lec 08 - The Discrete Fourier Transform
Modern Control - Lec07 - State Space Modeling of LTI Systems
DSP_2018_FOEHU - Lec 1 - Introduction to Digital Signal Processing
DSP_2018_FOEHU - Lec 03 - Discrete-Time Signals and Systems
DSP_2018_FOEHU - Lec 04 - The z-Transform
Modern Control - Lec 06 - PID Tuning

What's hot (20)

PDF
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
PPTX
Discrete fourier transform
PPT
Fir and iir filter_design
PPTX
Radix-2 DIT FFT
PPTX
Properties of dft
PDF
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
PPTX
5. convolution and correlation of discrete time signals
PDF
Dft and its applications
PPSX
Multirate digital signal processing
PPTX
Discrete Fourier Transform
PDF
Sampling Theorem
PDF
Digital Signal Processing
PDF
Dsp 2018 foehu - lec 10 - multi-rate digital signal processing
PPT
Fourier analysis of signals and systems
PDF
Design of IIR filters
PPT
wave-guides
PDF
PDF
Nyquist criterion for zero ISI
PDF
Digital Signal Processing[ECEG-3171]-Ch1_L04
PDF
Lecture 5: The Convolution Sum
DSP_FOEHU - MATLAB 01 - Discrete Time Signals and Systems
Discrete fourier transform
Fir and iir filter_design
Radix-2 DIT FFT
Properties of dft
DSP_2018_FOEHU - Lec 07 - IIR Filter Design
5. convolution and correlation of discrete time signals
Dft and its applications
Multirate digital signal processing
Discrete Fourier Transform
Sampling Theorem
Digital Signal Processing
Dsp 2018 foehu - lec 10 - multi-rate digital signal processing
Fourier analysis of signals and systems
Design of IIR filters
wave-guides
Nyquist criterion for zero ISI
Digital Signal Processing[ECEG-3171]-Ch1_L04
Lecture 5: The Convolution Sum
Ad

Viewers also liked (20)

PDF
DSP 05 _ Sheet Five
PDF
DSP_FOEHU - MATLAB 03 - The z-Transform
PDF
DSP_FOEHU - Lec 05 - Frequency-Domain Representation of Discrete Time Signals
PDF
DSP_FOEHU - Lec 04 - Discrete-Time Signals and Systems
PDF
DSP_FOEHU - Lec 03 - Sampling of Continuous Time Signals
PDF
SE2_Lec 18_ Coding
PDF
DSP_FOEHU - Lec 07 - Digital Filters
PDF
Dsp foehu lec 00 - digital signal processing
PDF
DSP_FOEHU - Lec 06 - The z-Transform
PDF
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and Systems
PDF
SE2018_Lec 16_ Architectural Design
PDF
Advanced MATLAB Tutorial for Engineers & Scientists
PPTX
Matlab Introduction
PDF
Dsp foehu lec 01 - signals and systems
PDF
Libro de MATLAB
PPTX
Getting started with image processing using Matlab
PDF
Presentation Delivery Skills How-To
PDF
Elaboración de un eco artefacto
PPTX
Heinemann AM1-Z647-25
PPTX
La población española: distribución de la población
DSP 05 _ Sheet Five
DSP_FOEHU - MATLAB 03 - The z-Transform
DSP_FOEHU - Lec 05 - Frequency-Domain Representation of Discrete Time Signals
DSP_FOEHU - Lec 04 - Discrete-Time Signals and Systems
DSP_FOEHU - Lec 03 - Sampling of Continuous Time Signals
SE2_Lec 18_ Coding
DSP_FOEHU - Lec 07 - Digital Filters
Dsp foehu lec 00 - digital signal processing
DSP_FOEHU - Lec 06 - The z-Transform
DSP_FOEHU - Lec 02 - Frequency Domain Analysis of Signals and Systems
SE2018_Lec 16_ Architectural Design
Advanced MATLAB Tutorial for Engineers & Scientists
Matlab Introduction
Dsp foehu lec 01 - signals and systems
Libro de MATLAB
Getting started with image processing using Matlab
Presentation Delivery Skills How-To
Elaboración de un eco artefacto
Heinemann AM1-Z647-25
La población española: distribución de la población
Ad

Similar to DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis (20)

PDF
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
PDF
Digital Signal Processing
PPT
Z Transform And Inverse Z Transform - Signal And Systems
PDF
PDF
lec07_DFT.pdf
PDF
Time Series Analysis
PDF
Lecture 3 Signals & Systems.pdf
PPT
z transforms
PDF
CA1 Signal & System.pdf
DOC
Dsp manual
PDF
PART VII.3 - Quantum Electrodynamics
PDF
Dsp Lab Record
PPTX
Signal Processing Homework Help
PPTX
discrete time signals and systems
PPTX
discrete time signals and systems
PPTX
discrete-timesignalsandsystems1-150402120032-conversion-gate01.pptx
PDF
EC8553 Discrete time signal processing
PDF
Estimating Future Initial Margin with Machine Learning
PDF
RTSP Report
DSP Lab Manual (10ECL57) - VTU Syllabus (KSSEM)
Digital Signal Processing
Z Transform And Inverse Z Transform - Signal And Systems
lec07_DFT.pdf
Time Series Analysis
Lecture 3 Signals & Systems.pdf
z transforms
CA1 Signal & System.pdf
Dsp manual
PART VII.3 - Quantum Electrodynamics
Dsp Lab Record
Signal Processing Homework Help
discrete time signals and systems
discrete time signals and systems
discrete-timesignalsandsystems1-150402120032-conversion-gate01.pptx
EC8553 Discrete time signal processing
Estimating Future Initial Margin with Machine Learning
RTSP Report

More from Amr E. Mohamed (20)

PDF
Dcs lec03 - z-analysis of discrete time control systems
PDF
Dcs lec02 - z-transform
PDF
Dcs lec01 - introduction to discrete-time control systems
PDF
DDSP_2018_FOEHU - Lec 10 - Digital Signal Processing Applications
PDF
DSP_2018_FOEHU - Lec 06 - FIR Filter Design
PDF
SE2018_Lec 17_ Coding
PDF
SE2018_Lec-22_-Continuous-Integration-Tools
PDF
SE2018_Lec 21_ Software Configuration Management (SCM)
PDF
SE2018_Lec 18_ Design Principles and Design Patterns
PDF
Selenium - Introduction
PPTX
SE2018_Lec 20_ Test-Driven Development (TDD)
PDF
SE2018_Lec 19_ Software Testing
PDF
DSP_2018_FOEHU - Lec 05 - Digital Filters
PDF
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
PDF
SE2018_Lec 15_ Software Design
PDF
DSP_2018_FOEHU - Lec 0 - Course Outlines
PDF
SE2018_Lec 14_ Process Modeling and Data Flow Diagram.pptx
PDF
SE18_Lec 13_ Project Planning
PDF
SE18_SE_Lec 12_ Project Management 1
PDF
SE18_Lec 10_ UML Behaviour and Interaction Diagrams
Dcs lec03 - z-analysis of discrete time control systems
Dcs lec02 - z-transform
Dcs lec01 - introduction to discrete-time control systems
DDSP_2018_FOEHU - Lec 10 - Digital Signal Processing Applications
DSP_2018_FOEHU - Lec 06 - FIR Filter Design
SE2018_Lec 17_ Coding
SE2018_Lec-22_-Continuous-Integration-Tools
SE2018_Lec 21_ Software Configuration Management (SCM)
SE2018_Lec 18_ Design Principles and Design Patterns
Selenium - Introduction
SE2018_Lec 20_ Test-Driven Development (TDD)
SE2018_Lec 19_ Software Testing
DSP_2018_FOEHU - Lec 05 - Digital Filters
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
SE2018_Lec 15_ Software Design
DSP_2018_FOEHU - Lec 0 - Course Outlines
SE2018_Lec 14_ Process Modeling and Data Flow Diagram.pptx
SE18_Lec 13_ Project Planning
SE18_SE_Lec 12_ Project Management 1
SE18_Lec 10_ UML Behaviour and Interaction Diagrams

Recently uploaded (20)

PPTX
communication and presentation skills 01
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
PPTX
Current and future trends in Computer Vision.pptx
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
PDF
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
PDF
Soil Improvement Techniques Note - Rabbi
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
Fundamentals of Mechanical Engineering.pptx
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PPTX
Software Engineering and software moduleing
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PPT
Total quality management ppt for engineering students
PPTX
Feature types and data preprocessing steps
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PDF
737-MAX_SRG.pdf student reference guides
communication and presentation skills 01
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
SMART SIGNAL TIMING FOR URBAN INTERSECTIONS USING REAL-TIME VEHICLE DETECTI...
Current and future trends in Computer Vision.pptx
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
Categorization of Factors Affecting Classification Algorithms Selection
AUTOMOTIVE ENGINE MANAGEMENT (MECHATRONICS).pptx
ChapteR012372321DFGDSFGDFGDFSGDFGDFGDFGSDFGDFGFD
Soil Improvement Techniques Note - Rabbi
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
Fundamentals of Mechanical Engineering.pptx
"Array and Linked List in Data Structures with Types, Operations, Implementat...
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Software Engineering and software moduleing
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
distributed database system" (DDBS) is often used to refer to both the distri...
Total quality management ppt for engineering students
Feature types and data preprocessing steps
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
737-MAX_SRG.pdf student reference guides

DSP_FOEHU - MATLAB 02 - The Discrete-time Fourier Analysis

  • 2. Introduction  A linear and time-invariant system can be represented using its response to the unit sample sequence. This response, called the unit impulse response h(n), allows us to compute the system response to any arbitrary input x(n) using the linear convolution:  This convolution representation is based on the fact that any signal can be represented by a linear combination of scaled and delayed unit samples. 2
  • 3. THE DISCRETE-TIME FOURIER TRANSFORM (DTFT)  If x(n) is absolutely summable, that is, −∞ ∞ 𝑥 𝑛 < ∞, then its discrete- time Fourier transform is given by 𝑋 𝑒 𝑗𝜔 ≜ ℱ 𝑥 𝑛 = 𝑛=−∞ ∞ 𝑥 𝑛 𝑒−𝑗𝜔𝑛  The inverse discrete-time Fourier transform (IDTFT) of X(e jω ) is given by 𝑥 𝑛 ≜ ℱ−1 𝑒 𝑗𝜔 = 1 2𝜋 −𝜋 𝜋 𝑋 𝑒 𝑗𝜔 𝑒 𝑗𝜔𝑛 𝑑𝜔  The operator ℱ . transforms a discrete signal x(n) into a complex- valued continuous function 𝑋 𝑒𝑗𝜔 of real variable 𝜔, called a digital frequency, which is measured in radians/sample. 3
  • 4. EXAMPLE #1  Determine the discrete-time Fourier transform of 𝑥 𝑛 = 0.5 𝑛 𝑢(𝑛).  Solution:  The sequence x(n) is absolutely summable; therefore its discrete-time Fourier transform exists. 𝑋 𝑒 𝑗𝜔 = 𝑛=−∞ ∞ 𝑥 𝑛 𝑒−𝑗𝜔𝑛 = 𝑛=0 ∞ 0.5 𝑛 𝑒−𝑗𝜔𝑛 𝑋 𝑒 𝑗𝜔 = 𝑛=0 ∞ 0.5𝑒−𝑗𝜔 𝑛 = 1 1 − 0.5𝑒−𝑗𝜔 = 𝑒 𝑗𝜔 𝑒 𝑗𝜔 − 0.5 4
  • 5. EXAMPLE #2  Determine the discrete-time Fourier transform of the following finite- duration sequence: 𝑥(𝑛) = { 1, 2, 3, 4, 5 }  Solution: 𝑋 𝑒 𝑗𝜔 = 𝑛=−∞ ∞ 𝑥 𝑛 𝑒−𝑗𝜔𝑛 = 𝑒 𝑗𝜔 + 2 + 3𝑒−𝑗𝜔 + 4𝑒−2𝑗𝜔+ . . +5𝑒−5𝑗𝜔 5 ↑
  • 6. DTFT Spectrum Properties 1. Periodicity:  The discrete-time Fourier transform 𝑋 𝑒 𝑗𝜔 is periodic in ω with period 2π. 𝑋 𝑒 𝑗𝜔 = 𝑋 𝑒 𝑗[𝜔+2𝜋  Implication: We need only one period of 𝑋 𝑒 𝑗𝜔 (i.e., 𝜔 ∈ [0, 2𝜋], 𝑜𝑟 [− 𝜋, 𝜋], etc.) for analysis and not the whole domain −∞ < 𝜔 < ∞ .  2. Symmetry:  For real-valued x(n), X(e jω ) is conjugate symmetric. 𝑅𝑒 𝑋 𝑒−𝑗𝜔 = 𝑅𝑒 𝑋 𝑒 𝑗𝜔 (𝑒𝑣𝑒𝑛 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦) 𝐼𝑚 𝑋 𝑒−𝑗𝜔 = −𝐼𝑚 𝑋 𝑒 𝑗𝜔 (𝑂𝑑𝑑 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦) 𝑋 𝑒−𝑗𝜔 = 𝑋 𝑒 𝑗𝜔 (𝑒𝑣𝑒𝑛 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦) ∠𝑋 𝑒−𝑗𝜔 = −∠𝑋 𝑒 𝑗𝜔 (𝑂𝑑𝑑 𝑆𝑦𝑚𝑚𝑒𝑡𝑟𝑦)  Implication: To plot 𝑋 𝑒 𝑗𝜔 , we now need to consider only a half period of 𝑋 𝑒 𝑗𝜔 . Generally, in practice this period is chosen to be 𝜔 ∈ 0, 𝜋 . 6
  • 7. DTFT - MATLAB Implementation  If 𝑥(𝑛) is of infinite duration, then MATLAB cannot be used directly to compute 𝑋 𝑒𝑗𝜔 from 𝑥(𝑛). However, we can use it to evaluate the expression 𝑋 𝑒𝑗𝜔 over [0, 𝜋] frequencies and then plot its magnitude and angle (or real and imaginary parts).  EXAMPLE #3:  Determine the discrete-time Fourier transform of 𝑥 𝑛 = 0.5 𝑛 𝑢(𝑛) . Evaluate 𝑋 𝑒 𝑗𝜔 at 501 equispaced points between [0, π] and plot its magnitude, angle, real, and imaginary parts. 7
  • 8. EXAMPLE #3- Solution  The discrete-time Fourier transform is. 𝑋 𝑒 𝑗𝜔 = 𝑛=−∞ ∞ 𝑥 𝑛 𝑒−𝑗𝜔𝑛 = 𝑛=0 ∞ 0.5 𝑛 𝑒−𝑗𝜔𝑛 𝑋 𝑒 𝑗𝜔 = 𝑛=0 ∞ 0.5𝑒−𝑗𝜔 𝑛 = 1 1 − 0.5𝑒−𝑗𝜔 = 𝑒 𝑗𝜔 𝑒 𝑗𝜔 − 0.5  MATLAB script: 8
  • 10. DTFT – Matrix Form  If x(n) is of finite duration, then MATLAB can be used to compute 𝑋 𝑒 𝑗𝜔 numerically at any frequency ω.  we evaluate X(e jω ) at equispaced frequencies between [0, π],  then DTFT can be implemented as a matrix-vector multiplication operation.  To understand this, let us assume that the sequence 𝑥(𝑛) has 𝑁 samples between 𝑛1 ≤ 𝑛 ≤ 𝑛 𝑁 (i.e., not necessarily between [0, 𝑁 − 1]) and that we want to evaluate 𝑋 𝑒 𝑗𝜔 at 𝜔 𝐾 ≜ 𝜋 𝑀 𝑘, 𝑘 = 0, 1, . . . , 𝑀  which are (M + 1) equispaced frequencies between [0, π]. Then (3.1) can be written as 𝑋 𝑒 𝑗𝜔 𝐾 = ℓ=1 𝑁 𝑥 𝑛ℓ 𝑒 −𝑗 𝜋 𝑀 𝐾𝑛ℓ , 𝑘 = 0, 1, . . . , 𝑀 10
  • 11. DTFT – Matrix Form (Cont.)  When {𝑥 𝑛ℓ } and {𝑋 𝑒𝑗𝜔 𝐾 } are arranged as 𝑐𝑜𝑙𝑢𝑚𝑛 vectors 𝑥 and 𝑋, respectively, we have 𝑿 = 𝑾𝒙  where 𝑾 is an (𝑀 + 1) × 𝑁 matrix given by 𝑾 ≜ 𝑒 −𝑗 𝜋 𝑀 𝐾𝑛ℓ ; 𝑛1 ≤ 𝑛 ≤ 𝑛 𝑁, 𝐾 = 0,1, … , 𝑀  In addition, if we arrange { k } and { n } as row vectors k and n respectively, then 𝑾 = exp(−𝑗 𝜋 𝑀 𝑲 𝑇 𝒏)  In MATLAB we represent sequences and indices as row vectors; therefore taking the transpose of 𝑿 = 𝑾𝒙, we obtain 𝑿 𝑇 = 𝒙 𝑇 exp(−𝑗 𝜋 𝑀 𝑲 𝑇 𝒏)  Note that 𝐧 𝑇 𝐊 is an 𝑁 × (𝑀 + 1) matrix. Now we can be implemented in MATLAB as follows. 11
  • 12. Example #4  Numerically compute the discrete-time Fourier transform of the sequence 𝑥(𝑛) given in Example #2 at 501 equispaced frequencies between [0, 𝜋].  Solution:  MATLAB script: 12
  • 13. Example #5  Let 𝑥(𝑛) = (0.9 exp(𝑗𝜋/3)) 𝑛 , 0 ≤ n ≤ 10. Determine 𝑋 𝑒 𝑗𝜔 and investigate its periodicity.  Solution:  MATLAB script: 13
  • 14. Example #5 – Solution (Cont.)  However, we will evaluate and plot it at 401 frequencies over two periods between [ − 2π, 2π] to observe its periodicity. 14
  • 15. Some common DTFT pairs 15
  • 16. THE PROPERTIES OF THE DTFT  DSP Lecture Notes No. 5 16
  • 17. The Frequency Domain Representation Of LTI Systems  the Fourier transform representation is the most useful signal representation for LTI systems.  Response To A Complex Exponential 𝑒 𝑗𝜔0 𝑛  RESPONSE TO SINUSOIDAL SEQUENCES 17
  • 18. RESPONSE TO ARBITRARY SEQUENCES  Finally, we can be generalized to arbitrary absolutely summable sequences. Let 𝑋 𝑒 𝑗𝜔 = ℱ[𝑥(𝑛)] and Y 𝑒 𝑗𝜔 = ℱ[𝑦(𝑛)]; then using the convolution property, we have Y 𝑒 𝑗𝜔 = H 𝑒 𝑗𝜔 X 𝑒 𝑗𝜔  Therefore an LTI system can be represented in the frequency domain by 18
  • 19. Example #13  Determine the frequency response H 𝑒 𝑗𝜔 of a system characterized by h(𝑛) = (0.9) 𝑛 𝑢(𝑛). Plot the magnitude and the phase responses.  Solution: 𝐻 𝑒 𝑗𝜔 = 𝑛=−∞ ∞ ℎ 𝑛 𝑒−𝑗𝜔𝑛 = 𝑛=0 ∞ 0.9 𝑛 𝑒−𝑗𝜔𝑛 = 1 1 − 0.9𝑒−𝑗𝜔  Hence, the magnitude and the phase are 19
  • 20. Example #13 – Solution (Cont.)  MATLAB Script: 20
  • 21. Example #14  Let an input to the system in Example #13 be x n = 0.1𝑢(𝑛). Determine the steady-state response y ss (n).  Solution:  Since the input is not absolutely summable, the discrete-time Fourier transform is not particularly useful in computing the complete response. However, it can be used to compute the steady-state response. In the steady state (i.e., 𝑛 → ∞ ), the input is a constant sequence (or a sinusoid with 𝜔0 = 𝜃0 = 0). Then the output is 𝑦𝑠𝑠(𝑛) = 0.1 × H 𝑒 𝑗0 = 0.1 × 10 = 1  where the gain of the system at ω = 0 (also called the DC gain) is H 𝑒𝑗0 = 10. 21
  • 22. Frequency Response Function From Difference Equations  When an LTI system is represented by the difference equation 𝑦 𝑛 + ℓ=1 𝑁 𝑎ℓ 𝑦 𝑛 − ℓ = 𝑚=0 𝑀 𝑏 𝑚 𝑥 𝑛 − 𝑚  then to evaluate its frequency response, we would need the impulse response ℎ(𝑛). However, we can easily obtain H 𝑒 𝑗𝜔 . We know that when x(n) = 𝑒 𝑗𝜔𝑛, then y(n) must be H 𝑒 𝑗𝜔 𝑒 𝑗𝜔n. Then we have 22
  • 23. EXAMPLE #15  An LTI system is specified by the difference equation 𝑦(𝑛) = 0.8𝑦(𝑛 − 1) + 𝑥(𝑛) a. Determine H 𝑒 𝑗𝜔 . b. Calculate and plot the steady-state response 𝑦𝑠𝑠(𝑛) to 𝑥(𝑛) = cos(0.05𝜋𝑛)𝑢(𝑛) 23
  • 24. EXAMPLE #15 - Solution  Rewrite the difference equation as 𝑦(𝑛) − 0.8𝑦(𝑛 − 1) = 𝑥(𝑛).  a. The H 𝑒 𝑗𝜔 is 𝐻 𝑒 𝑗𝜔 = 1 1 − 0.8𝑒−𝑗𝜔  b. In the steady state the input is 𝑥(𝑛) = cos(0.05𝜋𝑛) with frequency 𝜔0 = 0.05𝜋 and 𝜃0 = 0◦. The response of the system is 𝐻 𝑒 𝑗0.05𝜋 = 1 1 − 0.8𝑒−𝑗0.05𝜋 = 4.0928𝑒− 𝑗0.5377  Therefore 𝑦𝑠𝑠(𝑛) = 4.0928 cos(0.05𝜋𝑛 − 0.5377) = 4.0928 cos[0.05𝜋(𝑛 − 3.42)]  This means that at the output the sinusoid is scaled by 4.0928 and shifted by 3.42 samples. This can be verified using MATLAB. 24
  • 25. EXAMPLE #15 – Solution (Cont.)  The MATLAB Script 25
  • 26. EXAMPLE #15 – Solution (Cont.)  we note that the amplitude of y ss (n) is approximately 4. To determine the shift in the output sinusoid, we can compare zero crossings of the input and the output. 26
  • 27. EXAMPLE #16  A 3rd -order lowpass filter is described by the difference equation 𝑦(𝑛) = 0.0181𝑥(𝑛) + 0.0543𝑥(𝑛 − 1) + 0.0543𝑥(𝑛 − 2) + 0.0181𝑥(𝑛 − 3) +1.76𝑦(𝑛 − 1) − 1.1829𝑦(𝑛 − 2) + 0.2781𝑦(𝑛 − 3)  Plot the magnitude and the phase response of this filter, and verify that it is a lowpass filter. 27
  • 28. EXAMPLE #16 – Solution (Cont.)  We will implement this procedure in MATLAB and then plot the filter responses. 28
  • 29. EXAMPLE #16 – Solution (Cont.)  From the plots in the Figure we see that the filter is indeed a lowpass filter. 29
  • 30. SAMPLING AND RECONSTRUCTION OF ANALOG SIGNALS 30
  • 31. Sampling And Reconstruction Of Analog Signals  In many applications—for example, in digital communications—real- world analog signals are converted into discrete signals using sampling and quantization operations (collectively called analog-to-digital conversion, or ADC). These discrete signals are processed by digital signal processors, and the processed signals are converted into analog signals using a reconstruction operation (called digital-to-analog conversion or DAC).  Using Fourier analysis, we can describe the sampling operation from the frequency-domain viewpoint, analyze its effects, and then address the reconstruction operation. We will also assume that the number of quantization levels is sufficiently large that the effect of quantization on discrete signals is negligible.  We will study the effects of quantization later. 31
  • 32. Sampling And Reconstruction Of Analog Signals  DSP Lecture Notes No. 2 32
  • 33. Review  Band-limited Signal:  A signal is band-limited if there exists a finite radian frequency Ω0such that 𝑋 𝑎(𝑗Ω) is zero for |Ω| > Ω0. The frequency 𝐹0 = Ω0/2𝜋 is called the signal bandwidth in Hz.  Sampling Principle:  A band-limited signal 𝑥 𝑎(𝑡) with bandwidth 𝐹0 can be reconstructed from its sample values 𝑥(𝑛) = 𝑥 𝑎(𝑛𝑇𝑠) if the sampling frequency 𝐹𝑠 = 1/𝑇𝑠 is greater than twice the bandwidth 𝐹0 of 𝑥 𝑎(𝑡). 𝐹𝑠 > 2𝐹0  Otherwise aliasing would result in x(n). The sampling rate of 2𝐹0for an analog band-limited signal is called the Nyquist rate. 33
  • 35. EXAMPLE #19  Let 𝑥 𝑎 𝑡 = 𝑒−1000 𝑡 . a. Determine and plot its Fourier transform. b. Sample 𝑥 𝑎(𝑡) at 𝐹𝑠 = 5000 𝑠𝑎𝑚𝑝𝑙𝑒/sec to obtain 𝑥1(𝑛). Determine and plot 𝑋1 𝑒 𝑗𝜔 . c. Sample 𝑥 𝑎(𝑡) at 𝐹𝑠 = 1000 𝑠𝑎𝑚𝑝𝑙𝑒/sec to obtain 𝑥2(𝑛). Determine and plot 𝑋2 𝑒 𝑗𝜔 . 35
  • 36. EXAMPLE #19 - Solution a. The Fourier transform is  which is a real-valued function since 𝑥 𝑎 𝑡 is a real and even signal. To evaluate 𝑋 𝑎(𝑗Ω) numerically, we have to first approximate 𝑥 𝑎 𝑡 by a finite-duration grid sequence 𝑥 𝐺 𝑚 .  Using the approximation 𝑒−5 ≈ 0, we note that 𝑥 𝑎 𝑡 can be approximated by a finite-duration signal over − 0.005 ≤ 𝑡 ≤ 0.005 (or equivalently, over [− 5, 5] msec).  Then, 𝑋 𝑎(𝑗Ω) ≈ 0 for Ω ≥ 2𝜋(2000). Hence choosing 36
  • 37. EXAMPLE #19 – Solution (Cont.) 37
  • 38. EXAMPLE #19 – Solution (Cont.) b. Since the bandwidth of 𝑥 𝑎(𝑡) is 2𝐾𝐻𝑧, the Nyquist rate is 4000 𝑠𝑎𝑚𝑝𝑙𝑒/sec, which is less than the given 𝐹 𝑠. Therefore aliasing will be (almost) nonexistent.  MATLAB script: 38
  • 39. EXAMPLE #19 – Solution (Cont.) 39
  • 40. EXAMPLE #19 – Solution (Cont.) c. Here 𝐹𝑠 = 1000 < 4000. Hence there will be a considerable amount of aliasing. This is evident from the shown Figure, in which the shape of 𝑋2 𝑒 𝑗𝜔 is different from that of 𝑋 𝑎(𝑗Ω) and can be seen to be a result of adding overlapping replicas of 𝑋 𝑎(𝑗Ω). 40
  • 41. Reconstruction  From the sampling theorem and the preceding examples, it is clear that if we sample band-limited 𝑥 𝑎(𝑡) above its Nyquist rate, then we can reconstruct 𝑥 𝑎(𝑡) from its samples 𝑥(𝑛). This reconstruction can be thought of as a 2-step process: 1) First the samples are converted into a weighted impulse train. 2) Then the impulse train is filtered through an ideal analog lowpass filter band-limited to the [ −𝐹𝑠/2, 𝐹𝑠/2] band. 41
  • 42. Reconstruction  This two-step procedure can be described mathematically using an interpolating formula  where 𝑠𝑖𝑛𝑐(𝑥) = sin 𝜋𝑥 𝜋𝑥 is an interpolating function. The physical interpretation of the above reconstruction formula is given in the shown Figure, from which we observe that this ideal interpolation is not practically feasible because the entire system is noncausal and hence not realizable. 42
  • 43. 43
  • 44. Practical D/A converters  In practice we need a different approach than reconstruction formula. The two-step procedure is still feasible, but now we replace the ideal lowpass filter by a practical analog lowpass filter.  Another interpretation of reconstruction formula is that it is an infinite- order interpolation. We want finite-order (and in fact low-order) interpolations. There are several approaches to do this. 1) Zero-order-hold (ZOH) interpolation 2) 1st-order-hold (FOH) interpolation 3) Cubic spline interpolation 44
  • 45. Zero-order-hold (ZOH) interpolation  In this interpolation a given sample value is held for the sample interval until the next sample is received.  which can be obtained by filtering the impulse train through an interpolating filter of the form  which is a rectangular pulse. The resulting signal is a piecewise-constant (staircase) waveform which requires an appropriately designed analog postfilter for accurate waveform reconstruction. 45
  • 46. 1st -order-hold (FOH) interpolation  In this case the adjacent samples are joined by straight lines. This can be obtained by filtering the impulse train through  Once again, an appropriately designed analog postfilter is required for accurate reconstruction. These interpolations can be extended to higher orders. 46
  • 47. Cubic spline interpolation  This approach uses spline interpolants for a smoother, but not necessarily more accurate, estimate of the analog signals between samples. Hence this interpolation does not require an analog postfilter. The smoother reconstruction is obtained by using a set of piecewise continuous third-order polynomials called 𝑐𝑢𝑏𝑖𝑐 𝑠𝑝𝑙𝑖𝑛𝑒𝑠, given by  where {𝛼𝑖(𝑛), 0 ≤ 𝑖 ≤ 3 } are the polynomial coefficients, which are determined by using least-squares analysis on the sample values. (Strictly speaking, this is not a causal operation but is a convenient one in MATLAB.) 47
  • 48. EXAMPLE #23  Plot the reconstructed signal from the samples 𝑥 𝑎(𝑡) in Example #19 using the ZOH and the FOH interpolations. Comment on the plots.  Solution: 48
  • 49. EXAMPLE #23 - Solution  The plots are shown in the Figure, from which we observe that the ZOH reconstruction is a crude one and that the further processing of analog signal is necessary.  The FOH reconstruction appears to be a good one, but a careful observation near t = 0 reveals that the peak of the signal is not correctly reproduced.  In general, if the sampling frequency is much higher than the Nyquist rate, then the FOH interpolation provides an acceptable reconstruction. 49
  • 50. 50