DSP-Lec 07-Frequency Analysis of Signals and Systems
DSP-Lec 07-Frequency Analysis of Signals and Systems
2
The frequency analysis of signals and systems have three major uses
in DSP:
The numerical computation of frequency spectrum of a signal.
The efficient implementation of convolution by the fast Fourier
transform (FFT).
The coding of waves, such as speech or pictures, for efficient
transmission and storage.
3
Content
4
1. Discrete-time Fourier transform (DTFT)
The Fourier transform of the finite-energy discrete-time signal x(n) is
defined as:
j n
X ( ) x ( n )e
n
where ω=2πf/fs
The spectrum X(w) is in general a complex-valued function of
frequency: j ( )
X ( ) | X ( ) | e
5
Determine and sketch the spectra of the following signal:
a) x(n) (n)
b) x(n) a nu (n) with |a|<1
6
Determine and sketch the spectra of the following signal:
a) x(n) (n)
b) x(n) a nu (n) with |a|<1
7
Determine and sketch the spectra of the following signal:
a) x(n) (n)
b) x(n) a nu (n) with |a|<1
8
Inverse discrete-time Fourier transform
(IDTFT)
Given the frequency spectrum X ( ) , we can find the x(n) in time-
domain as
1
x( n) X ( )e j n d
2
Example: Consider the ideal lowpass filter with cutoff frequency wc.
Find the impulse response h(n) of the filter.
9
Properties of DTFT
Symmetry: if the signal x(n) is real, it easily follows that
X ( ) X ( )
F
Linearity: if x1 (n) X 1 ( )
F
x2 (n) X 2 ( )
F
a x
then 1 1 ( n ) a x
2 2 ( n ) a1 X 1 ( ) a2 X 2 ( )
F
Time-shifting: if x(n) X ( )
then
F
x(n k ) e jk X ( )
11
Properties of DTFT
F
Time reversal: if x(n) X ( )
F
then x(n) X ( )
F
Convolution theory: if x1 (n) X 1 ( )
F
x2 (n) X 2 ( )
F
then x(n) x1 (n) x2 (n) X ( ) X 1 ( ) X 2 ( )
12
Frequency resolution and windowing
The duration of the data record is:
13
Rectangular window
14
Impact of rectangular window
Consider a single analog complex sinusoid of frequency f1 and its
sample version:
15
Double sinusoids
Frequency resolution:
16
Hamming window
17
Non-rectangular window
The standard technique for suppressing the sidelobes is to use a non-
rectangular window, for example Hamming window.
The main tradeoff for using non-rectangular window is that its
mainlobe becomes wider and shorter, thus, reducing the frequency
resolution of the windowed spectrum.
The minimum resolvable frequency difference will be
18
Example
The following analog signal consisting of three equal-strength
sinusoids at frequencies
19
Example
20
Example
21
2. Discrete Fourier transform (DFT)
X ( ) is a continuous function of frequency and therefore, it is not a
computationally convenient representation of the sequence x(n).
DFT will present x(n) in a frequency-domain by samples of its
spectrum X ( ) .
A finite-duration sequence x(n) of length L has a Fourier transform:
L 1
X ( ) x(n)e j n 0 2
n0
2 k
Sampling X(ω) at equally spaced frequency k , k=0, 1,…,N-1
N
where N ≥ L, we obtain N-point DFT of length L-signal:
L 1
2 k
X (k ) X ( ) x(n)e j 2 kn / N (N-point DFT)
N n 0
23
Matrix form of DFT
By defining an Nth root of unity WN e j 2 / N , we can rewrite DFT
and IDFT as follows
N 1
X (k ) x(n)WNkn , k 0,1, , N 1. (DFT)
n 0
N 1
1 (IDFT)
N , n 0,1, , N 1.
kn
x( n)
N
X
n 0
( k )W
24
Matrix form of DFT
1 1 1 1
1 W W 2
WNN 1
N N
25
Example: Determine the DFT of the four-point sequence x(n)=[1 1,
2 1] by using matrix form.
26
Properties of DFT
Properties Time domain Frequency domain
Notation x ( n) X (k )
Periodicity x ( n N ) x ( n) X (k ) X (k N )
Circular convolution
Multiplication
of two sequences
N N 1
1
Parveval’s theorem 2
E x | x ( n) | | X ( k ) |2
n 0 N k 0
27
Circular shift
The circular shift of the sequence can be represented as the index
modulo N:
x '(n) x (n k , modulo N ) x((n k )) N
28
Circular convolution
The circular convolution of two sequences of length N is defined as
29
Circular convolution
30
Circular convolution
31
Use of the DFT in Linear Filtering
Suppose that we have a finite duration sequence x=[x0, x1,…, xL-1 ]
which excites the FIR filter of order M.
The sequence output is of length Ly=L+M samples.
If N ≥ L+M, N-point DFT is sufficient to present y(n) in the
frequency domain, i.e.,
N N /21 N /2 1
X k x 2n WN WN x 2n 1 WNkn
kn k
2 n 0 2 n0 2
35
Butterfly
This leads to basic building block of the FFT, the butterfly.
36
Recursion
If N/2 is even, we can further split the computation of each DFT of
size N/2 into two computations of half size DFT. When N=2r this can
be done until DFT of size 2 (i.e. butterfly with two elements).
3rd stage 2nd stage 1st stage
x(0) X(0)
W80
x(4) - X(1)
W80
x(2) - X(2)
W80 W82
x(6) - - X(3)
W80
x(1) - X(4)
W80=1 W80 W81
x(5) - - X(5)
W80 W82
x(3) - - X(6)
W80 W82 W83
x(7) - - - X(7)
37
Shuffling the data, bit reverse ordering
At each step of the algorithm, data are split between even and odd
values. This results in scrambling the order.
38
Number of operations
If N=2r, we have r=log2(N) stages. For each one we have:
• N/2 complex ‘×’ (some of them are by ‘1’).
• N complex ‘+’.
Thus the grand total of operations is:
39
Homework
40