digital signal processing -...
TRANSCRIPT
→ Objectives:
1- Being able to use the following tools in order to conduct
a digital signal spectral analysis:
Digital Fourier Transform (DFT)
Power Spectral Density (PSD)
Auto and cross correlations
2- Being able to synthesize a digital filter in order to create
or modify signals.
→ Provided documents (http://thomas.perso.enseeiht.fr/teaching.html):
1- The slides
2- A detailed course and exercises with solutions
3- The texts for the practical work
4- Some elements for Matlab programming.
→ A written exam including the analog part
Nathalie Thomas
Digital Signal Processing
Master SATCOM
2018-2019
Chapter 1
Introduction
- Signal digitization
- Main digital processing tools
- Processing time / real time processing
Nathalie Thomas
Digital Signal Processing
Master SpaceCOM
2018-2019
Example :
x(t) = sin (2pf0 t)
time
T0 = 1/f0
Analog signal:
Defined at all times by real values
Digital signal:
Defined at discrete times and taking
amplitudes in a finite set of values.
Digitization:
Sampling + quantization
Analog signal:
Defined at all times by real values
Sampled signal:
Defined at discrete times by real
values
Example :
x(kTe) = sin (2pf0 kTe)
time
Te : sampling period
Is it possible to keep all the signal
information in the collected
samples ?
No, it’s
impossible…k = sample index
Of course it is !
On one condition :
Fe= > 2 Fmax
Note : here is a periodical sampling
Te
1
Example 1
temps
Amplitude
Signal de parole :
Obtained spectrum using the Fourier transform :
frequency- Fmax Fmax
Fourier transform of the well sampled signal:
fréquencesFe-Fe - Fmax Fmax
frequencyFe-Fe
Fe> 2Fmax
Fe-Fe
Fe< 2Fmax
Fe-Fe
Fe= 2Fmax
2Fe-2Fe
-2Fe 2Fe 3Fe-3Fe 4Fe-4Fe
When the sampling frequency is reduced, the periodizations
come closer and closer and at a moment they appear in the
signal bandwidth, generating some aliasing :
frequency
Fourier transform of the sampled signal with Fe= Fmax / 12 :
time
Energy distribution
- Fmax Fmax
- Fmax Fmax
- Fmax Fmax
image d"origine
50 100 150 200 250 300 350 400 450 500
50
100
150
200
250
300
350
400
450
500
image sous échantillonné d"un facteur 2
50 100 150 200 250
50
100
150
200
250
image sous échantillonné d"un facteur 4
20 40 60 80 100 120
20
40
60
80
100
120
Example 2
Original image:
512*512 pixels, quantized on 8 bits
Under sampled image with a factor of 2:
256*256 pixels, quantized on 8 bits
Under sampled image with a factor of 4 :
128*128 pixels, quantized on 8 bits
Moiré effects
Quantized signal:
Defined at all times
by a finite number of values
Example :
q
Sig
nal
Dynam
ic
time
x(t) = sin (2pf0 t)
Example (uniform quantifization by truncating on
nb = 2 bits) :
time
V1(00)
V2(01)
V3(11)
V4(10)
x(t) = sin (2pf0 t) {V1, V2, V3, V4}∈x(t) = sin (2pf0 t)
Original signal
Signal quantized
on 2 bits
The number of possible values for the signal
amplitudes after quantization is given by the number of
quantization bits.
With nb bits it is possible to code 2nb levels on the
signal dynamic. q = 2nb
Signal dynamic
The signal dynamic is divided into 2nb = 22 = 4 levels
with the same size (uniform quantifization)
and all the amplitudes belonging to the same level are
assigned the same value coded on nb=2 bits. The level
width gives what is called the quantization step q :
Is it possible to keep the same
information in the quantized signal ?
Yesss !! A well done quantization adds a noise, called
quantization noise, to the original signal
(unquantized).
It can be shown that the quantization signal to noise
ratio (SNR) is given by:
The constant depends on the considered signal, but,
watever is the signal, we can note that, when the
number of quantization bits nb increases, the signal to
noise ratio also increases quickly leading to a
transparent operation.
Tough luck but no…
Quantization is an irreversible operation.
The quantized signal will never be exactly
the same as the unquantized one.
SNRQ(dB) = 10 log = 6nb+constant
Punquantized signal
Pquantization noise
But the quantized and unquantized signals can
be very close …
time
Amplitude
→ Quantized signal on 16 bits => 216 = 65536 levels:
→ Quantized signal on nb = 4 bits => 24 = 16 levels:
Example 1
temps
Amplitude
time
image d"origine
50 100 150 200 250 300 350 400 450 500
50
100
150
200
250
300
350
400
450
500
Example 2Original image:
512*512,
Quantized on 8 bits
Quantification : 4 bits
50 100 150 200 250 300 350 400 450 500
50
100
150
200
250
300
350
400
450
500
Quantification : 2 bits
50 100 150 200 250 300 350 400 450 500
50
100
150
200
250
300
350
400
450
500
Quantized image on 2 bitsQuantized image on 4 bits
Example 1 :
{V1, V2, V3, V4}∈x(kTe) = sin (2pf0 kTe)
temps
V1(00)
V2(01)
V3(11)
V4(10)
Te : sampling period
010101000000000000010101111111101010101010…
Digital signal:
Defined at discrete times by a finite
number of values
= sampling and quantized signal
Finaly the binary information associated to the sinusoid,
or digital sinusoid, will be given by:
image d"origine
50 100 150 200 250 300 350 400 450 500
50
100
150
200
250
300
350
400
450
500
Original image:
512*512,
Quantized on 8 bits
Quantification : 8 bits
338 340 342 344 346 348 350
45
50
55
60
65
70
75
80
Example 2 :
Zoom
51
2 p
ixe
ls
512 pixels
1 gray level
among
256 (28)
Needed bandwidth(for transmission on carrier frequency)
Example 1
Fra
nce In
ter
RT
L2
Le
Mouv'
Fra
nce
Cu
ltu
re
No
sta
lgie
Skyro
ck
NR
J
Virg
in R
ad
io
RM
C
Fra
nce In
fo
Fun R
adio
BF
M
88.1
0
88.7
0
89
.10
95
.20
RT
L… … … … …
96.3
0
96
.90
99
.50
10
0.0
10
0.4
101.0
102.4
10
2.8
10
3.9
104.3
10
5.5
105.9
10
6.3
10
7.2
Example of shared bandwidth: FM band in Toulouse
87.5 MHz
frequency
108 MHzFM band
Transmission channel Bandpass
Reserved for France Info
temps
Amplitude
time
frequency
Energy distribution
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Defects detection …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
Fourier
Transform
Example 2
time
+V
-V
0 1 1 0 0 1 0 1 1 1
0 1 1 0 0 1 0 1 1 1
+V
-V
+V
-V
time
time
fréquencesfrequency
Several
Signals
carrying
the same
binary
information
Several
Occupied
bandwidth
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Defects detection …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
Different
filters
Fourier
Transform
Example 3
0 100 200 300 400 500 600 700 800 900 1000
-1
0
1
signal émis
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-60
-40
-20
0
20
Normalized Frequency (p rad/sample)
Pow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal émis
0 100 200 300 400 500 600 700 800 900 1000
-2
-1
0
1
2
signal reçu
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-30
-20
-10
0
10
Normalized Frequency (p rad/sample)
Pow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal reçu
0 100 200 300 400 500 600 700 800 900 1000
-1
-0.5
0
0.5
1
signal reçu après filtrage
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100
-50
0
50
Normalized Frequency (p rad/sample)P
ow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal reçu après filtrage
Transmitted signal and
transmitted signal spectrum
Before the receiver filter
SNR = 10 dB
BER = 7.8e-04
BER = 0
Received signal and
received signal spectrum
After the receiver filter
Received signal and
received signal spectrum
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Defects detection …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
Filtering
Example 4
SNR = 0 dB
BER = 0,179
BER = 7.53e-04
0 100 200 300 400 500 600 700 800 900 1000
-1
0
1
signal émis
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-60
-40
-20
0
20
Normalized Frequency (p rad/sample)
Pow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal émis
0 100 200 300 400 500 600 700 800 900 1000
-4
-2
0
2
4
signal reçu
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-20
-10
0
10
Normalized Frequency (p rad/sample)
Pow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal reçu
0 100 200 300 400 500 600 700 800 900 1000-2
-1
0
1
2
signal reçu après filtrage
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-100
-50
0
50
Normalized Frequency (p rad/sample)P
ow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal reçu après filtrage
Transmitted signal and
transmitted signal spectrum
Before the receiver filter
Received signal and
received signal spectrum
After the receiver filter
Received signal and
received signal spectrum
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Defects detection …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
Filtering
Example 5Transmitted Image
Received Image
Before the receiver filter
Received image
After the receiver filter
SNR = 10 dB
BER = 7.86e-04
BER = 0
Image émise
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image reçue
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image émise
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image reçue
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image émise
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image reçue
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Defects detection …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
Filtering
Example 6
SNR = 0 dB
BER = 0.1581
BER = 7.5483e-04
Image émise
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image reçue
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image émise
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image reçue
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image émise
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Image reçue
50 100 150 200 250 300 350 400 450 500
100
200
300
400
500
Transmitted Image
Received Image
Before the receiver filter
Received image
After the receiver filter
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Defects detection …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
Filtering
Example 7
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-40
-20
0
20
40
Temps (s)
Sig
nal ré
el filtré
Signal réel filtré deux fois
0 5 10 15 20 25 30 35 40 45 500
2000
4000
6000
8000
Indices période de signal
T(X
)
Statistique de test, seuil considéré
T(X)
seuil
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-400
-200
0
200
400
t (secondes)
Signal réel
-1500 -1000 -500 0 500 1000 1500-50
0
50
100
Fréquences (Hz)
DSP signal réel
0.18 0.2 0.22 0.24 0.26 0.28
-200
-100
0
100
200
t (secondes)
Signal réel
-1500 -1000 -500 0 500 1000 1500-50
0
50
100
Fréquences (Hz)
DSP signal réel
Zoom
After highpass filtering to suppress the 50 Hz frequency:
Detection of higher
frequency components,
sign of potential occuring
Problems (arcs)
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Defects detection …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
Example 8
Amplitude
time
Noise ?
t
Rx(t)
Not only…Autocorrelation
function
Some noise
and some signal
Digital signal processing
Why ?
→ Construct/Modify signals:• To adapt them to a transmission channel:
modulation, filtering…
• To suppress/reduce unwanted components :
noise, some frequencies…
→ Extract some information:• Needed bandwidth to transmit the signal ?
• Signal detection in noise …
What tools ?
→ Digital Fourier transform (DFT)
→ Auto and cross correlation functions
→ Power spectral density (PSD)
→ Digital Filters
→Fourier Transform,
→Auto and cross correlation functions,
→Power spectral density,
→ Filtering.
Digital signals
Digital tools for processing
→ What differences between the theoritical
and the digitally implemented tools ?
→ Processing time ? Real time processing ?
Basic digital processing
Processing time
Digital
processing
Examples :
→ Biased estimation for the auto autocorrelation function:
→ Digital Fourier transform (DFT):
→ Digital filtering (Finite Impulse Response filter):
Processing time
= Number of Multiplication/Accumulation (MAC)
Real Time processing : processing time < Te
Chapter 2
Digital Fourier Transform
(DFT)
Nathalie Thomas
Digital Signal Processing
Master SpaceCOM
2018-2019
Fourier Transform (FT) Digital Fourier Transform (DFT)
Example
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%visualization of the DFT modulus
figure; plot(abs(X))
With Matlab :
0 20 40 60 80 100 1200
5
10
15
20
25
30
35
40
45
50
Visualization of the signal DFT modulus:
Modulus of the signal FT:
FT of the signal:
??
11 ? 92 ?
Two cosines ?
With frequencies 11 and 92 Hz ?
Fourier Transform (FT) Digital Fourier Transform (DFT)
1- Time sampling
2- Signal of limited duration
1+2 => Sampled and time limited signal
3- Frequency sampling
??
What impacts ??
Fourier Transform (FT) 1- FT of the sampled signal
1- Time sampling => spectrum periodization !! Shannon Condition !!
Fe > 2Fmax
Fe < 2Fmax
Aliasing
Example
1- Time sampling => spectrum periodization !! How to read the spectrum !!
Visualization on [0, Fe] :
Two diracs but only one cosine
+ -
Fe
2
Fourier Transform (FT) 1- FT of the sampled signal
Example
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure; plot(abs(X))0 20 40 60 80 100 120
0
5
10
15
20
25
30
35
40
45
50
Two cosine ? No only one !
Matlab simulation:
Visualization of the DFT modulus:
+ -
Fourier Transform (FT) 1- FT of the sampled signal
1- Time sampling => spectrum periodization !! How to read the spectrum !!
0 10 20 30 40 50 60 70 80 90 100-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Example
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure; plot(abs(X))
Matlab simulation: Signal :
1- Time sampling => spectrum periodization !! Scales (time and frequencies) !!
One period = 10 seconds ??
0 20 40 60 80 100 1200
5
10
15
20
25
30
35
40
45
50
11 92
frequencies f0=11 Hz and Fe- f0=92 Hz ??
+ -
Fourier Transform (FT) 1- FT of the sampled signal
DFT modulus:
Example
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure; plot(abs(X))
Matlab simulation:
0 10 20 30 40 50 60 70 80 90 100-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Sample index
Not time in seconds !!
Size of the vector = 101 samples
Signal:
1 period = 10 signal
samples
1- Time sampling => spectrum periodization !! Scales (time and frequencies) !!
Fourier Transform (FT) 1- FT of the sampled signal
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot([0:Te:N*Te],x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure; plot(abs(X))
Time (seconds)
1 period = 0,01 seconds
One period = 0,01 seconds
Example
Matlab simulation:Signal:
1- Time sampling => spectrum periodization !! Scales (time and frequencies) !!
Fourier Transform (FT) 1- FT of the sampled signal
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure; plot(abs(X))
0 20 40 60 80 100 1200
5
10
15
20
25
30
35
40
45
50
Two cosine? No only one ! + -
0 101
Size of the vector = 101 samples
11th 92th
f0 =10 DFT
samples
Sample index
Not frequency in Hz !!
Example
Matlab simulation:
1- Time sampling => spectrum periodization !! Scales (time and frequencies) !!
Fourier Transform (FT) 1- FT of the sampled signal
DFT modulus:
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure; plot(linspace(0,Fe,length(X)),abs(X))
0 100 200 300 400 500 600 700 800 900 10000
5
10
15
20
25
30
35
40
45
50
+ -
Frequency (Hz)
0 Fe
f0 Fe-f0
f0 = 100 Hz
Two cosine? No only one !
Example
Matlab simulation:
1- Time sampling => spectrum periodization !! Scales (time and frequencies) !!
Fourier Transform (FT) 1- FT of the sampled signal
DFT modulus:
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure; plot(linspace(-Fe/2,Fe/2,length(X)),fftshift(abs(X))) -500 -400 -300 -200 -100 0 100 200 300 400 5000
5
10
15
20
25
30
35
40
45
50
Frequency (Hz)
0 f0- f0 Fe/2- Fe/2
The spectrum is centered
around 0
Example
Matlab simulation:
1- Time sampling => spectrum periodization !! Scales (time and frequencies) !!
Fourier Transform (FT) 1- FT of the sampled signal
2- Digital of limited duration [0, L]
Example
0 10 20 30 40 50 60 70 80 90 100-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x Truncation window
Signal of finite duration
Signal of infinite duration
2- FT of the time limited signalFourier Transform (FT)
FT of the time unlimited signal:
FT of the time limited signal * FT of the truncation window:
2- Signal of limited duration [0, L] !! Spectrum (DFT) distortion !!
Example
Fourier Transform (FT) 2- FT of the time limited signal
Example 1 Example 2Sum of two cosines with close frequencies
=> Only one cosine !!
Arising problems:
=> Only one cosine !!
Sum of two cosine with very different powers
Limited separating power Ripples around transitions
2- Signal of limited duration [0,L] !! Spectrum (DFT) distortion !!
Fourier Transform (FT) 2- FT of the time limited signal
Example
0 10 20 30 40 50 60 70 80 90 100-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x Truncation window of
length T : w(t)
Signal of limited
duration
Unlimited Signal FT
…
Sinus
cardinal
…
Separating power
Ripple
amplitudes
2- Signal of limited duration [0,L] !! Spectrum (DFT) distortion !!
Fourier Transform (FT) 2- FT of the time limited signal
0 10 20 30 40 50 60 70 80 90 100-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x Truncation window
on N samples: w(k)
FT
……xxx… x
Dirichlet Core
Ripple
amplitudes
Example
2- TF signal échantillonné et de durée limitée
1+2- Sampled and time limited signal !! Spectrum (DFT) distortion !!
2- FT of the sampled and time limited signalFourier Transform (FT)
Signal of limited
duration
Unlimited Signal
Separating power
Sinus
cardinal
Example
0 10 20 30 40 50 60 70 80 90 100-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
x RECTANGULAR truncation window
Signal of limited duration
Unlimited signal
rectangulaireHammingBlackman
Use other truncation
windows (weight windows) ?
2- TF signal échantillonné et de durée limitée
1+2- Sampled and time limited signal !! Spectrum (DFT) distortion !!
2- FT of the sampled and time limited signalFourier Transform (FT)
-0.08 -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 0.1-8
-7
-6
-5
-4
-3
-2
-1
0
1
2
Tracés des TF des fenêtres de troncature
rectangulaire
Hamming
Blackman
Use other truncation windows (weight windows) ?
Examples
0 10 20 30 40 50 60 70 80 90 1000
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1Tracés des fenêtres de troncature
rectangulaire
Hamming
Blackman
Several separating power
Several amplitudes for
the associated ripples
2- TF signal échantillonné et de durée limitée
1+2- Sampled and time limited signal !! Spectrum (DFT) distortion !!
2- FT of the sampled and time limited signalFourier Transform (FT)
Rectangular
Hamming
Blackman
Digital weight windows |FT| of digital weight windows
Rectangular
Hamming
Blackman
Example 1
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
101
fenetre naturelle
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110
-2
100
fenetre de Hamming
%Example1
%Parameters
f1=200; %frequency for cosine 1
f2=207; % frequency for cosine 2
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x1=cos(2*pi*f1*[0:Te:N*Te]);
x2=cos(2*pi*f2*[0:Te:N*Te]);
%Rectangular window
x=x1+x2;
X_V1=fft(x,4096);
%Hamming window
w=window(@hamming,length(x));
x=(x1+x2).*w.';
X_V2=fft(x,4096);
%Plots
figure
subplot(2,1,1)
plot(linspace(0,1,4096),log10(abs(X_V1)));
title(‘Rectangular window');
subplot(2,1,2)
plot(linspace(0,1,4096),log10(abs(X_V2)));
title('Hamming window');
Use other truncation windows (weight windows) ?
2- TF signal échantillonné et de durée limitée
2- Sampled and time limited signal !! Spectrum (DFT) distortion !!
2- FT of the sampled and time limited signalFourier Transform (FT)
Sum of two cosines with close frequencies
Rectangular window
Hamming window
%Example 2
%Paramètres
f1=200; %frequency for cosine 1
f2=320; % frequency for cosine 2
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x1=cos(2*pi*f1*[0:Te:N*Te]);
x2=0.005*cos(2*pi*f2*[0:Te:N*Te]);
x=x1+x2;
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
100
fenetre naturelle
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
100
fenetre de Hamming
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
100
fenetre de Blackman
Example 2Sum of two cosine with very different powers
%Rectangular window
X=fft(x,4096);
figure
subplot(3,1,1)
semilogy(linspace(0,1,4096),abs(X));
axis([0 1 10^-5 10^5])
title(‘Rectangular window');
%Hamming window
w=window(@hamming,length(x));
x=(x1+x2).*w.';
X=fft(x,4096);
subplot(3,1,2)
semilogy(linspace(0,1,4096),abs(X));
title('Hamming window');
%Blackman window
w=window(@blackman,length(x));
%w=blackman(N);
x=(x1+x2).*w.';
X=fft(x,4096);
subplot(3,1,3)
semilogy(linspace(0,1,4096),abs(X));
title('Blackman window');
Use other truncation windows (weight windows) ?
2- TF signal échantillonné et de durée limitée
2- Sampled and time limited signal !! Spectrum (DFT) distortion !!
2- FT of the sampled and time limited signalFourier Transform (FT)
Rectangular window
Hamming window
Blackman window
Example 3
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
100
Fréquences normalisées
|X(f
)|
fenetre naturelle
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110
-2
100
102
Fréquences normalisées
|X(f
)|
fenetre de Hamming
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
100
Fréquences normalisées
|X(f
)|
fenetre de Blackman
Signal ???
2- TF signal échantillonné et de durée limitée
2- Sampled and time limited signal !! Spectrum (DFT) distortion !!
2- FT of the sampled and time limited signalFourier Transform (FT)
Rectangular window
Hamming window
Blackman window
Normalized frequency
Normalized frequency
Normalized frequency
Example 3
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
100
Fréquences normalisées
|X(f
)|
fenetre naturelle
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 110
-2
100
102
Fréquences normalisées
|X(f
)|
fenetre de Hamming
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
100
Fréquences normalisées
|X(f
)|
fenetre de Blackman
3 cosines
with the same power
Proposed solution: Use SEVERAL truncation (or weight) windows for one analysis
2 cosines
with the same power
but something is strange…
3 cosines
with different powers
+ -
4 cosines:
3 with the same power
1 with a lower power
2- TF signal échantillonné et de durée limitée
2- Sampled and time limited signal !! Spectrum (DFT) distortion !!
2- FT of the sampled and time limited signalFourier Transform (FT)
Rectangular window
Hamming window
Blackman window
Normalized frequency
Normalized frequency
Normalized frequency
Fourier Transform (FT)
3- Frequency sampling
Example
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x);
%Visualization of the DFT modulus
figure;
plot(linspace(0,Fe,length(X)),abs(X))
Matlab simulation:
0 100 200 300 400 500 600 700 800 900 10000
5
10
15
20
25
30
35
40
45
50
Two cosine ? No only one !
Plot of the DFT modulus:
+ -
Frequency (Hz)
0 Fe
f0 Fe-f0
But where are
the Dirichlet cores ???
Digital Fourier Transform (DFT)
Example
DFT modulus
f (Hz)f0 Fe-f00
Fe/N
f (Hz)f0 Fe-f00
Fe/N
DFT modulus
Fourier Transform (FT)
3- Frequency sampling !! Bad spectrum visualization !!
Digital Fourier Transform (DFT)
Mdulus of X(n)
f (Hz)f0 Fe-f00
Fe/N
Proposed solution: interpolation with Zero Padding
xx
x
x
x
x
x
xx
x
x
x
xx
xx
xxx
xxxx
xxxx
x
xxxx
xx
xx
x
x
x
x
x
N points spaced from Fe/N between 0 and Fe
Example
Modulus of Y(n)
f (Hz)f0 Fe-f00
Fe/N
xx
x
x
x
x
x
xx
x
x
x
xx
xx
xxx
xxxx
xxxx
x
xxxx
xx
xx
x
x
x
x
x
Fe/MN
MN points spaced from Fe/MN between 0 and Fe
Fourier Transform (FT)
3- Frequency sampling !! Bad spectrum visualization !!
Digital Fourier Transform (DFT)
0 100 200 300 400 500 600 700 800 900 10000
5
10
15
20
25
30
35
40
45
50
Exemple
Two cosine? No only one !
DFT modulus:
+ -
Frequency (Hz)
0 Fe
f0 Fe-f0
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot(x)
%Computation of the signal DFT
X=fft(x,128);
%Visualization of the DFT modulus
figure;
plot(linspace(0,Fe,length(X)),abs(X))
Here are
the Dirichlet cores !
Fourier Transform (FT)
3- Frequency sampling !! Bad spectrum visualization !!
Digital Fourier Transform (DFT)
Proposed solution: interpolation with Zero Padding
Matlab simulation:
0 500 10000
20
40
60
Fréquences (Hz)
|TF
D(x
)|
sans ZP
0 500 10000
20
40
60
Fréquences (Hz)
|TF
D(x
)|
ZP : 128
0 500 10000
20
40
60
Fréquences (Hz)|T
FD
(x)|
ZP : 256
0 500 10000
20
40
60
Fréquences (Hz)
|TF
D(x
)|
ZP : 512
Example
% Plots of the DFT modulus
figure;
subplot(2,2,1)
plot(linspace(0,Fe,length(X1)),abs(X1))
xlabel(‘Frequency (Hz)’)
subplot(2,2,2)
plot(linspace(0,Fe,length(X2)),abs(X2))
xlabel(‘Frequency (Hz)’)
subplot(2,2,3)
plot(linspace(0,Fe,length(X3)),abs(X3))
xlabel(‘Frequency (Hz)’)
subplot(2,2,4)
plot(linspace(0,Fe,length(X4)),abs(X4))
xlabel(‘Frequency (Hz)’)
Plots of the DFT modulus
For several value of the Zero Padding parameter:
%Parameters
f0=100; %cosine frequency
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]);
%Signal plotting
figure; plot([0:Te:N*Te],x)
%Computation of the DFT
X1=fft(x);
X2=fft(x,128);
X3=fft(x,256);
X4=fft(x,512);
Zero Padding
parameter
Fourier Transform (FT)
3- Frequency sampling !! Bad spectrum visualization !!
Digital Fourier Transform (DFT)
Proposed solution: interpolation with Zero Padding
Matlab simulation:no
Frequency (Hz)
Frequency (Hz) Frequency (Hz)
Frequency (Hz)
3- Frequency sampling => signal periodization
!! A product is changed into a circular convolution product by DFT or DFT-1 !!
Inverse Fourier transform (FT-1) Digital inverse Fourier transform(DFT-1)
DFT DFT-1
x(k) is periodical of period N
Linear (« classical ») convolution:
Circular convolution:
Fourier Transform (FT) Digital Fourier Transform (DFT)
x(k) is periodical of period N
Linear convolution: Circular convolution:
. . . 0 0 0 1 2 3 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .. . . 0 0 0 1 1 1 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .. . . 0 0 0 1 1 1 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .. . . 0 0 0 1 1 1 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .
0136530
x1(p) :
x2(k-p) : p=-3p=-2p=-1p=0p=1p=2p=3
. . . 0 0 0 1 1 1 0 0 0 . . .x2(p) :. . . 1 2 3 1 2 3 1 2 3 . . .
. . . 1 1 1 1 1 1 1 1 1 . . .. . . 1 1 1 1 1 1 1 1 1 . . .
. . . 1 1 1 1 1 1 1 1 1 . . .. . . 1 1 1 1 1 1 1 1 1 . . .
. . . 1 1 1 1 1 1 1 1 1 . . .. . . 1 1 1 1 1 1 1 1 1 . . .
. . . 1 1 1 1 1 1 1 1 1 . . .
6666666
p=-3p=-2p=-1p=0p=1p=2p=3
. . . 1 1 1 1 1 1 1 1 1 . . .
x1(pmodulo N) :
x2(pmodulo N) :
Example (N=3)
Fourier Transform (FT) Digital Fourier Transform (DFT)
3- Frequency sampling => signal periodization !! Circular convolution = linear convolution !!
Linear convolution = circular convolution
. . . 0 0 0 1 2 3 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .. . . 0 0 0 1 1 1 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .. . . 0 0 0 1 1 1 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .. . . 0 0 0 1 1 1 0 0 0 . . .
. . . 0 0 0 1 1 1 0 0 0 . . .
0136530
. . . 0 0 0 1 1 1 0 0 0 . . .
01
6530
. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .
. . . 1 2 3 0 0 0 1 2 3 0 0 0 1 2 3 0 0 0. . .
. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .
. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .
. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .
. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .. . . 1 1 1 0 0 0 1 1 1 0 0 0 1 1 1 0 0 0 . . .
3
0
By adding N zeros
Example (N=3)
Fourier Transform (FT) Digital Fourier Transform (DFT)
3- Frequency sampling => signal periodization
x(k) is periodical of period N
Digital Fourier Transform (DFT)Inverse Digital Fourier Transform (DFT-1)
4- DFT properties:
→ Linearity
→ Translation => phase rotation
→ Hermitic symetry
→ Circular convolution
→ Parseval equality
→ Fast Fourier Transform Algorithm (FFT) for a lower computation time: Nlog2(N)<<N2 for a DFT (or DFT-1) on N points
5- An algorithm to reduce the computation time : Cooley Tuckey FFT (Fast Fourier Transform)
Even indexes
(DFT of order N/2)
…
DFT of order N = 2p : N2 (+/x) operations
First decomposition: N+2(N/2)2 << N2 (+/x) operations
Second decomposition: 2(N/2)+4(N/4)2 (+/x) operations
Odd indexes
DFT of order N/2
4 DFTs of order N/4
Np DFT of order 2 = N log2(N) (+/x) operations
Even indexes Odd indexes Even indexes Odd indexes
Digital Fourier Transform (DFT)Inverse Digital Fourier Transform (DFT-1)
N (+/x) operations
→ Time sampling => spectrum periodization- Respect Shannon condition
- Pay attention to the way you read the spectrum and the scales (in time and frequency)
→ Signal of limited duration => spectrum distortion- Use several weight windows for one signal analysis
=> several separating powers and amplitudes for the ripples appearing in the frequency domain
→Frequency sampling => signal periodization- Pay attention to the lecture of the spectrum
=> use the zero padding interpolation technique to have a good visualization
- DFT and DFT-1 convert a product into a circular convolution product
=> if a linear convolution is required: linear convolution = circular convolution thanks to zero padding
→FFT = Fast Fourier Transform algorithm- Condition N=2p => decomposition of the DFT into interlaced subseries
- Processing time: Nlog2(N) << N2
Digital Fourier Transform (DFT)Inverse Digital Fourier Transform (DFT-1)
Chapter 3
Digital auto and cross
correlation functions
Nathalie Thomas
Digital Signal Processing
Master SpaceCOM
2018-2019
-0.1 -0.08 -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 0.1-60
-40
-20
0
20
40
60
Temps (s)
Rx
Example
%Parameters
f0=100; %frequency of the cosine
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]+rand*2*pi);
% Computation and plotting of the biased
% autocorrelation
Rx=xcorr(x);
figure; plot([-N*Te:Te:N*Te],Rx);
xlabel('Time (s)'); ylabel('R_x')
Matlab simulation: ??
(Hermitic symetry)
Time (s)
-0.1 -0.08 -0.06 -0.04 -0.02 0 0.02 0.04 0.06 0.08 0.1-60
-40
-20
0
20
40
60
Temps (s)
Rx
Multiplicative
Triangular bias
BIAISED estimator
Example
%Parameters
f0=100; %frequency of the cosine
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
%Signal generation
x=cos(2*pi*f0*[0:Te:N*Te]+rand*2*pi);
% Computation and plotting of the biased
% autocorrelation
Rx=xcorr(x);
figure; plot([-N*Te:Te:N*Te],Rx);
xlabel('Time (s)'); ylabel('R_x')
Matlab simulation:
(Hermitic symetry)
Time (s)
UNBIASED estimator
High variance
on the sidesMatlab simulation:
%Parameters
f0=100; %frequency of the cosine
Fe=1000; %sampling frequency
Te=1/Fe; %sampling period
N=100; %number of generated samples
% Computation and plotting of the unbiased
% autocorrelation for several signal realizations
x1=cos(2*pi*f0*[0:Te:N*Te]+rand*2*pi);
Rx1=xcorr(x1,'unbiased');
x2=cos(2*pi*f0*[0:Te:N*Te]+rand*2*pi);
Rx2=xcorr(x2,'unbiased');
x3=cos(2*pi*f0*[0:Te:N*Te]+rand*2*pi);
Rx3=xcorr(x3,'unbiased');
figure
plot(Rx1); hold on; plot(Rx2,'r'); plot(Rx3,'g')
legend('realization 1','realization 2','realization3')
xlabel('Time (s)'); ylabel('R_x')
Example
0 20 40 60 80 100 120 140 160 180 200
-0.5
0
0.5
1
Temps (s)R
x
réalisation 1
réalisation 2
réalisation3
zooms
175 180 185 190 195 200 205 210-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Temps (s)
Rx
réalisation 1
réalisation 2
réalisation3
2 4 6 8 10 12 14
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Temps (s)R
x
réalisation 1
réalisation 2
réalisation3
(Hermitic symetry)
Time (s)
Time (s)Time (s)
realization 1
realization 2
realization 3
1 – Time domain estimation (biased or unbiased)
2- Frequency domain estimation
Processing time ~ N2 (+/x) operations
Linear convolution:
Processing time for the computation of a digital cross correlation function
If:
And:
then:
Processing time: N+3Nlog2(N) (+/x) operations
The frequency domain estimation allows to reduce the pocessing time:
N+3Nlog2(N) << N2 (+/x) operations
DFT
BUT
!! Signals are periodical !!
If:
- we can put an infinite sum in the expression of Rxy(k) instead of 0,…, N-1
- the DFT converts a linear convolution product into a product
Chapter 4
Power Spectral Density
(PSD)
Nathalie Thomas
Digital Signal Processing
Master SpaceCOM
2018-2019
→ Periodogram
→ Correlogram
→ Drawback: inconsistent estimators
• Convolutive bias:
• The variance does not depend on the signal observation length:
Two basic estimators
Note: périodogram biased correlogram
Fejer core :
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
20
40
60
80
100
120
140
Frequences normaliséesNormalized frequency
Examples:
0 100 200 300 400 500 600 700 800 900 1000-0.5
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
Temps
x(t)
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-0.5
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
Temps
x(t)
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
Fréquences normalisées
DS
P
DSP simulée
DSP théorique10 000 signal samples
1 000 signal samples
Two basic estimators
Normalized frequency
Normalized frequency
PS
DP
SD
Simulated PSD
Theoretical PSD
Simulated PSD
Theoretical PSD
Modified versions
Objective: reduce the estimation variance when the signal observation length increases
→ Cumulative periodogram (Bartlett) :
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000-0.5
-0.4
-0.3
-0.2
-0.1
0
0.1
0.2
0.3
0.4
0.5
Temps
x(t)
…
LN=ML
→ Cumulative periodogram (Bartlett) :
Examples :
Drawback: for a given signal observation length, the bias increases when the variance is reduced
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
1
2
3
4
5
6
7
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
N= 10 000 samples, 1 window
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
N= 10 000 samples, M=10 windows
of L= 1000 samples
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
N= 100 000 samples, M=100 windows
of L=1 000 samples
Example :
(N=100, M=1) => (N=100, M=10, L=10)
Fejer core:
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
Frequences normalisées
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
10
20
30
40
50
60
70
80
90
100
Frequences normalisées
100 samples 10 samples
2/N
Modified versions
Normalized frequency
PS
D
Normalized frequency
PS
D
Normalized frequency
PS
D
Normalized frequency Normalized frequency
Simulated PSD
Theoretical PSDSimulated PSD
Theoretical PSD
Simulated PSD
Theoretical PSD
→ Modified periodogram:
→ Modified correlogram:
Drawback: abrupt variations are smoothed, the separating power is reduced
→ Welch periodogram = cumumative and modified periodogram
- Sliding window => M’ > M windows of length L allowed to overlap
- Modified periodogram on each signal section
- Example:
Weigth window
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
N= 100 000 samples
M=100 windows
of L=1 000 samples
M=100 windows of L=1 000 samples
Overlapping = L/2, Hamming windowing
Modified versions
Simulated PSD
Theoretical PSD
Simulated PSD
Theoretical PSD
Normalized frequency Normalized frequency
PS
D
PS
D
→ Examples of cumulative periodograms:
→ Welch periodogram:(overlapping = L/2)
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
1
2
3
4
5
6
7
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
K= 10 000 samples,
1 window
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
K= 10 000 samples, M=10 windows
of L= 1000 samples
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
K= 100 000 samples, M=100 windows
of L=1 000 samples
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
1.6
1.8
2
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
-0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.50
0.2
0.4
0.6
0.8
1
1.2
1.4
Fréquences normalisées
DS
P
DSP simulée
DSP théorique
Modified versions
Simulated PSD
Theoretical PSD
Simulated PSD
Theoretical PSDSimulated PSD
Theoretical PSD
Simulated PSD
TheoreticalPSDSimulated PSD
Theoretical PSD
Normalized frequency
Normalized frequency Normalized frequency
Normalized frequency Normalized frequency
PS
D PS
D
PS
D
PS
D
PS
D
Chapter 5
Digital Filtering
Nathalie Thomas
Digital Signal Processing
Master SpaceCOM
2018-2019
→ Definition :
→ Analysis of ANALOG linear time invariant systems
o Time analysis (step response, ramp response): stability (poles of H(p) with negative real parts), rapidity (rise time, settling
time), precision (static error, following error)
o Frequency analysis (response to a sinusoidal input) : Bode diagrams=> cutoff frequency, bandpass, stopband attenuation,
resonnance …
o Example :
-90°w0
Step response
Analog linear time invariant filters
A TOOL FOR THEIR STUDY: THE LAPLACE TRANSFORM
Reminders
Transfer function
Frequency
response
Bode diagram
→ Definition:
→ Analysis of DIGITAL linear time invariant systems
o Main properties:
• Linearity:
• Time shift:
• Convolution product:
o Existence:
o inversion:
o Note: tables of ZT exist
Digital linear time invariant filters
A TOOL FOR THEIR STUDY: THE Z-TRANSFORM
→ Linearity:
→ Time invariance:
→ Impulse response and transfer function:
→ Frequency response and group propagation time (GPT)
Note:
Filter
Filter
Filter
Filter Filter
Filter
Impulse
response
Transfer fonction
Digital impulse
(Kronecker symbol)
Frequency
responseGPT
Digital linear time invariant filters
DEFINITIONS
→ Three conditions on the impulse response:
o Causality:
o Stability:
o Real impulse response:
Digital linear time invariant filters
REALISABILITY
→ By analogy with analog filters:
Example :
→ Digital filters definition:
→ IIR filters = INFINITE IMPULSE RESPONSE filters:
x(t) y(t)
R
C
i(t)
+
Differential equation in the time domain
Rationnal transfer function in p-domain
RATIONNAL transfer function in z-domain
Recurrence equation in the time domain
(Note: )
Closed-loop system
%filtering with Matlab
y=filter(B,A,x);
Definition of the
wanted filter (two sets
of coefficients)
Filtered signal Signal to filter
Digital linear time invariant filters
RATIONNAL FILTERS
Filtres numériques linéaires invariants dans le temps
STABILITE DES FILTRES RATIONNELS DE TYPE RII
→ Condition on the poles of the transfer function:
→ Condition on the coefficients :
o 1st order filters
o 2nd order filters
(hypothesis : N<M)
(causal solution(1))
(1)) The inverse ZT is not unique. It will be different depending on the chosen closed curve to compute it: see exercises (http://thomas.perso.enseeiht.fr/teaching.html).
Stability condition
for the digital rationnal filters
1
- 1
- 1 1 2- 2
Stable filter
Unstable filter
Stability triangle
for 2nd order IIR filters
Stability condition for the 1st order IIRs
Stability condition for the 2nd order IIRs
Digital linear time invariant filters
IIR STABILITY
→ Defined by:
o Always stables
o Only defined by one set of coefficients bk, k=0, …, N-1
Non-recursive filters
%Filtering with Matlab
y=filter(B,1,x);
Definition of the wanted
FIR filter (only one
set of coefficients)
Filtered signal Signal to filter
Digital linear time invariant filters
FINITE IMPULSE RESPONSE FILTERS (FIR)
Specifications to follow:
TEMPLATE
COEFFICIENTS
defining a filter compliant with the given specifications
SYNTHESIS
IMPLANTATION on Matlab : IMPLANTATION in real time:
y=filter(B,A,x);
Filtered signalSignal to filter
Sets of coefficients
defining the filter to be used
IIR filter
To be computed in Te seconds
(sampling period)
Note: A=[1] for FIR filters
FIR filter
Digital linear time invariant filters
RATIONAL FILTERS: SYNTHESIS AND IMPLEMENTATION
Low-pass filter High-pass filter Band-pass filter Notch filter
→ Ideal target frequency responses:
→ Template to follow:
o On the modulus of the frequency response
Examples :
o On the phase of the frequency response: phase or all-pass filter.
BandpassCutted
bandwidth
Transition
area
BandpassBandpassCutted
bandwidth
Transition
area
Transition
area
Cutted
bandwidth
LOW-PASS filter HIGH-PASS filter
Digital linear time invariant filters
THE TEMPLATE
Transition
area
Low-pass filter High-pass filter Band-pass filter Notch filter
→ Ideal target frequency responses:
→ Template to follow:
o On the modulus of the frequency response
Examples :
o On the phase of the frequency response: phase or all-pass filter.
Digital linear time invariant filters
THE TEMPLATE
Bandpass
Cutted
bandwidth
Transition
area
Transition
area
Cutted
bandwidth
Low-pass filter
LINEAR SCALE
Bandpass Cutted
bandwidth
Transition
area
Low-pass filter
LOGARITHM SCALE (dBs)
COEFFICIENTS
OF A FILTER following the given specifications
IIR filter
To be computed in Te seconds
(sampling period)
FIR filter
There is not only one filter
following the template
FIR synthesis
IIR synthesis
Two different
methods
Digital linear time invariant filters
RATIONAL FILTERS: SYNTHESIS AND IMPLEMENTATION
Specifications to follow:
TEMPLATE
SYNTHESIS
IMPLANTATION on Matlab : IMPLANTATION in real time:
y=filter(B,A,x);
Filtered signalSignal to filter
Sets of coefficients
defining the filter to be used
Note: A=[1] for FIR filters
Specifications:
TEMPLATE
COEFFICIENTS
SYNTHESIS
→ Example: DIGITAL low-pass filter
+
+
+
+
++
++
++
++
+
+
+
++
++
++
++
Frequency periodisation
Sampling
Signal limitation
to N coefficients
Distortions :- Transitions are smoothed
- Ripples appear around
FILTER ORDER
Digital linear time invariant filters
FIR SYNTHESIS
+
+
+
+
++
++
++
++
+
+
+
++
++
++
++
+
+
+
+
++
++
++
++
+
+
+
++
++
++
++
Introduction of a delay
Non causal filter:
Causal filter:(Hyp : N is odd)
→ Example: DIGITAL low-pass filter
Digital linear time invariant filters
FIR SYNTHESIS
Specifications:
TEMPLATE
COEFFICIENTS
SYNTHESIS
0 50 100 150 200 250
-1
0
1
signal filtré
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-60
-40
-20
0
20
Normalized Frequency (p rad/sample)
Pow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal filtré
+
+
+
+
++
++
++
++
+
+
+
++
++
++
++
0 20 40 60 80 100 120 140 160 180
-1
0
1
signal filtré
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-60
-40
-20
0
20
Normalized Frequency (p rad/sample)P
ow
er/
frequency (
dB
/rad/s
am
ple
)
spectre du signal filtré
+
+
+
+
++
++
++
++
+
+
+
++
++
++
++
Introduction of a delay between the input
and the output signals:
Introduction of a delay
in the impulse response:
+++
++++
+++++
++++
++++++++
(Hyp : odd order)
(Hyp: N is odd)
(Hyp: N is odd)
(order = 81)
(order = 201)
→ Example: CAUSAL DIGITAL low-pass filter
Digital linear time invariant filters
FIR SYNTHESIS
Filtered signal
Filtered signal
+
+
+
+
++
++
++
++
+
+
+
++
++
++
++
(Hyp : N is odd)
Constant if h(n) odd or even
The GPT for FIR filters
is constant
If h(n) is odd or even
A constant value is added to the GPT:
→ Example: CAUSAL DIGITAL low-pass filter
Digital linear time invariant filters
FIR SYNTHESIS
→ Parameters allowing to follow the template: ORDER and WEIGTH WINDOW
-200 -150 -100 -50 0 50 100 150 200 250
0.2
0.4
0.6
0.8
1
1.2
Fréquences (Hz)
H(f
)
Ordre = 51
Ordre = 101
Ordre = 201
-500 -400 -300 -200 -100 0 100 200 300 400 50010
-8
10-6
10-4
10-2
100
102
Fréquences (Hz)
H(f
)
Fenêtre rectangulaire
Fenêtre de Hamming
Fenêtre de Blackman
→ Order influence
(rectangular window)→ Truncation window influence
(order = 21)
Transitions are more
or less attenuatedThe ripples amplitudes
are more or less important
Digital linear time invariant filters
FIR SYNTHESIS
Frequency (Hz) Frequency (Hz)
Order = 51
Order = 101
Order = 201
Rectangular window
Hamming window
Blackman window
Analog patterns library:Butterworth, Tchebycheff,
Cauer, Bessel…
Specifications to follow:
H ( f )
Transfer function:
H ( p )
Specifications to follow:
H ( f )~
Transfer function:
H ( z )
?
?
𝑓 = ሚ𝑓𝐹𝑒
BILINEAR TRANSFORM:
The stability and the frequency response are kept
𝐻 𝑧 = 𝐻(𝑝)𝑝=
2𝑇𝑒
1−𝑧−1
1+𝑧−1
ሚ𝑓 =1
𝜋arctan(𝜋𝑓𝑇𝑒)
BUT the frequency axis is distorded:
𝑓 =1
𝜋𝑇𝑒tan(𝜋 ሚ𝑓)
Predistorsion
→ An example of IIR synthesis is given in the exercises document (http://thomas.perso.enseeiht.fr/teaching.html)
Digital linear time invariant filters
IIR SYNTHESIS
Specifications:
TEMPLATE
COEFFICIENTS
SYNTHESIS
→ Direct structure → Canonic structure
M+N+1 (+/x) operations, 2 delayed lines
M+N+1 (+/x) operations, 1 delayed line
Digital linear time invariant filters
RATIONAL FILTERS IMPLANTATION
→ Decomposed structures
→ Series (or cascade) :
→ Non recursive structure (FIR)
Hi(z) : first or second order cells
→ Parallel :
Digital linear time invariant filters
RATIONAL FILTERS IMPLANTATION
To go further
Some references:
→ Digital Signal Processing: Course and exercices with solutions, by Nathalie Thomas,
ENSEEIHT documentation : http://thomas.perso.enseeiht.fr/teaching.html
→ Signal and Systems, by Simon Haykin and Barry Von Veen, Wiley
→ Digital Signal Processing, by Alan V. Oppenheim, Ronald W. Schafer, Prentice-Hall.
→ Documents on complex variable, Laplace transform, z tranform :
http ://dobigeon.perso.enseeiht.fr/teaching.html