Beruflich Dokumente
Kultur Dokumente
Introduction
Domaines dapplication :
communication, aronautique, astronautique, acoustique, contrle de processus
chimique, ingnierie biomdicale, traitement de la parole, conomie, mtorologie...
information reprsente sous forme de signal
Signal :
fonction de une ou plusieurs variables indpendantes : f(x,y,z)
reprsente / contient information sur un phnomne (physique)
Types de signaux
Signaux continus: f(t), t R Signaux discrets: f[n], n Z
t
n
Dimension du signal :
1D : f(t) f[n]
2D :f(u,v) f[i,j]
3D : f(u,v,w) f[i,j,k]
etc...
5
SIGNAL ?
Mesures
Capteur, statistiques....
Dveloppement des capteurs : microphone, cramiques pizolectriques, antennes,
capteurs CCD, de pression
Capteur
t
Acquisition numrique :
Capteur Echantillonnage
t
Stockage
Traitement numrique par ordinateur
Perte dinformation ?
Importance des techniques numriques
6
EXEMPLES DE SIGNAUX
Signal de parole
0.4
0.3
amplitude
0.2
0.1
e
0
-0.1
-0.2
-0.3
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35
Temps (s)
0.6
0.4
amplitude
0.2
-0.2
-0.4 b on j ou r
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
Temps (s)
7
EXEMPLES DE SIGNAUX
Dbut de la
100% campagne de Russie Napolon
Victoire sur la Russie Friedland dbarque
Trait de Tilsit avec la Russie
90 Golfe Juan
0
1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815
Le Monde 28/01/1997
8
EXEMPLES DE SIGNAUX
400
350
300
250
200
150
100
50
Signaux ultrasonores
Composante spculaire Composante diffuse
mission
Rception
t t
Signal rel
10
EXEMPLES DE SIGNAUX
Plaque artrielle
12
EXEMPLES DE SIGNAUX
Tomographie X
14
EXEMPLES DE SIGNAUX
Tomographie X
16
TRAITEMENT DU SIGNAL ?
Buts :
Modlisation : reprsentation dun phnomne (caractrisation, prdiction...)
Analyse : extraction dinformation (mesure, compression, dtection, reconnaissance...)
Filtrage, restauration : transformation du signal (minimisation du bruit, suppression de
parasite...)
Etc.
Systme de
t Traitement t
Imagerie ultrasonore
N Signaux
Image ?
18
EXEMPLES DE TRAITEMENT
Signaux acquis
Dtection
d'enveloppe Enveloppe
Compression
logarithmique Image Compresse
19
EXEMPLES DE TRAITEMENT
0.4
amplitude
0.2
-0.2
-0.4 b on j ou r
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9
Temps (s)
20
EXEMPLES DE TRAITEMENT
Dtection de rupture
Cas idal Cas rel avec bruit gaussien ( = 0.4)
2 2
1 1
0 0
-1 -1
-2 -2
0 5 10 15 20 0 50 100 150 200 250
2 2
1 1
0 0
-1 -1
-2 -2
0 5 10 15 20 0 50 100 150 200 250
22
EXEMPLES DE TRAITEMENT
Dtection de rupture
Cas rel avec bruit gaussien ( = 0.4)
2
-1
-2
0 50 100 150 200 250
Oprateur optimis :
Oprateur diffrentiel : [ 1 -1 ]
Canny[86] Deriche[87]
2 4
3
1
2
0
1
-1
0
-2 -1
0 50 100 150 200 250 0 50 100 150 200 250
23
EXEMPLES DE TRAITEMENT
Dtection de rupture
Cas rel avec bruit gaussien ( = 1.0) Cas rel avec bruit gaussien ( = 1.2)
4 4
2 2
0 0
-2 -2
-4 -4
0 50 100 150 200 250 0 50 100 150 200 250
Oprateur optimis :
6 4
4
2
2
0
0
-2
-2
-4 -4
0 50 100 150 200 250 0 50 100 150 200 250
24
EXEMPLES DE TRAITEMENT
||2
Bords horizontaux
25
EXEMPLES DE TRAITEMENT
Dtection de contour par ensemble de niveau bas sur les drives (gradient)
Ensemble de niveau:
Evolution base sur le
Principe dvolution
gradient dune image IRM
26
EXEMPLES DE TRAITEMENT
Sang
Muscle
Histogramme
Histogramme
27
EXEMPLES DE TRAITEMENT
Visualisation de linformation ?
29
EXEMPLES DE TRAITEMENT
N
30
EXEMPLES DE TRAITEMENT
Signaux de base
Retournement
f(t) f(-t)
f[n] f[-n]
34
TRANSFORMATIONS DE LA VARIABLE INDEPENDANTE
Changement dchelle
f(t) f(2t)
f[n] f[2n]
35
TRANSFORMATIONS DE LA VARIABLE INDEPENDANTE
Dcalage temporel
t0 -t 0
n0 -n0
=
Signal sinusodal : f (t ) A cos(2 f 0t + )
T 0 = 1 /f0
A Acos
Variation de la frquence f0 :
f1 f2 f3
f1 < f2 < f3
38
SIGNAUX DE BASE CONTINUS
cos 2f0t Re
chelon unit
1
0 si t < 0
u(t) =
1 si t > 0
+
du(t )
Impulsion unit (ou Dirac) : (t) on veut (t ) =
dt
avec
(t )dt = 1
u(t) 1 (t)
(t) = lim (t) 1/
0 Aire = 1
1
Reprsentation C
t0
40
SIGNAUX DE BASE CONTINUS
Dirac : interprtation
(t) (t)
Intervalle Intervalle
dintgration dintgration
t 0 0 t
t t
( )d = 0 si t < 0 ( )d = 1 si t > 0
1
u(t)
+
Dirac : Proprit
(t )dt = 1
(t-t0) x(t0)(t-t0)
x(t) x(t)
t0 t0
42
SIGNAUX DE BASE CONTINUS
+
Dirac : Proprit
x (t ) (t )dt = x (0)
+
Dirac : Proprit
x (t ) (t t0 )dt =
x (t0 )
43
SIGNAUX DE BASE CONTINUS
t2
2
nergie moyenne calcule sur lintervalle [t1, t2] : Es (t1, t2 ) = s(t ) dt
t1
t2
Puissance moyenne calcule sur lintervalle [t1, t2] : 1
2
Ps (t1, t2 ) = s(t ) dt
Interprtation : nergie dissipe par unit de temps t2 t1
t1
44
SIGNAUX DE BASE DISCRETS
chelon unit 1
0 si n < 0
u[n] = .......
1 si n 0
0
1
1 si n = 0
Impulsion unit : on dfinit [n] =
0 si n 0
n
consquences u[n ] = [m ] et [n ] = u[n ] u[n 1]
m =
+ +
Proprits
[n ] = 1 x[n ] [n ] = x[0]
n = n =
x[n] [n] = x[0] [n] +
0.5 0 0
0 -1 -1
0 10 20 30 0 10 20 30 0 10 20 30
frquence = 1/4 frquence = 1/2 frquence = 3/4
1 1 1
0 0 0
-1 -1 -1
0 10 20 30 0 10 20 30 0 10 20 30
frquence = 7/8 frquence = 15/16 frquence = 1
1 1 1
0 0 0.5
-1 -1 0
0 10 20 30 0 10 20 30 0 10 20 30
46
SIGNAUX DE BASE DISCRETS
Exponentielles discrtes
e j 2f 0n = cos 2f 0n + j sin 2f 0n
n2
2
nergie moyenne : s[n ]
n = n1
2 n
1
2
Puissance moyenne : s[ n ]
n2 n1 n = n
1
48
Dfinition :
Un systme est un modle mathmatique dun processus physique qui relie un signal
dentre un signal de sortie
Un systme est un dispositif de traitement du signal
En entre : e(t) signal dentre
En sortie : s(t) signal de sortie
Exemples :
Amplificateur, systme audio, tlphone, systme vido
Un systme complexe peut tre vu comme linterconnexion de plusieurs systmes dont
les fonctions sont plus simples
Questions
Quelles sont les proprits intressantes des systmes ?
Systme 1
Parallle Input + Output
Systme 2
Systme 1 Systme 2
Systme 3
Feed-back
51
PROPRIETES DES SYSTEMES
INVARIANCE EN TEMPS
Soit y[n]=S{x[n]} ALORS y[n-n0]=S{x[n-n0]}
La sortie du systme ne dpend pas de l'origine des temps
La sortie du systme ne dpend pas de linstant o est applique lentre
t t
0 1 2 0 1 2
3 4 t
0 1 2
53
RAPPEL DE QUELQUES PROPRIETES DE LIMPULSION UNITE
x[n] [n =
n0 ] x[n0 ] [n n0 ] x(t ) (t =
t0 ) x(t0 ) (t t0 )
+
+
[ n] = 1 (t )dt = 1
+ +
x (t ) (t )dt = x (0)
+ +
x[n] [n n
0
] = x[ n0 ]
x (t ) (t t 0 ) dt = x ( t0 )
n
[k ] = u[n]
t
k = ( )d = u(t )
54
REPRESENTATION DES SIGNAUX EN SOMME DIMPULSIONS
Exemple de la reprsentation
x[n ]
-4 -1 2 3
dun signal discret en terme
-3 -2 0 1 4
dimpulsions retardes
x[2] [n + 2]
Gnralisation : -4 -3 -2 -1 0 1 2 3 4 n
Tout signal discret peut tre dcrit comme une somme
dimpulsions de Dirac retardes et pondres par x[1] [n + 1]
-1
lamplitude de ce signal :
-4 -3 -2 0 1 2 3 4 n
+
x[ n ] = x[k ] [n k ]
k =
-4 -3 -2 -1 0 1 2 3 4
x[0] [n ]
n
x[1] [n 1]
-4 -3 -2 -1 0 1 2 3 4 n
x (t ) = x ( ) (t )d
-4 -3 -2 -1 0 1 3 4 n
55
NOTION DE REPONSE IMPULSIONNELLE
[n] h[n]
S
entre S sortie
[n] h[n]
[n-k] h[n-k]
x[k] [n-k] x[k] h[n-k]
+ +
x[n] S y[n]
+
=y[n] x[k ] h[n k ]
k =
57
EQUATION DE CONVOLUTION
+ +
y[n] x[k ]=
k =
h[n k ] h[k ] x[n k ]
k =
Notation de la convolution
01 2 34 5 n<0
h[n-k]
64 x[n] S y[n] ?
32
h[n] n 0 k
n-6
h[n] 16
8
4 h[n-k]
12 0<n<4
01 2 34 5 6 7 0 n k
n-6
h[n-k]
4<n<6
h[n-k]
6<n<10
0 n k
n-6
0 1 2 3 4 5 6 7 8 9 10
h[n-k]
n>10
0 n k
n-6
59
CALCUL PRATIQUE DE LA CONVOLUTION
Cas usuel :
soit x de dure N, h de dure M, avec NM (signaux dure finie)
x et h ont des amplitudes nulles pour les temps (indices) ngatifs (signaux causaux)
alors lquation de convolution se simplifie :
N 1 M 1
=
y[n] x[k ] h=
k 0=k 0
[n k ] h[k ] x[n k ] =
pour n 0 N +M 2
On note que la dure de y[n] est N+M-1 : la convolution allonge les signaux
x()
S y(t) ?
x(t)
h(t)
h()
y (t ) = x (t ) * h (t )
+
h(t0-)
x( )h(t )d
t0>0
+ t0
h( ) x (t )d +
x()h(t0-)
=
y (t0 ) x( )h(t
0 )d
t0
y (t ) =
x (t ) * h (t )
t0 t
61
PROPRIETES DE LA CONVOLUTION
Commutativit
[n] h[n] =
h[n]
Attention, ces proprits ne sont valables que pour les systmes LIT
62
PROPRIETES DE LA CONVOLUTION
2 jf 0t 2 jf 0 2 jf 0t
e= h ( ) e d e H ( f0 )
H(f0) est une constante complexe dont la valeur ne dpend que de f0 et de la rponse
impulsionnelle du systme
RETARD PUR
x[n] y[n]=x(n-n0)
retard n0
h[n]
h[n]=[n-n0] 1
n
0 n0
64
EXEMPLES DE SYSTEMES LIT
MOYENNEUR TEMPOREL
k 0=
x[n=
k 0
k] x[n ] [n=
k ] x[n ]*
=k 0
[n k ]
1
k= M 1 h[n]
=
h[n ] [n k ]
k =0
0 M-1
65
PROPRIETES DES SYSTEMES
LINEARITE
INVARIANCE EN TEMPS
CAUSALITE
Dfinition gnrale : La sortie dun systme causal ne dpend que des valeurs prsentes ou
passes de lentre
STABILITE
Dfinition gnrale: Un systme est stable si toute entre damplitude borne correspond
une sortie borne
66
DESCRIPTION DES SYSTEMES EQUATIONS AUX DIFFERENCES
Lexpression la plus gnrale reliant entre x[n] et sortie y[n] dun systme LIT
est de la forme :
+ +
b x[=
k =
n k ] a y[n k ]
k
k =
k
M N
=
k
k 0= k 1
=
y[n] b x[n k ] a y[n k ] k
Signaux de base :
j 2ft
Ensemble des exponentielles complexes de la forme: e
Elle constituent les fonctions propres des systmes linaires invariants
+ +
j 2 f ( t )
y (t ) = x (t ) h (t ) = h ( ) x (t )d = h ( )e d =
x(t) h(t) y(t)
+
e j 2 ft h( )e j 2 f d = He j 2 ft On a donc: y(t) = H x(t)
Consquence - interprtation :
un systme linaire invariant ne change pas la frquence d'une sinusode
Exemple
x(t) frquence fondamentale f0,
a0 = 1, A1=1/2, A2=1, A3=2/3 et Ak=0 pour k > 3
k = 0 k
Interprtation:
quivalence des reprsentations dans le domaine temporel et dans le domaine de Fourier
4
3
1 1
2/3
2
1 = Ak 1/2
0
0 f0 2f0 3f0 f
-1
0 20 40 60 80 100 120
70
SERIES DE FOURIER
2
1 1
0
-60 -40 -20 0 20 40 60
0.5
1
+ 2 cos(2 f0t ) 0
-0.5
-60 -40 -20 0 20 40 60
1
+ cos(4 f 0t ) 0
-1
-60 -40 -20 0 20 40 60
1
2
+ cos(6 f 0t ) 0
3 -1
-60 -40 -20 0 20 40 60
4
1 1
2/3
= 2
Ak 1/2
f
x(t) 0
0 f0 2f0 3f0
-2
-60 -40 -20 0 20 40 60
71
SERIES DE FOURIER
donc a k = ak et ak = a k (1)
+ +
j 2kf 0t
b/ Rcriture de x(t) x (t ) = ak e = a0 + [ak e j 2kf 0t + ak e j 2kf 0t ] (2)
k = k =1
+
j 2kf 0t
c/ (1) dans (2): x (t ) = a0 + 2 ( ak e )
k =1
ak = Ak e j k Ak cos(2kf0t + k )
1
d/ en posant on retrouve: x (t ) = a0 +
2
k =1
72
SERIES DE FOURIER
Exemple ak
x(t)
a-2 a-1 a0 a1 a2
2 1 1 2
(1 j) 1+ j 1 1 j (1 + j)
4 2 2 4
1 j4 5 0.15 j
e 1 5 0.15 j
e 1 j4
e e
2 2 2 2
Re(ak) Im(ak)
Parties relles et imaginaire
0 0
0 0
73
SERIES DE FOURIER
Influence de
la priode :
2T0 T0 T T1 T1 T0 T0 2T0
0
2 2
1
ak
T0 = 4T1
0
-1
-10 -8 -6 -4 -2 0 2 4 6 8 10
2
ak
T0 = 8T1 1
-1
-20 -15 -10 -5 0 5 10 15 20
2
ak
T0 = 16T1 1
-1
-40 -30 -20 -10 0 10 20 30 40
74
TRANSFORME DE FOURIER DES SIGNAUX CONTINUS
Dfinitions
+ +
j 2ft j 2ft
X( f ) = x ( t ) e dt x (t ) = X ( f ) e df
Transforme de Fourier Transforme de Fourier inverse
Notations conventions
TF
x(t) X(f) X(f) = TF[x(t)] et x(t) = TF-1[X(f)]
3. x(t) a un nombre fini de discontinuits dans tout intervalle fini. De plus, chacune de
ces discontinuits doit tre finie.
75
TRANSFORME DE FOURIER DES SIGNAUX CONTINUS
1
Transforme de Fourier: X ( f ) =
a + j 2f
1/a
Re(X(f)) Im(X(f))
1/a
||X(f)||
/2 (X(f))
/2
f
76
TRANSFORME DE FOURIER DES SIGNAUX CONTINUS
Contenu frquentiel
Cas 1
1.2 6
1 x(t) 5 ||X(f)||
0.8
4
0.6 TF 3
0.4
2
0.2
0 1
-0.2 0
-100 -50 0 50 100 -20 -10 0 10 20
Cas 2
1.2 12
1 x(t) 10
||X(f)||
||X(f)||
0.8
8
0.6 TF
6
0.4
4
0.2
0 2
-0.2 0
-100 -50 0 50 100 -50 0 50
77
TRANSFORME DE FOURIER : PROPRIETES
Linarit
TF TF TF
Si x(t) X(f) et y(t) Y(f) on a : ax(t)+by(t) aX(f)+bY(f)
Symtries :
Si x(t) est un signal rel, on a X(-f) = X*(f), do les proprit suivantes
Si de plus x(t) est un signal pair, alors X(f) est purement relle Exemple: e-a|t|
Dcalage temporel :
TF -j2ft 0 Exemples: (t) et (t-t0)
x(t-t0) X(f) e
Consquence : un dcalage temporel n'affecte pas le module de la T.F.
TF 1 f
Changement dchelle : x(at) X
a a
78
TRANSFORME DE FOURIER : PROPRIETES
Signaux priodiques :
+
Si x(t) priodique, de frquence f0, on a : x (t ) = ak e j 2kf 0t (Srie de Fourier)
k =
+
La TF de x(t) est alors donne par : X( f ) = ak ( f kf0 )
k =
X(f)
x(t)
a-1 a0 a1
TF a-2 a2
T0 t -2f -f 0 f 2f
0 0 0
0
+
Exemples: e j 2f 0t cos( 2f 0t ) sin( 2f 0t ) T (t )
Peigne de Dirac:=
0 (t kT0 )
k =
79
TRANSFORME DE FOURIER : PROPRIETES
Dualit : Exemples: TF de
TF TF 2a
Si x(t) X(f) alors X(t) x(-f) x(t) = 2 x(t) = 1
a + 4 2t 2
dx (t ) TF
Drivation : j 2fX ( f )
dt
t
TF 1 1
Intgration : x( )d j 2 f
X ( f ) + X (0) ( f )
2
Exemple: u(t)
Proprit fondamentale
TF TF TF
Si x(t) X(f) et h(t) H(f) on a : x(t) h(t) X(f) H(f)
Association de systmes
Exemple: filtrage
1.2 12
1 x(t) ||X(f)||
||X(f)||
10
0.8
8
0.6
6
0.4
0.2 4
0 2
-0.2 0
-100 -50 0 50 100 -50 0 50
TF TF TF
Si x(t) X(f) et h(t) H(f) on a : x(t) h(t) X(f) H(f)
82
PRINCIPALES PROPRITS DE LA TRANSFORME DE FOURIER
83
PRINCIPALES TRANSFORMES DE FOURIER
84
x(t)
xe(t) x[k]
86
Notations - Dfinitions
Traitement
Echantillonnage Reconstruction
numrique
Questions :
De linformation est-elle perdue lors de lchantillonnage des signaux ?
Peut-on restituer totalement le signal analogique partir de ses
chantillons ?
87
Opration dchantillonnage
x(t)
xe(t) t
t
> <
T
X
x(t) xe(t)
T(t)
+
= (t ) T (t )
xe (t ) x= x[kT ] (t kT )
k =
1 1 + k
=
Xe( f )
T
f ) * 1 ( f )
X(=
T k =
X ( f
T
)
T
Conclusion :
lchantillonnage de x(t) a pour consquence la priodisation de son spectre
+
0 Fmax f
Xe(f)
Xe(f)
X R ( f ) = X e ( f ).H L ( f )
X(f)
0 Fmax f
Xe(f)
-Fe 0 Fmax Fe f
HL(f)
-fc 0 fc f
XR(f)
0 Fmax f
91
Thorme dchantillonnage de Shannon
On comprend que la restitution du signal analogique nest pas possible dans le cas
suivant. Aucun filtre ne peut permettre de revenir au motif spectral original.
Xe(f)
X(f)
0 f
-Fe 0 Fmax Fe f
Xe(f)xHG(f) HG(f)
Filtre analogique
antirepliement
0 Fe/2 f
Avant chantillonnage, on annule
le spectre pour les frquences Sans
suprieures Fe/2 Xeg(f)
repliement
-Fe 0 Fe/2 Fe f
93
Echantillonnage rel
TF
... ...
... ...
se (t ) = s(t )Te (t )
Donc Se ( f ) f eS ( f ) f e ( f )
= Priodisation de la
TF fe
98
RAPPELS PRELIMINAIRES
s(t)
t 0 f
TF
Se(f )
se(t)
... ...
t
0T 0 fe f
99
RAPPELS PRELIMINAIRES
TF
(t ) Te s(t ) Te ( f )
sef= S ( f ) f e ( f ) Priodisation du signal Te = 1/fe
S(f )
s(t)
t 0 f
TF
s e f (t)
Sechf(f)
Te t 0 fe f
100
TRANSFORME DE FOURIER DE SIGNAUX DISCRETS
s[n]
TF
... ...
0 1 2 i n f
0 1
Transforme de Fourier dun signal temps discrets (TFTD)
+
S( f ) = s[n ]e j 2 fn Transforme de Fourier
n =
Proprits fondamentales
La transforme de Fourier d'un signal discret est continue et priodique, de priode 1
Le signal discret est dcompos en une intgrale finie d'exponentielles discrtes
101
PRINCIPALES PROPRITS DE LA TRANSFORME DE FOURIER DUN
SIGNAL TEMPS DISCRETS
TF
n 0 f
0 N-1 1
Transforme de Fourier discrte (DFT)
on ne garde qu'une priode (N points) du signal et de la TF
Laxe des frquences de la TF est normalis de 0 N-1
sP[n] S[k]
0 N-1 n 01 N-1 k
La DFT peut donc toujours tre vue comme lchantillonnage sur N points de la TF
priodique et continue d'un signal discret dfini sur N points.
S [k ] = S ( f ) f = k / N pour k = 0, N-1
105
TRANSFORMEE DE FOURIER DISCRETE
Proprits fondamentales
La DFT (et son inverse) sont discrtes et priodique, de priode N
La DFT (et son inverse) correspondent une somme finie d'exponentielles discrtes:
la DFT (et son inverse) peuvent donc se calculer numriquement en machine
Implantation efficace de la DFT si N est une puissance de 2 : algorithme de FFT
Ne pas oublier
s[n] S[k]
DFT
0 N-1 n 01 N-1 k
106
PROPRITS DE LA TRANSFORME DE FOURIER DISCRETE
Dcalage
s[n] de n0 s[n-n0]
0 n 0 n0 n
Dcalage du signal s[n] associ la DFT S[k] Dcalage circulaire sur N points
sP[n] S[k]
DFT
0 N-1 n 01 N-1 k
Dcalage sP[n-n0]
de n0 Notation: dcalage
circulaire de n0 sur
N points
n
x[( n n0 ) N ]
0 N-1
107
PROPRITS DE LA TRANSFORME DE FOURIER DISCRETE
108
TRANSFORMEE DE FOURIER DISCRETE
2.5
stem( angle(my_DFT) );
2
1.5
s[n] 1
1
0.5
0.8
0
0.6
DFT -1 0 1 2 3 4 5
-1
-2
-3
-1 0 1 2 3 4 5
109
DFT : ZERO-PADDING (AJOUT DE ZEROS)
TFTD
s[n]
... ...
0 n 0 1 f
DFT directe: application de la DFT un tableau de N points
chantillonnage de S(f) sur N points
s[n] N points
S(k/N) 1 priode
DFT
0 N-1 n 0 1 f
Intrt pratique : en rajoutant les zros au signal discret on peut donc choisir deffectuer une
DFT sur un nombre M de points quelconque et donc choisir lchantillonnage de la TF continue
du signal discret s[n]
110
TRANSFORMEE DE FOURIER DISCRETE
0 0 0
-5 0 5 10 -5 0 5 10 0 10 20 30 40 50
2 2 2
1 1 1
0 0 0
-1 0 1 2 3 4 5 0 2 4 6 8 10 0 10 20 30 40 50
111
TRANSFORMEE DE FOURIER DISCRETE
S[k]
3
Zero-padding et DFT sous Matlab
2.5
2
1.5
1
my_signal = [1 0.9 0.7 0.4 0];
0.5
module_DFT = abs( fft(my_signal) ); 0
module_DFT = abs( fft(my_signal, 10) ); -1 0 1 2 3 4 5
-5 0 5 10 2.5
2
1.5
1
0.5
0
0 10 20 30 40 50
112
R
s(t) S(f )
E t f
S
0
U
M
E
se(t) . . . ... Se(f )
0 Te t fe f
0
D
E
. . .
S
s[n] ... S(f )
T
R 0 1 i n 0 1 f
A
N N points
N points
S s[n]
1 priode
F S(k/N)
O
R 0 N-1 n 0 1 f
M
E
E s[n]
S
DFT
S[k]
0 N-1 n 01 N-1 k
113
Exemple pratique dapplication
Filtre analogique LC
H ( f ) = rect (
f =
) h (t ) =
TF 1
{H ( f )} 2 fc sin c(2 fct )
2 fc
2fc
1
1/2fc
-fc fc f t
TFTD inverse
-fc fc
H ( f ) = rect (
f sin(2 nf c )
) h[n] =
2 fc n
Mais le filtre numrique est de longueur infinie..
M=101
M=21
M=7
128
Filtrage numrique. Classification des filtres
Soit le filtrage du signal numrique x[n] par le filtre de rponse impulsionnelle h[n]
Soit y le signal rsultant du filtrage de x par h. y est obtenu par la convolution de x par h
Calcul de y[n] y [=
n] x [k ] h [n k ]
k =
131
Filtrage numrique
4
Rsultat du filtrage de x par h pour notre cas : y [ n=] x [ k ] h [ n k ] pour n de -1 5
k =0
y : 1/3(10 17 22 24 20 15 3)
X
Analyse frquentielle :
132
Etude du filtre moyenneur
M 1
1
Relation entre-sortie
(filtre causal)
=y [ n] x [n k ]
M k =0
1
Rponse frquentielle, TF de la rponse impulsionnelle : H ( f=
) (1 + 2 cos 2 f )
3
H(f)
133
Etude du filtre moyenneur, moyenne glissante, running average filter
Exemple du filtrage de la ligne n 40 par un filtre moyenneur non causal sur 11 points
Rsultat sur limage complte du filtrage par un filtre moyenneur non causal sur 11 points
Le filtre a t appliqu dabord sur les lignes puis sur les colonnes
Lamplitude du rsultat a t recalcule pour occuper toute lchelle des niveaux de gris
137
Etude du filtre moyenneur, moyenne glissante, running average filter
Exemple du filtre RII dfini par son quation entre-sortie : [ n] 0.8 y [ n 1] + 5 x[n]
y=
Rsultat du calcul :
h [ n] =
5 (0.8) n u[n]
Avec u[n], lchelon unit
Exemple du filtre RII dfini par son quation entre-sortie : [ n] 0.8 y [ n 1] + 5 x[n]
y=
[ n=
] ay [ n 1]
Relation entre-sortie de ce filtre linaire
caractris par lquation aux diffrences suivante : y x[n] avec a <1
1
H( f )=
1 ae j 2 f
142
Modlisation
Dans le domaine temporel : x w (t ) = x(t ) w(t )
Devient dans le domaine frquentiel : X w( f ) = X ( f ) *W ( f )
La fentre quon utilise intuitivement est la fentre rectangulaire qui permet simplement
de garder les chantillons du signal sur une dure fixe sans modifier leur amplitude.
Le spectre du signal tronqu est donc convolu (en frquence) par la TF du rectangle
cest dire un sinus cardinal
144
Fentres de pondration
En chelle log ::
145
Fentres de pondration
Diverses fentres ont t inventes dans le but de limiter les oscillations dans les
lobes secondaires et rduire la largeur du lobe principal
Fentres de Hamming gnralises:
t 2t
wH (t ) = rect ( ) + (1 ) cos( )
T T
T (1 )
WH ( f ) = Tsinc(Tf ) + [sinc(Tf + 1) + sinc(Tf 1)]
2
Analyse dun signal constitu de la somme de 2 sinus chantillonns 4000Hz sur 200 points
Rectangle
Hamming
149
150
Exemple introductif
SIGNAL 1
SIGNAL 2
151
TEMPS FREQUENCE
Le plan temps-frquence
Domaine temporel ------------ domaine frquentiel
Ingalit d'Heisenberg-Gabor :
1
t . f
4
Pour une gaussienne BT 1/2
152
Grandeurs locales : amplitude et
frquence instantanes
Notion de spectre instantan ou de frquence localise
dans le temps
153
Reprsentation temps-frquence
Vers une reprsentation temps-frquence (RTF)
Tx ( t , f )
Reprsentation schmatique de ce qui est souhaitable
f f
exp(j2f0t)
(t-t0) f0
t t
t0
f f
Exp(j2t/2)
exp(-t)
154
t t
Transforme de Fourier Court Terme (TFCT)
TF locale au voisinage de t.
Autre dfinition :
+
X t(f)=X(f)H*(f)e j2ft
= X()H*(f)e j2(f)td
+
TFCTx(t,f;h)=e j2tf
X ( ) H*( f )e d
j2t
f
h(t)
t0 t
156
Transforme de Fourier Court Terme (TFCT)
x2(t)=e j2f0t
+
TFCTx 2 (t,f;h)= (f0)H*(f)e j2(f)td=e j2(f0 f)t H*(f0 f)
f0 H(f)
157
Transforme en ondelettes
Reprsentation temps-chelle continue :
+
Tx(t,a)= x(s)h*ta(s)ds avec h*ta(s)= 1 h(st )
a a
t 158
Reprsentations temps-frquence bilinaires
Distribution dnergie
+ +
Energie de x(t) : Ex = x(t) dt= X(f) df
2 2
2 2
x ( t ) et X ( f ) : densits dnergie respectivement
temporelle et spectrale.
160
Effet de la longueur de la fentre
161
Distribution de Wigner-Ville (DWV)
Dfinition +
* j2 f
Wx , y ( t , f ) = x ( t + ) y ( t )e d
2 2
Proprits
1/(f1-f2) (t2,f2)
Wx1(t,f)
1/(t1-t2)
(t1,f1)
t 163
Distribution de Wigner-Ville (DWV)
164
Distribution de Wigner-Ville (DWV)
165
166
Programming in Matlab
It allows you to solve many technical computing problems, especially those with matrix
and vector formulations
The Language
The MATLAB language is a high-level matrix/array language with control flow statements,
functions, data structures, input/output, and object-oriented programming features.
169
Overview of the MATLAB Environment
External interface
The external interfaces library allows you to write C and Fortran programs that interact
with MATLAB. It includes facilities for calling routines from MATLAB (dynamic linking), for
calling MATLAB as a computational engine, and for reading and writing MAT-files
170
Matlab Documentation
To view the online documentation, select Help menu then Product Help in Matlab.
There are many demonstration programs that illustrate the capabilities of Matlab.
These can be started with the command >> demo
You can also download from the Matlab website the pdf version of the
documentation: getstartwithMatlab.pdf which is the main source of this lesson
On the Matlab website you will find several forum of discussion and the possibility
of exchanging .m files with Matlab users.
171
Starting a Matlab session
The desktop
When you start MATLAB, the desktop appears, containing tools (graphical user interfaces)
for managing files, variables, and applications associated with MATLAB
172
Matrix and arrays
About matrix
In the MATLAB environment, a matrix is a rectangular array of numbers. Special
meaning is attached to 1-by-1 matrices, which are scalars, and to matrices with
only one row or column, which are vectors.
Where other programming languages work with numbers one at a time, MATLAB
allows you to work with entire matrices quickly and easily
Once you have entered the matrix, it is automatically remembered in the MATLAB
workspace. You can refer to it simply as A.
>> A
Note that semicolon ; at the end of a Matlab command does not display its result
>> A; %does not display the matrix
Text placed after % in a command line is not interpreted
174
Matrix and arrays
>> sum(A)
MATLAB replies with
ans =
34 34 34 34
It is the sum along each column : Matlab has a preference for working with the
columns of a matrix
Note that when an output variable is not specified, MATLAB uses the variable ans,
short for answer
It flips a matrix about its main diagonal, and also changes the sign of the imaginary
component of any complex elements of the matrix
The dot-apostrophe operator (e.g., A.'), transposes without affecting the sign of
complex elements.
>> sum(diag(A))
MATLAB replies with
ans = 34
Subscripts :
The element in row i and column j of A is denoted by A(i,j)
>> A(1,4) + A(2,4) + A(3,4) + A(4,4)
MATLAB replies with
ans = 34
Conversely, if you store a value in an element outside of the matrix, the size increases
to accommodate the newcomer:
>> X = A;
X(4,5) = 17
MATLAB replies with
X=
16 3 2 13 0
5 10 11 8 0
9 6 7 12 0
4 15 14 1 17
177
Matrix and arrays
It is also possible to refer to the elements of a matrix with a single subscript, A(k)
In which case the array is regarded as one long column vector formed from the
columns of the original matrix.
A(8) is another way of referring to the value stored in A(4,2). Matlab replies with 15
Tricks :
The colon by itself refers to all the elements in a row or column of a matrix
sum(A(:,4 )) computes the sum of the fourth column
Variables
Matlab does not require any type declarations or dimension statements.
When Matlab encounters a new variable name, it automatically creates the variable and
allocates the appropriate amount of storage.
If the variable already exists, Matlab changes its contents and, if necessary, allocates
new storage.
Tricks :
Choose long variable name
180
Expressions
Numbers
Some examples of numbers are :
3 -99 0.0001
9.6397238 1.60210e-20 6.02252e23
1i -3.14159j 3e5i
All numbers are stored internally using the long format specified by the IEEE floating-
point standard. Floating-point numbers have a finite precision of roughly 16 significant
decimal digits and a finite range of roughly 10-308 to 10+308
Tricks :
The section Avoiding Common Problems with Floating-Point Arithmetic gives a few of
the examples showing how IEEE floating-point arithmetic affects computations in Matlab
181
Expressions
Operators
Expressions use familiar arithmetic operators and precedence rules.
+ Addition
- Subtraction
* Multiplication
/ Division
\ Left division (described in Linear Algebra in the MATLAB documentation)
^ Power
' Complex conjugate transpose
( ) Specify evaluation order
Examples :
>> Z = zeros(2,4)
Z=0000
0000
>> F = 5*ones(3,3)
F=555
555
555
>> N = fix(10*rand(1,10))
N=9264874084
>> R = randn(4,4)
R = 0.6353 0.0860 -0.3210 -1.2316
-0.6014 -2.0046 1.2366 1.0556
0.5512 -0.4931 -0.6313 -0.1132
-1.0998 0.4620 -2.3252 0.3792
183
Expressions
M-files
You can create your own matrices using M-files, which are text files containing
Matlab code. Use the Matlab Editor or another text editor to create a file containing
the same statements you would type at the Matlab command line. Save the file
under name that ends in .m.
To execute the successive commands of the M-file, you have just to type the name
of the file after the Matlab prompt.
185
Arrays
Operators
The list of operators includes
+ Addition
- Subtraction
.* Element-by-element multiplication
./ Element-by-element division
.\ Element-by-element left division
.^ Element-by-element power
.' Unconjugated array transpose
Array operations are useful for building tables. Suppose n is the column vector
>> n = (0:9)';
>> pows = [n n.^2 2.^n] builds a table of squares and powers of 2:
pows = 0 0 1
1 1 2
2 4 4
3 9 8
4 16 16
5 25 32
6 36 64
7 49 128
8 64 256
9 81 512
186
Graphics
Creating a Plot
The plot function has different forms, depending on the input arguments. If y is a
vector, plot(y) produces a piecewise linear graph of the elements of y versus the
index of the elements of y. If you specify two vectors as arguments, plot(x,y)
produces a graph of y versus x.
Example
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
xlabel('x = 0:2\pi') % The characters \pi create the symbol
ylabel('Sine of x')
title('Plot of the Sine Function','FontSize',12)
187
Graphics
Example
x = 0:pi/100:2*pi;
y = sin(x);
y2 = sin(x-.25);
y3 = sin(x-.5);
plot(x,y,x,y2,x,y3)
legend('sin(x)','sin(x-.25)','sin(x-.5)')
Creating a Plot
The plot function has different forms, depending on the input arguments. If y is a
vector, plot(y) produces a piecewise linear graph of the elements of y versus the
index of the elements of y. If you specify two vectors as arguments, plot(x,y)
produces a graph of y versus x.
Example
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
xlabel('x = 0:2\pi') % The characters pi create the symbol
ylabel('Sine of x')
title('Plot of the Sine Function','FontSize',12)
189
Graphics
Example
t = 0:pi/10:2*pi;
plot(exp(i*t),'-o')
axis equal
191
Graphics
Example
t = 0:pi/10:2*pi;
[X,Y,Z] = cylinder(4*cos(t));
subplot(2,2,1); mesh(X)
subplot(2,2,2); mesh(Y)
subplot(2,2,3); mesh(Z)
subplot(2,2,4); mesh(X,Y,Z)
Programming 192
Avoid For loops
For loops are inefficient in Matlab because overhead of interpreting the code
The process to convert For loop could be refferd to as vectorizing : convert in a matrix-
vector operation
It is often necessary to form a matrix by repeating one or more values throughout.
Example
x=[1 3 4 6 8 9 2 ] % x is a length-7 row vector
X=ones(10,1)*x % X is a 10x7 matrix
Creating functions
Exercise
Explain the following lines of Matlab code
A=randn(6,3)
B=A>0;
A=A.*(A>0)
Write a new function which replace the negative element of the matrix A by -2
Test the following commands : A=randn(6,3)
xy=find(A>0.5)
find function returns the list of indices where a condition is true