DSP Module 1 Notes
DSP Module 1 Notes
DSP Module 1 Notes
Amplitude
Signal
DFT Spectrum
Time Frequency
2
DFT: Graphical Example
DFT
Sampling rate
8000 samples = 1 second
32 samples = 32/8000 sec
= 4 millisecond
Frequency
1 second = 1000 cycles
32/8000 sec =
(1000*32/8000=) 4 cycles
3
DFT Coefficients of Periodic Signals
Periodic
Digital
Signal
4
DFT Coefficients of Periodic Signals
Copy
Amplitude
spectrum of the
periodic digital
signal
5
Example 1
The periodic signal: is sampled at
6
Example 1 – contd. (1)
b.
7
Example 1 – contd. (2)
8
On the Way to DFT Formulas
Imagine periodicity of
N samples.
9
DFT Formulas
Where,
Inverse DFT:
10
MATLAB Functions
11
Example 2
Solution:
12
Example 2 – contd.
Using MATLAB,
13
Example 3
Inverse DFT of the previous example.
14
Example 3 – contd.
Using MATLAB,
15
Relationship Between Frequency Bin k
and Its Associated Frequency in Hz
Example 4
In the previous example, if the sampling rate is 10 Hz,
16
Example 4 – contd.
a.
Sampling period:
f
b.
Frequency resolution:
k
17
Amplitude and Power Spectrum
Amplitude Spectrum:
18
Amplitude and Power Spectrum –contd.
Power Spectrum:
Phase Spectrum:
19
Example 5
Solution:
See Example 2.
20
Example 5 – contd. (1)
21
Example 5 – contd. (2)
Solution:
23
Zero Padding for FFT
FFT: Fast Fourier Transform.
A fast version of DFT; It requires signal length to be power of 2.
Therefore, we
need to pad zero
at the end of the
signal.
However, it does
not add any new
information.
24
Example 7
Consider a digital signal has sampling rate = 10 kHz. For amplitude spectrum we
need frequency resolution of less than 0.5 Hz. For FFT how many data points are
needed?
Solution:
25
MATLAB Example - 1
fs
26
MATLAB Example – contd. (1)
27
MATLAB Example – contd. (2)
28
MATLAB Example – contd. (3)
………..
29
Effect of Window Size
1 Hz sinusoid,
with 32
samples
30
Effect of Window Size –contd. (1)
Discontinuous
31
Effect of Window Size –contd. (2)
2- cycles Mirror Image
Produces
single
frequency
Produces many
harmonics as well.
Spectral
Leakage
33
Example 8
Given,
Calculate,
34
Different Types of Windows
Triangular Window:
Hamming Window:
Hanning Window:
35
Different Types of Windows –contd.
Window size of 20 samples
36
Example 9
Problem:
Solution:
Since N = 4, Hamming window function can be found as:
37
Example 9 – contd. (1)
Windowed sequence:
DFT Sequence:
38
Example 9 – contd. (2)
39
MATLAB Example - 2
40
MATLAB Example – 2 contd.
41
DFT Matrix
42
DFT Matrix
Let,
Then
DFT equation:
43
FFT
FFT: Fast Fourier Transform
Samples N = 2, 4, 8, 16 or so.
If the input length is not 2m, append (pad) zeros to make it 2m.
4 5 1 7 1 4 5 1 7 1 0 0 0
N=5 N = 8, power of 2
44
DFT to FFT: Decimation in Frequency
DFT:
45
DFT to FFT: Decimation in Frequency
Now decompose into even (k = 2m) and odd (k = 2m+1) sequences.
46
DFT to FFT: Decimation in Frequency
47
DFT to FFT: Decimation in Frequency
12 complex
multiplication
48
DFT to FFT: Decimation in Frequency
49
IFFT: Inverse FFT
50
FFT and IFFT Examples
FFT
IFFT
51
DFT to FFT: Decimation in Time
Split the input sequence x(n) into the even indexed x(2m) and x(2m + 1),
each with N/2 data points.
Using
52
DFT to FFT: Decimation in Time
As,
53
DFT to FFT: Decimation in Time
First iteration:
Second iteration:
54
DFT to FFT: Decimation in Time
Third iteration:
2
2 2
2 2
WN e N
cos j sin W e
2 8
e 2
cos( / 2) j sin( / 2) j
N N 8
IFFT
55
FFT and IFFT Examples
FFT
IFFT
56
Fourier Transform Properties (1)
FT is linear:
• Homogeneity
• Additivity
Homogeneity:
DFT
x[] X[]
DFT
kx[] kX[]
Frequency is not
changed.
57
Fourier Transform Properties (2)
Additivity
58
Fourier Transform Pairs
Delta Function Pairs
in Polar Form
Delta Function
Same Magnitude,
Different Phase
59