From ccdf933c0657c1c597b4c30be203b68390ea7e1c Mon Sep 17 00:00:00 2001 From: Raphael Rees Date: Fri, 17 Mar 2023 14:25:39 +0100 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Scripts Matlab partie signal --- scriptDFT.m | 31 +++++++++++++++++++++++++++++++ scriptq3_2.m | 26 ++++++++++++++++++++++++++ scriptq3_2_carre.m | 26 ++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 scriptDFT.m create mode 100644 scriptq3_2.m create mode 100644 scriptq3_2_carre.m diff --git a/scriptDFT.m b/scriptDFT.m new file mode 100644 index 0000000..0302134 --- /dev/null +++ b/scriptDFT.m @@ -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'); + diff --git a/scriptq3_2.m b/scriptq3_2.m new file mode 100644 index 0000000..b817235 --- /dev/null +++ b/scriptq3_2.m @@ -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; diff --git a/scriptq3_2_carre.m b/scriptq3_2_carre.m new file mode 100644 index 0000000..6a07939 --- /dev/null +++ b/scriptq3_2_carre.m @@ -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); \ No newline at end of file