Frequency-Domain Analysis: The Discrete Fourier Series and The Fourier Transform
Frequency-Domain Analysis: The Discrete Fourier Series and The Fourier Transform
John Chiverton
Overview
Lecture Contents
Overview
Lecture Contents
Overview
Lecture Contents
I Point 1:
I Sinusoidal and exponential signals occur everywhere. Most
signals can be decomposed into component frequencies;
I Response of a LTI processor to each frequency component can
only alter the amplitude and phase, not the frequency;
I The output can then be found with the Principle of
Superposition.
I Point 2:
I If an input signal has a frequency spectrum and the LTI
processor has a frequency response then the output signal
spectrum is found by multiplication;
I Simpler than time-domain convolution.
I Point 3:
I Frequency response is a typical requirement for DSP algorithms
I Such as low-pass, bandstop or bandpass filters.
Continuous-time Fourier Analysis
Overview
Lecture Contents
N −1 „ « N −1 „ „ « „ ««
1 X −j2πkn 1 X 2πkn 2πkn
a[k] = x[n] exp = x[n] cos − j sin
N n=0 N N n=0 N N
Two loops:
I A loop over n
I A loop over k
Pseudo-code:
1. Given x[n] and N :
2. Create a[k] size N and set all elements to zero a[k] = 0
3. For k=0 to N -1 % outer loop
3.1 For n=0 to N -1 % inner loop
3.1.1 Re(a[k]) = a[k] + x[n] × cos(2πkn/N ) % real part
3.1.2 Im(a[k]) = a[k] − x[n] × sin(2πkn/N ) % imaginary part
3.2 End For
3.3 Let Re(a[k]) = Re(a[k])/N and Let Im(a[k]) = Im(a[k])/N
4. End For
Finding Line Spectra Simple Example - manually
Let N = 2 and x[0] = 7, x[1] = 1. Find a[k]. To start find the real part of a[k]...
I To start Let n = 0 and k = 0, then
I Increment n, so n = 1, then
I Increment n, so n = 1, then
I Increment n, so n = 1, then
I Increment n, so n = 1, then
The line spectra in this case are found by a computer program using the algorithm
described earlier.
Notice (for the real coefficients) the mirror image, where a[1] = a[6] and a[2] = a[5]
etc.
Finding Line Spectra Another Example - but by computer
The line spectra in this case are found by a computer program using the algorithm
described earlier.
Notice (for the imaginary coefficients) a similar effect, except for a change of sign, e.g.
a[1] = −a[6].
Finding Line Spectra Another Example - but by computer
The line spectra in this case are found by a computer program using the algorithm
described earlier.
The line spectra are also periodic. The line spectra have the same periodicity as the
original signal.
Finding Line Spectra Another Example - but by computer
The line spectra in this case are found by a computer program using the algorithm
described earlier.
The line spectra are also periodic. The line spectra have the same periodicity as the
original signal.
Magnitude and Phase of Line Spectra
Original Signal
x[n] = sin(2πn/64)
The real and imaginary components
contain separate information about
the frequency content of the signal.
The sine function is not present in
the real part.
Original Signal
x[n] = sin(2πn/64)
The magnitude provides a
convenient overview of the
frequency content of the signal.
Magnitude Phase
Magnitude and Phase of Line Spectra Example
Original Signal
Original Signal
Magnitude Phase
Magnitude and Phase of Line Spectra Example
Original Signal
+0.1 sin(2πn/4)
Original Signal
+0.1 sin(2πn/4)
Magnitude Phase
Magnitude and Phase of Line Spectra Example
Original Signal
Original Signal
Magnitude Phase
Magnitude and Phase of Signals with Discontinuities
Magnitude Phase
Magnitude and Phase of Impulse Function
Magnitude Phase
Magnitude and Phase of Impulse Function
Magnitude Phase
Useful Properties of Discrete Fourier Series
Parseval’s theorem
Equates the total power of a signal in the time and frequency domains:
N −1 N −1
1 X X
(x[n])2 = (Mag(a[k]))2
N n=0
k=0
Example
Impulse function, δ[0] = 1
N −1
1 X 1
(x[n])2 =
N n=0 N
and
N −1 „ «2
X 1 1
(Mag(a[k]))2 = N × =
N N
k=0
I Time-shifting (invariance):
If x[n] ↔ a[k] then
i.e. The shift is just a phase shift and does not affect the
magnitude.
Outline
Overview
Lecture Contents
x[n] = δ[0]
X∞
∴ X(Ω) = δ[0] exp(−jΩn)
n=−∞
= exp(−jΩ × 0)
= 1.
F
⇒
Then
∞
X 2
X
X(Ω) = x[n] exp(−jΩn) = 0.2 exp(−jΩn)
n=−∞ n=−2
Linear Time
Input, x[n] Output, y[n]
Invariant System
Recall (see lecture 2) that an LTI system has an impulse response, h[n]:
which describes the response of the system when an impulse function is given
as the input. The impulse response is useful as it can be used to calculate the
output signal for a given input signal:
where
I The input frequency domain signal is X(Ω) = F(x[n]),
I The output frequency domain signal is Y (Ω) = F(y[n])
I The LTI system is described by H(Ω) = F(h[n]) which is known as the
frequency response of the system and is the Fourier Transform of the
impulse response.
In the frequency domain, the output can be calculated more easily:
Recall the general form of LTI difference equations (see lecture 2):
N
X M
X
a[m]y[n − m] = b[m]x[n − m].
m=0 m=0
This equation can be used to directly find the frequency response of a system
even if only the coefficients a[m] and b[m] are known.
Frequency Response Example
Q. A moving average filter has y[n] = 13 (x[n] + x[n − 1] + x[n − 2]) . Find the
frequency response of this filter.
A. We can find the frequency response by using the coefficients:
I There is only 1 output coefficient, a[0] = 1.
I There are 3 input coefficients, b[0] = b[1] = b[2] = 1
3
I Therefore M
1 P
3
exp(−jmΩ)
m=0 1
H(Ω) = = (1 + exp(−jΩ) + exp(−j2Ω))
exp(−j0Ω) 3
1
= (1 + cos(Ω) − j sin(Ω) + cos(2Ω) − j sin(2Ω))
3
1
= (1 + cos(Ω) + cos(2Ω) − j(sin(Ω) + sin(2Ω)))
3
Frequency Response Example cont’d.
I Magnitude:
r
1
Mag(H(Ω)) = ((1 + cos(Ω) + cos(2Ω))2 + (sin(Ω) + sin(2Ω))2 )
3
I Phase: „ «
(sin(Ω) + sin(2Ω))
φ(H(Ω)) = tan−1 −
(1 + cos(Ω) + cos(2Ω))
The magnitude can be simplified using:
Mag(H(Ω)) = φ(H(Ω))
“ = ”
(sin(Ω)+sin(2Ω))
tan−1 − (1+cos(Ω)+cos(2Ω))
q
1
3
(3 + 2(2 cos(Ω) + cos(2Ω)))
Lecture Summary