Séries de Fourier
Constat
Tout signal Périodique est la somme de sinusoïdes de différentes fréquences.
Ex: Signal carré
à mesure que j’ajoute des sinusoïdes, le signal carré se forme.
Je note l’amplitude de chacune ces sinusoides dans le plan des fréquences.
Définition
y(t) Fonction T-périodique
Toute fonction T-périodique résulte d’une somme infinie de cosinus et sinus.
Démonstration (facultatif)
parmi les n, il existe un et un seul n égal à k tel que :
Forme Complexe
On pose : , ,
La forme complexe permet d’estimer en une seule expression la contribution sinusoïdale et cosinusoïdale.
La contrepartie de cette simplification mathématique est désormais la nécessité de considérer des ‘fréquences négatives’ pour le calcul.
Exemples
Signal carré y(t) d’amplitude U
Signal triangulaire y(t) d’amplitude U
Interprétation Mathématique
Espace Euclidien et Produit scalaire
|
Je considère une base géométrique orthogonale (orthogonale # indépendant, il me faut ici 2 coordonnées pour exprimer un point)
Si je veux connaître la coordonnée en X, j’applique le produit scalaire :
|
Ainsi, mon vecteur existe dans une base donnée.
Je peux le décrire à travers une somme faisant apparaitre les composantes de cette base ( X et Y).
Pour calculer une composante en particulier, j’utilise le produit scalaire.
Retour aux séries de Fourier : Produit scalaire hermitien
Ce concept de base peut s’étendre au domaine spectral, l’objectif étant alors d’exciter chacune des composantes sinusoïdales de notre signal.
( REM : on utilise le concept de produit scalaire dans une base hermitienne : )
Considérons un signal .
Afin de représenter ce signal dans un espace fréquentiel, je vais comparer y(t) avec des signaux sinusoidaux.
J’utilise la forme exponentielle pour détecter la contribution sinusoidale et cosinusoidale.
Supposons dans un premier temps que mon signal ait une fréquence
En décomposant y(t) en une somme d’exponentielles, et en appliquant le produit scalaire
J’obtiens un résultat non nul.
Cette intégration, ou produit scalaire, permet d’estimer le degré de ressemblance ( ou corrélation ) entre mon signal y(t) et un signal sinusoidal.
S’agissant de 2 sinusoïdes de même fréquence, ce résultat est non nul.
ANALYSE SPECTRALE :
Je peux “ranger” ce résultat dans une base fréquentielle :
Si je fais le même calcul pour une fréquence ( ou -F), le résultat de mon intégrale sera nul.
ANALYSE SPECTRALE :
Script Scilab et Matlab/Octave pour générer les figures ci dessus
SCILAB
//==============================================================================
// SQUARE SIGNAL
//==============================================================================
N = 1000;
t = [0:N-1]
F=10
Fe=1000
Te=1/Fe
F_norm=F/Fe
Nval = [1, 3, 5, 51];
figure(1);
for in = 1:length(Nval),
v = 0;
subplot(4,2,(2*in-1)); // TIME
for n = 1:2:Nval(in),
addto = 4*sin(2*n*%pi*F_norm*t)/(n*%pi);
v = v + addto;
plot(t/(N),addto,'b--','LineWidth',1);
end
plot(t/(N),v,'r-','LineWidth',2);
a=gca()
t_min=0
t_max=2/F
y_min=-1.5
y_max=1.5
a.data_bounds=[t_min,t_max,y_min,y_max];
xlabel('t (s)','FontSize',1); ylabel('FS Approx to y(t)','FontSize',1);
title(['Fourier Series Approx with',string(Nval(in)),' Terms'],'FontSize',2);
subplot(4,2,(2*in)); // SPECTRUM
X = abs(fft(v));
X = fftshift(X);
vect_Freq = [-N/2:N/2-1]/N;
plot2d2(Fe*vect_Freq,X/(N/2),rect=[-200,0,200,1.5]) // [xmin,ymin,xmax,ymax]
p = get("hdl");
p.children.thickness = 2;
p.children.foreground = 3;
xlabel('f (Hz)','FontSize',1);
title(['Spectrum Analysis with',string(Nval(in)),' Terms'],'FontSize',2);
end
//==============================================================================
// TRIANGLE SIGNAL
//==============================================================================
N = 1000;
t = [0:N-1]
F=10
Fe=1000
Te=1/Fe
F_norm=F/Fe
Nval = [1, 3, 5, 51];
figure(2);
for in = 1:length(Nval),
v = 0;
subplot(4,2,(2*in-1)); // TIME
for n = 1:2:Nval(in),
addto = 8*cos(2*n*%pi*F_norm*t)/(n*n*%pi*%pi);
v = v + addto;
plot(t/(N),addto,'b--','LineWidth',1);
end
plot(t/(N),v,'r-','LineWidth',2);
a=gca()
t_min=0
t_max=2/F
y_min=-1
y_max=1
a.data_bounds=[t_min,t_max,y_min,y_max];
xlabel('t (s)','FontSize',1); ylabel('FS Approx to y(t)','FontSize',1);
title(['Fourier Series Approx with',string(Nval(in)),' Terms'],'FontSize',2);
subplot(4,2,(2*in)); // SPECTRUM
X = abs(fft(v));
X = fftshift(X);
vect_Freq = [-N/2:N/2-1]/N;
plot2d2(Fe*vect_Freq,X/(N/2),rect=[-200,0,200,1]) // [xmin,ymin,xmax,ymax]
p = get("hdl");
p.children.thickness = 2;
p.children.foreground = 3;
xlabel('f (Hz)','FontSize',1);
title(['Spectrum Analysis with',string(Nval(in)),' Terms'],'FontSize',1);
end
MATLAB / OCTAVE
Delta_t=1e-3 % Pas de Calcul
N=1/Delta_t % Nombre de points
A=1 % Amplitude
F=10 % Frequence
T=1/F % Periode
Nb_per=3 % Nombre de Periodes
t=[-N*Nb_per*T/2:(N-1)*Nb_per*T/2]/N;
F_analyze = 3*F
%===============================================================================
% 1 % SAME FREQUENCY ANALYSIS
%===============================================================================
re=cos(-2*pi*F_analyze*t);
im=sin(-2*pi*F_analyze*t);
y=cos(2*pi*F*t);
%...............................................................................
figure()
subplot(2,2,1)
plot3(t,re,im,"b", "linewidth", 2)
hold on
plot3(t,y,"r","linewidth", 5)
hold on
xlabel("t(s)")
ylabel('real : cos\omega t')
zlabel('imag : sin\omega t')
str = {strcat('y(t)=cos(2\piFt) with F = ' , num2str(F),'Hz, analyzed with e^{-j2\pi F_at} with F_a=', num2str(F_analyze),'Hz')}
title(str)
% str = {strcat('e^{-j2\pi Fa t} with Fa=' , num2str(F_analyze),'Hz')}
str = {strcat('e^{-j2\pi Fa t} with Fa=' , num2str(F_analyze),'Hz')}
legend(str, 'y(t)=cos(2\piFt)',"location", "northeast")
grid
%===============================================================================
% 2 % COS BECOMES A SUM OF EXP
%===============================================================================
re=cos(-2*pi*F_analyze*t);
im=sin(-2*pi*F_analyze*t);
y_1_re=0.5*cos(2*pi*F*t);
y_1_im=0.5*sin(2*pi*F*t);
y_2_re=0.5*cos(-2*pi*F*t);
y_2_im=0.5*sin(-2*pi*F*t);
%...............................................................................
subplot(2,2,2)
plot3(t,re,im,"b", "linewidth", 2)
hold on
plot3(t,y_1_re,y_1_im,"m","linewidth", 5)
hold on
plot3(t,y_2_re,y_2_im,"g","linewidth", 5)
hold on
xlabel("t(s)")
ylabel('real : cos\omega t')
zlabel('imag : sin\omega t')
str = {strcat('y(t)=(e^{j\omega t}+e^{-j\omega t})/2 with F = ' , num2str(F),'Hz')}
title(str)
str = {strcat('e^{-j2\pi Fa t} with Fa=' , num2str(F_analyze),'Hz')}
legend (str,'y(t)=e^{j2\pi Ft}','y(t)=e^{-j2\pi Ft}',"location", "northeast");
grid
%===============================================================================
% 3 % PRODUCT FOR EACH t : exp(+jwt)
%===============================================================================
re=cos(-2*pi*F_analyze*t);
im=sin(-2*pi*F_analyze*t);
y_1_re=0.5*cos(2*pi*F*t);
y_1_im=0.5*sin(2*pi*F*t);
product=0.5*exp(j*2*pi*F*t).*exp(-j*2*pi*F_analyze*t);
nd=100
product_area = product.*[zeros(1,(length(t)-nd)/2), ones(1, nd), zeros(1, (length(t)-nd)/2)] ;
%...............................................................................
subplot(2,2,3)
plot3(t,re,im,"b", "linewidth", 2)
hold on
plot3(t,y_1_re,y_1_im,"m","linewidth", 5)
hold on
plot3(t,product,"y","linewidth", 5)
area(t,product_area)
xlabel("t(s)")
ylabel('real : cos\omega t')
zlabel('imag : sin\omega t')
str = {strcat('y_1(t)=e^{j\omega t}/2 with F = ' , num2str(F),'Hz')}
title(str)
str = {strcat('e^{-j2\pi Fa t} with Fa=' , num2str(F_analyze),'Hz')}
legend (str,'y_1(t)=0.5.e^{j2\pi Ft}','y_1(t).e^{-j2\pi Ft}','\int_{-T/2}^{T/2}y_1(t).e^{-j2\pi Ft}dt',"location", "northeast");
grid
%===============================================================================
% 4 % PRODUCT FOR EACH t : exp(+jwt)
%===============================================================================
re=cos(-2*pi*F_analyze*t);
im=sin(-2*pi*F_analyze*t);
y_2_re=0.5*cos(-2*pi*F*t);
y_2_im=0.5*sin(-2*pi*F*t);
product=0.5*exp(-j*2*pi*F*t).*exp(-j*2*pi*F_analyze*t);
nd=100
product_area = product.*[zeros(1,(length(t)-nd)/2), ones(1, nd), zeros(1, (length(t)-nd)/2)] ;
%...............................................................................
subplot(2,2,4)
plot3(t,re,im,"b", "linewidth", 2)
hold on
plot3(t,y_2_re,y_2_im,"g","linewidth", 5)
hold on
plot3(t,product,"y","linewidth", 5)
area(t,product_area)
xlabel("t(s)")
ylabel('real : cos\omega t')
zlabel('imag : sin\omega t')
str = {strcat('y_2(t)=e^{-j\omega t}/2 with F = ' , num2str(F),'Hz')}
title(str)
str = {strcat('e^{-j2\pi Fa t} with Fa=' , num2str(F_analyze),'Hz')}
legend (str,'y_2(t)=0.5.e^{-j2\pi Ft}','y_2(t).e^{-j2\pi Ft}','\int_{-T/2}^{T/2}y_2(t).e^{-j2\pi Ft}dt',"location", "northeast");
grid
%===============================================================================
% FREQUENCY ANALYSIS
%===============================================================================
figure()
freq = [0:1:100];
amplitudes=[zeros(1,length(freq))];
Delta_t=1e-3 % Pas de Calcul
N=1/Delta_t % Nombre de points
A=1 % Amplitude
F=10 % Frequence
T=1/F % Periode
Nb_per=1 % Nombre de Periodes
t=[-N*Nb_per*T/2:(N-1)*Nb_per*T/2]/N;
y=cos(2.*pi.*F.*t);
TF=exp(-i.*2.*pi.*F_analyze.*t).*y;
acc_TF=0;
for n=1:length(t)
acc_TF = acc_TF+TF(n).*Delta_t;
end
acc_TF=acc_TF/T;
amplitudes(F_analyze)=abs(acc_TF);
%-------------------------------------------------------------------------
stem(freq,amplitudes)
axis([0 max(freq) 0 1])
hold on
%===============================================================================