TP matlab

This commit is contained in:
Boyu Fu 2023-03-24 16:00:35 +01:00
parent 57163ca9ee
commit 951b575884
7 changed files with 88 additions and 26 deletions

Binary file not shown.

33
signal/matlab/L32.m Normal file
View file

@ -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]))

BIN
signal/matlab/LG.slx Normal file

Binary file not shown.

BIN
signal/matlab/SimulDFT.slx Normal file

Binary file not shown.

BIN
signal/matlab/carre.slx Normal file

Binary file not shown.

27
signal/matlab/carre32.m Normal file
View file

@ -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]))

View file

@ -1,31 +1,33 @@
clc;
clear all; clear all;
close all; close all;
%% Paramètres T = 1/5000;
T = 0.25; % Fenêtre d'observation M = 64;
M=32; % Nombre d'échantillons dans la fenêtre Te = T/M;
Tsim = T-Te;
Fe = 1/Te;
%% Paramètres déduits
Te = T/M; % Période d'échantillonnage %%Fsin = 4;
Tsim = T-Te; % Instant final de simulation %%Fsin = 60;
Fsin = 4 ; %%Fsin = 64; shannon < Fe/2
%% Calculs préliminaires %%Fsin = 100;
Fsin=85000;
Res = sim('SimulDFT');
%% Lancement de simulink
out=sim("simDFT") plot(Res.Sinus_Continu);
hold on; % permet de superposer la courbe à suivre
%% Visualisations temporelle plot(Res.Sinus_Echanti,'o');
plot(out.sin_continu,'.-');
hold on; %figure
plot(out.sin_echanti,'o'); f = fft(Res.Sinus_Echanti.data, M)/M;
grid on; %stem(linspace(0, M-1, M), abs(f),'o');
figure
%% Calcul DFT stem(linspace(0, M-1, M) / (M*Te), abs(f),'o');
%%figure
%% visualisation DFT %%plot(linspace(0, M-1, M) / (M*Te/100), abs(fft(Res.Sinus_Continu.data, M)/M));
figure(); %%hold on;
%%plot(linspace(0, M-1, M) / (M*Te), abs(fft(Res.Sinus_Echanti.data, M)/M),'o');