diff --git a/signal/matlab/Intro_Elec_Analogique_AOP.pdf b/signal/matlab/Intro_Elec_Analogique_AOP.pdf new file mode 100644 index 0000000..9d47b53 Binary files /dev/null and b/signal/matlab/Intro_Elec_Analogique_AOP.pdf differ diff --git a/signal/matlab/L32.m b/signal/matlab/L32.m new file mode 100644 index 0000000..417cf33 --- /dev/null +++ b/signal/matlab/L32.m @@ -0,0 +1,33 @@ +clc; +clear all; +close all; + +F1 = 85005.9; +F2= 90000; +F3 = 94986.8; +F4 = 100000; +F5 = 115015.9; +F6 = 120000; +Fe = 320000; +F = 5000; + +Te = 1/Fe; +T = 1/F ; +M = T/Te; +Tsim = T-Te; +Res = sim('LG'); + +plot(Res.Sinus_Continu); +hold on; +plot(Res.Sinus_Echanti,'o'); + +%figure +f = fft(Res.Sinus_Echanti.data, M)/M; +%stem(linspace(0, M-1, M), abs(f),'o'); +figure +stem(linspace(0, M-1, M) / (M*Te), abs(f),'o'); + +figure +bode(tf(1,[1.7483E-23 7.6663E-18 1.162E-11 3.0332E-6 1])) + + diff --git a/signal/matlab/LG.slx b/signal/matlab/LG.slx new file mode 100644 index 0000000..2a3348e Binary files /dev/null and b/signal/matlab/LG.slx differ diff --git a/signal/matlab/SimulDFT.slx b/signal/matlab/SimulDFT.slx new file mode 100644 index 0000000..1687828 Binary files /dev/null and b/signal/matlab/SimulDFT.slx differ diff --git a/signal/matlab/carre.slx b/signal/matlab/carre.slx new file mode 100644 index 0000000..1ff6b3d Binary files /dev/null and b/signal/matlab/carre.slx differ diff --git a/signal/matlab/carre32.m b/signal/matlab/carre32.m new file mode 100644 index 0000000..5f27e4c --- /dev/null +++ b/signal/matlab/carre32.m @@ -0,0 +1,27 @@ +clc; +clear all; +close all; + +F1 = 85000; +Fe = 320000; +F = 5000; + +Te = 1/Fe; +T = 1/F ; +M = T/Te; +Tsim = T-Te; +Res = sim('carre'); + +plot(Res.Carre_Continu,'b'); +hold on; +plot(Res.Signal_Filtre,'o'); + +%figure +f = fft(Res.Signal_Filtre.data, M); +%stem(linspace(0, M-1, M), abs(f),'o'); +figure +stem(linspace(0, M-1, M) / (M*Te), abs(f),'o'); + +figure +bode(tf(1,[1.7483E-23 7.6663E-18 1.162E-11 3.0332E-6 1])) + diff --git a/signal/matlab/scriptDFT.m b/signal/matlab/scriptDFT.m index 3f15a93..ae2c401 100644 --- a/signal/matlab/scriptDFT.m +++ b/signal/matlab/scriptDFT.m @@ -1,31 +1,33 @@ +clc; clear all; close all; -%% Paramètres -T = 0.25; % Fenêtre d'observation -M=32; % Nombre d'échantillons dans la fenêtre - - -%% Paramètres déduits -Te = T/M; % Période d'échantillonnage -Tsim = T-Te; % Instant final de simulation -Fsin = 4 ; -%% Calculs préliminaires - - -%% Lancement de simulink -out=sim("simDFT") - -%% Visualisations temporelle -plot(out.sin_continu,'.-'); -hold on; -plot(out.sin_echanti,'o'); -grid on; - -%% Calcul DFT - - -%% visualisation DFT -figure(); +T = 1/5000; +M = 64; +Te = T/M; +Tsim = T-Te; +Fe = 1/Te; + +%%Fsin = 4; +%%Fsin = 60; +%%Fsin = 64; shannon < Fe/2 +%%Fsin = 100; +Fsin=85000; +Res = sim('SimulDFT'); + +plot(Res.Sinus_Continu); +hold on; % permet de superposer la courbe à suivre +plot(Res.Sinus_Echanti,'o'); + +%figure +f = fft(Res.Sinus_Echanti.data, M)/M; +%stem(linspace(0, M-1, M), abs(f),'o'); +figure +stem(linspace(0, M-1, M) / (M*Te), abs(f),'o'); + +%%figure +%%plot(linspace(0, M-1, M) / (M*Te/100), abs(fft(Res.Sinus_Continu.data, M)/M)); +%%hold on; +%%plot(linspace(0, M-1, M) / (M*Te), abs(fft(Res.Sinus_Echanti.data, M)/M),'o');