Transférer les fichiers vers ''

Scripts Matlab partie signal
This commit is contained in:
Raphael Rees 2023-03-17 14:25:39 +01:00
parent 15cdcee56f
commit ccdf933c06
3 changed files with 83 additions and 0 deletions

31
scriptDFT.m Normal file
View file

@ -0,0 +1,31 @@
close all;
T = 1/7; %durée d'obs = M*Te. On doit avoir T = k*To = k*Tsin
M = 32;
Te = T/M;
Fe = 1/Te;
deltaF = Fe/M; % pas fréquentiel
Tsim = T-Te; %durée de la simulation
Fsin = 14; %Fsin = Fo --> fréq du sinus
Res=sim('simulDFT');
figure(1);
plot(Res.Sinus_Continu);
hold on; % permet de superposer la courbe à suivre
plot(Res.Sinus_Echanti,'o');
grid;
title('signaux temporels');
%help fft;
figure(2);
yt = fft(Res.Sinus_Echanti.Data);
stem(abs(yt)/M);
grid;
figure(3);
xt = linspace(0,31,32);
stem(xt,abs(yt)/M);
grid;
figure(4);
x = deltaF*[0:1:M-1];
y = fft(Res.Sinus_Echanti.Data);
stem(x,abs(y)/M);
grid;
title('module de la tfd');

26
scriptq3_2.m Normal file
View file

@ -0,0 +1,26 @@
close all;
T = 0.0002;
t1=T/5;
Fe = 320000;
Te = 1/Fe;
Tsim = T-Te;
M = 64;
deltaF = 5000;
F1 = 85005.9;
F2 = 90000;
F3 = 94986.8;
F4 = 100000;
F5 = 115015.9;
F6 = 120000;
Res=sim('simul3_2');
figure(1);
plot(Res.Sinus_Echanti);
grid;
title('tracé temporel');
freq =deltaF*[0:1:M-1];
yt = fft(Res.Sinus_Echanti.Data);
figure(2);
stem(freq,abs(yt)/M,'r*');
grid;

26
scriptq3_2_carre.m Normal file
View file

@ -0,0 +1,26 @@
close all;
T = 0.0002;
Fe = 320000;
Te = 1/Fe;
Tsim = T-Te;
M = 64;
deltaF = 5000;
Res=sim('simul_carre');
figure(1);
plot(Res.Sinus_Echanti);
grid;
title('tracé temporel');
freq =deltaF*[0:1:M-1];
yt = fft(Res.Sinus_Echanti.Data);
figure(2);
stem(freq,abs(yt)/M,'r*');
grid;
figure(3);
num = [1];
den = [1.783*10.^(-23) 7.6663*10.^(-18) 1.162*10.^(-11) 3.0332*10.^(-6) 1];
h = tf(num,den);
bode(h);